Don't disable application menu widget when it's clicked
This change fixes non-working application menu widget in compact mode and improves it's work in standard mode.
Here's how to reproduce issue:
- Add "application menu" widget to desktop
- Configure this widget to be in compact mode
- Run any application in windowed mode, ensure that "application menu" widget is visible and application window is active
- Click on application menu "hamburger" button
What happens: Nothing
What is expected to happen: Application menu should be displayed.
Why it happens? It looks like when application menu is clicked, application window becomes inactive, and menu updated right away. But new menu is empty, thus nothing is shown.
Another scenario.
- Add "application menu" widget to desktop
- Ensure it's configured in standard mode
- Run any application in windowed mode, ensure that "application menu" widget is visible and application window is active. For example, let's take "konsole" application. "Konsole" has following first-level menu entries: "File", "Edit", "View", etc.
- Click any top-level menu item in application menu widget. For example, click "File".
What happens: While contents of clicked menu item are shown, all top-level menu items are removed, thus it becomes impossible to use application menu widget until application window is focused again.
What is expected to happen: Top-level menu items should stay.
One more scenario this commit changes:
- Add "application menu" widget to desktop
- Run any application in windowed mode, ensure that "application menu" widget is visible and application window is active.
- Minimize application window.
- Close application.
What currently happens: Application menu widget becomes inactive after step 3
What will happen: Application menu widget will become inactive after step 4
I believe this described issue might be caused by commit d8d079e4. Before mentioned change there was a check whether new active window was 'desktop window' or some other 'system' window, thus when you switched to desktop or activated application menu widget, application menu widget did not deactivate. See d8d079e4, removed lines 223-227 in file applets/appmenu/plugin/appmenumodel.cpp. But I didn't verify it.