Implement the Activate D-Bus method for primary click handling#4
Open
mikhailnov wants to merge 1 commit into
Open
Implement the Activate D-Bus method for primary click handling#4mikhailnov wants to merge 1 commit into
mikhailnov wants to merge 1 commit into
Conversation
Handle the org.kde.StatusNotifierItem Activate() method that KDE Plasma calls on left-click. When a signal handler is connected, emit the "activate" GObject signal and return success. When no handler is connected, return an error so the panel falls back to showing the context menu for backward compatibility. This fixes the dual menu+toggle issue for applications like Onboard that need left-click to perform a custom action instead of showing the context menu. Co-authored-by: Z.AI GLM
Author
|
I undertstand that libayatana-appindicator is depreceated, but libayatana-appindicator-glib cannot be used, because KDE cannot work with otg.gtk.Menus - context menus do not work. Similar PR to ibayatana-appindicator-glib: AyatanaIndicators/libayatana-appindicator-glib#101 (but it seems to be not suitable for onboard until KDE becomes able to read context menus from org.gtk.Menus, if ever) |
Author
|
org.kde.StatusNotifierItem has X and Y coordinates, but I am not sure if they can work in Wayland... Onboard is for X11 only - ther eis no good alternative for Wayland. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handle the org.kde.StatusNotifierItem Activate() method that KDE Plasma calls on left-click. When a signal handler is connected, emit the "activate" GObject signal and return success. When no handler is connected, return an error so the panel falls back to showing the context menu for backward compatibility.
This fixes the dual menu+toggle issue for applications like Onboard that need left-click to perform a custom action instead of showing the context menu.
Co-authored-by: Z.AI GLM
Why did I need this?
The Onboard https://github.com/onboard-osk/onboard virtual on-screen keyboard uses AppIndicator and can easily be switched to using Ayatana:
ROSA Linux package of onboard has used such patch for a long time.
Onboard can draw a tray icon either via the obsolete GtkStatusIcon, or via AppIndicator. GtkStatusIcon draws a pixelled, not high quality icon. AppIdincator draws a good icon.
Onboard tray icon opens and hides the keyboard via a left click (by a mouse or a finger on touch screens). With Ayatana AppIndicator, both a context menu and hide/show were triggered on right click. With this patch for AppIndicator it became possible to:
The patch for onboard is the following (it just removes hacks and simplifies its code):
I will try to upstreamize it into Onboard (https://github.com/onboard-osk/onboard) if this PR is merged here.