diff --git a/plugin-mainmenu/lxqtmainmenu.cpp b/plugin-mainmenu/lxqtmainmenu.cpp index a689db423..e6fe5cf94 100644 --- a/plugin-mainmenu/lxqtmainmenu.cpp +++ b/plugin-mainmenu/lxqtmainmenu.cpp @@ -77,12 +77,6 @@ LXQtMainMenu::LXQtMainMenu(const ILXQtPanelPluginStartupInfo &startupInfo): mMenuCacheNotify = nullptr; #endif - mDelayedPopup.setSingleShot(true); - mDelayedPopup.setInterval(200); - connect(&mDelayedPopup, &QTimer::timeout, this, &LXQtMainMenu::showHideMenu); - mHideTimer.setSingleShot(true); - mHideTimer.setInterval(250); - mSearchTimer.setSingleShot(true); connect(&mSearchTimer, &QTimer::timeout, this, &LXQtMainMenu::searchMenu); mSearchTimer.setInterval(350); // typing speed (not very fast) @@ -132,14 +126,7 @@ LXQtMainMenu::LXQtMainMenu(const ILXQtPanelPluginStartupInfo &startupInfo): else mShortcutSeq = mShortcut->shortcut(); }); - connect(mShortcut, &GlobalKeyShortcut::Action::activated, this, [this] { - if (!mHideTimer.isActive()) - // Delay this a little -- if we don't do this, search field - // won't be able to capture focus - // See and - // - mDelayedPopup.start(); - }); + connect(mShortcut, &GlobalKeyShortcut::Action::activated, this, &LXQtMainMenu::showHideMenu); } } @@ -430,8 +417,6 @@ void LXQtMainMenu::buildMenu() mMenu->addSeparator(); menuInstallEventFilter(mMenu, this); - connect(mMenu, &QMenu::aboutToHide, &mHideTimer, QOverload<>::of(&QTimer::start)); - connect(mMenu, &QMenu::aboutToShow, &mHideTimer, &QTimer::stop); mMenu->addSeparator(); mMenu->addAction(mSearchViewAction); @@ -667,7 +652,6 @@ bool LXQtMainMenu::eventFilter(QObject *obj, QEvent *event) const QString press = QKeySequence{static_cast(mod)}.toString() % QString::fromLatin1(key_meta.valueToKey(keyEvent->key())).remove(0, 4); if (press == mShortcutSeq) { - mHideTimer.start(); mMenu->hide(); // close the app menu return true; } diff --git a/plugin-mainmenu/lxqtmainmenu.h b/plugin-mainmenu/lxqtmainmenu.h index 7dedb297c..f751a9b45 100644 --- a/plugin-mainmenu/lxqtmainmenu.h +++ b/plugin-mainmenu/lxqtmainmenu.h @@ -110,8 +110,6 @@ class LXQtMainMenu : public QObject, public ILXQtPanelPlugin XdgMenu mXdgMenu; #endif - QTimer mDelayedPopup; - QTimer mHideTimer; QTimer mSearchTimer; QString mShortcutSeq; QString mMenuFile;