From a524c4c5c678bce1849428515d41ac5fe3a45ee3 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sun, 29 Oct 2023 14:29:38 +0200 Subject: [PATCH] Improve fullscreen mode Solves a bug with menu not starting in full screen mode after the config has been updated. Signed-off-by: Mavridis Philippe --- src/menuhandler.cpp | 21 ++++++++------------- src/tastymenu.cpp | 2 +- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/menuhandler.cpp b/src/menuhandler.cpp index e0c226f..1899029 100644 --- a/src/menuhandler.cpp +++ b/src/menuhandler.cpp @@ -82,7 +82,6 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl) readConfig(); setupColumns(); - updateWindowType(); setBackground(); //Searchline... @@ -492,8 +491,8 @@ void MenuHandler::readConfig() void MenuHandler::updateConfig() { readConfig(); - updateWindowType(); setBackground(); + updateWindowType(); menu->dynamicList->setActionIconSize( _actionIconSize ); menu->rootList->setActionIconSize( _actionIconSize ); @@ -572,12 +571,9 @@ void MenuHandler::popup(TQPoint pos) else move(prefSkel->normalWindowX(), prefSkel->normalWindowY()); + updateWindowType(); resize(w,h); - - if (prefSkel->startFullScreen()) - showFullScreen(); - else - showNormal(); + show(); } void MenuHandler::initOldInstalledApps(KServiceGroup::Ptr group) @@ -1670,6 +1666,8 @@ void MenuHandler::menuModeChanged( int index ) void MenuHandler::updateWindowType() { auto parentWidget = static_cast(parent()); + hide(); + setWindowState(TQt::WindowNoState); if (_isNormalWindow) { reparent(parentWidget, TQt::WType_Dialog, pos()); @@ -1677,9 +1675,10 @@ void MenuHandler::updateWindowType() else { if (prefSkel->startFullScreen()) { reparent(parentWidget, TQt::WType_TopLevel, pos()); + setWindowState(TQt::WindowFullScreen); } else { - reparent(parentWidget, TQt::WType_Popup | TQt::WNoAutoErase, pos()); + reparent(parentWidget, TQt::WType_Popup, pos()); } } } @@ -1690,12 +1689,8 @@ void MenuHandler::switchWindowMode() _isNormalWindow = !_isNormalWindow; prefSkel->setIsNormalWindow(_isNormalWindow); prefSkel->writeConfig(); - updateWindowType(); - if (prefSkel->startFullScreen()) - showFullScreen(); - else - showNormal(); + show(); menu->detachButton->setIconSet(TQPixmap(uic_findImage(_isNormalWindow ? "attach.png" : "detach.png"))); } diff --git a/src/tastymenu.cpp b/src/tastymenu.cpp index 2b8520c..25c17db 100644 --- a/src/tastymenu.cpp +++ b/src/tastymenu.cpp @@ -56,7 +56,7 @@ TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidge _showBigToolTip = kickerConf->readBoolEntry("EnableIconZoom", true); button = new TastyButton(this); - menuHandler = new MenuHandler(this, prefSkel, "MenuHandler", 0); + menuHandler = new MenuHandler(this, prefSkel, "MenuHandler", WType_TopLevel); connect (button, SIGNAL (pressed()), this, SLOT (clickSlot ())); connect (menuHandler, SIGNAL(hidden()), this, SLOT(setButtonUp()));