`void *` casts into anything but `QVariant::value()` (most of the time)
does a metatype check which needs to match.
Also, we need to unwrap the `QPointer`.
BUG: 453301
There's no need to reconstruct the entire menu, when it exists already.
Also shows correct behavior on Wayland because the imported menues have
correct parents compared to the new one.
BUG:438467
That's in a plugin we don't link against here, we only see its header.
This happens to work with Qt5, but Qt6 wants fully defined types for
properties. Use a QAbstractItemModel pointer instead, we only access that
API anyway, and for QML the difference doesn't matter.
We do this sometimes, but not consistenly.
The benefit is twofold.
First it improves the diff when adding new values since no existing line needs to be touched.
Second it prevents clang-format from collapsing the definition into a single line, which is undesired for large enums.
Summary:
Hiding the old menu after the new menu is shown isn't possible on Wayland:
```
qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x17dd550) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x120d9f0) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents
```
Test Plan:
Before, Wayland: Trying to open a menu under Wayland while one is already open fails.
After, Wayland: Trying to open a menu under Wayland while one is already open succeeds.
Ensure no regressions on X11.
Reviewers: #plasma, #kwin, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D29464
Summary:
This patch ports the appmenu applet to use
libtaskmanager.
Test Plan: Ensure that there aren't any regressions.
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28146
Applications could place actions in the main menu bar that do not have a menu.
Also restore the checked binding when clicked to avoid it highlighting even though there is no menu.
This might also fix some spurious highlighting that I've seen when switching between windows.
Differential Revision: https://phabricator.kde.org/D11168
Summary:
--add NeedsAttention status when a menu is showing, and
Passive status when the menu is not available
--remove status updates from plasmoid interface
Test Plan:
I used debug messages to confirm the status changes and
also Latte to check that dynamic background now works ok
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10710
Summary:
-- hiding a menu shouldnt initialize the currentIndex to -1
at all cases. When a secondary menu is already shown then
the currentIndex should be only the index of the new menu.
This improves also the qml bindings because currentIndex
doesnt change all the time with no reason.
Test Plan:
added debug messages in qml side to check the value of
currentIndex
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10695
Summary:
drop the internal settings InApp,Menu, Decoration
but instead export the menu based on the presence of a dbus service called
org.kde.appmenuview, exported by either the menubar applet or the
kwin decoration button
let the decoration button and the globalmenubar work at the same time
not necessary anymore to have the setting in the kcm
Test Plan:
adding an appmenu applet causes apps started afterwards
to export their menubar, removing it causes new apps to
have their menubar internal again
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, ngraham, mvourlakos, broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D9215
Summary:
This sets a transient parent on the shown menus, meaning a panel knows
to stay open whilst it has any menu showing.
We also pulse setStatus() to trigger activating an autohidden panel if
activated via a shortcut.
BUG: 384861
Test Plan:
Ran menu
Using both mouse and keyboard shortcuts navigated a menu
and submenus
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D7883
We copy "ctx" pointer by value into our lambda but by the time our timer fires, it might be gone already.
Instead, pass "ctx" as context to QTimer::singleShot so it won't fire when it's gone.
BUG: 382386
FIXED-IN: 5.10.5
Differential Revision: https://phabricator.kde.org/D6951
childAt expects coordinates relative to the item, so we need to mapFromScene before we do that.
BUG: 375535
FIXED-IN: 5.9.1
Differential Revision: https://phabricator.kde.org/D4452
Summary:
::createMenu sometimes creates a new menu, sometimes returns a pointer
to a menu from libdbusmenu that we shouldn't delete.
This patch makes any newly created menu delete itself on closure.
It then shuffles some code so that we only call createMenu after
doing checks.
Test Plan:
Ran in compact mode, clicked menu a few times
Ran in full mode, clicked a menu a few times
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4393
Summary:
When recreating QQuickItem::mapToGlobal for < Qt 5.7 we are currently
using the window's global position and the item's position relevant to
it's parent. We need to use the item's position relative to the scene.
Test Plan: Had applet on right hand side of panel, menus are now in the correct place.
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4117
Test Plan: Tested menu is still in the same place
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4099
Some changes made to global menu applet:
1. Use "application-menu" icon in compact view.
2. Show a warning sign when global menu style is not set to "Widget".
3. When in a vertical panel force use compact view.
4. And some minor changes and cleanup.
Differential Revision: https://phabricator.kde.org/D4070
Summary:
This restores the global menu applet which you can place in panel.
The applet provides two views namely Compact and Full View.
Views can be switched from applet's settings.{F859590}
* Compact View provides a single button for accessing the application's
menu
{F859505}
* Full View shows the full application menu in panel
{F859566}
See https://phabricator.kde.org/D3156
Reviewers: #plasma, broulik, chinmoyr
Subscribers: andreaska, davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3706