-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: FEAT(client): Add support to XDG Desktop Portal GlobalShortcuts #5976
base: master
Are you sure you want to change the base?
Conversation
e9f84da
to
c1fd93f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the implementation using the name "xdp" rather than "xdg"?
And I'm wondering: Given that this is such a new feature, do we want to keep the old wayland notice in-place and show, if on wayland and if the new impl is not available?
src/mumble/CMakeLists.txt
Outdated
qt_add_dbus_interface(mumble_xdp_SRCS org.freedesktop.portal.GlobalShortcuts.xml globalshortcuts_portal_interface) | ||
find_file(PORTALSREQUEST_XML share/dbus-1/interfaces/org.freedesktop.portal.Request.xml PATH_SUFFIXES share PATHS /usr ${CMAKE_INSTALL_PREFIX}) | ||
qt_add_dbus_interface(mumble_xdp_SRCS ${PORTALSREQUEST_XML} portalsrequest_interface) | ||
target_sources(mumble_client_object_lib PRIVATE ${mumble_xdp_SRCS}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should be outsourced into a dedicated cmake function implemented in a file inside the cmake
directory. Then this place here could simply call that function.
Plus, it seems that we currently don't handle the case when the searched for file can't be found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved both files to auxiliary_files.
I am not sure what you mean by adding the function. Do you still want it if we are not looking it up?
And out of curiosity: Will this be a flatpak-specific thing or will this (likely) solve the issue for Wayland users in general (also for non-flatpak apps)? |
e00c411
to
a59e8f3
Compare
Yes, this should solve it for every Wayland system. Also it can work on X11 provided it's properly implemented in the backend like we are doing in KDE/Plasma and I expect others will too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long delay since my last review - I have been rather busy
#ifdef Q_OS_LINUX | ||
if (EnvUtils::waylandIsUsed()) { | ||
// Due to the issues we're currently having on Wayland, we disable shortcuts by default | ||
bShortcutEnable = false; | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably get the same treatment as the note in the settings UI
// TODO | ||
return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just marking this so we don't lose track of this TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to address this TODO we'll need to use an interface like this:
https://invent.kde.org/libraries/xdg-portal-test-kde/-/merge_requests/18
This means depending on Qt::GuiPrivate and libwaylandclient. If you are interested in this I can include it in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. This seems rather hacky. What are the implications of simply leaving the implementation as it is? Aka: what exactly is the parent window ID being used for?
Will this perhaps only become relevant when dealing with multiple Mumble instances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parent window is simply to inform the portal who is calling this and which window the dialog should be on top.
The dialog will appear on top and focussed anyway, so it shouldn't be a big deal. FWIW, there will be public API for this in Qt 6 (6.5, if I'm not mistaken). If you don't want to depend on private API, just delaying until Qt 6 is a good option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay in that case it indeed seems a good idea to simply delay this 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6fbe414
to
62bb6d9
Compare
This makes it possible to have global shortcuts on systems running the XDG Desktop Portal service. This is especially relevant on Wayland where we are not able to run a system-wide keylogger to get the global shortcuts triggers. Fixes mumble-voip#5257
62bb6d9
to
0e0f075
Compare
Two awkward things I've noticed which may or may not be related to the implementation in this PR:
|
Correct, we don't have global shortcuts triggered my mouse in Plasma. It should be supported by Plasma or the Desktop Environment of choice of the user anyway.
Again, this is Plasma deciding that they are not the same shortcut and not triggering it. There's not much we can (or should) do from this side. I suggest we continue this discussion in the bug report you created: https://bugs.kde.org/show_bug.cgi?id=465867 I suggest explaining a bit more on the bug report why it's important for anymodifier to trigger the subject's shortcut. If we have clear use cases it will be easier to get it acted on. |
What's the status of this PR? Can't wait to enjoy global shortcuts in Mumble using KDE Wayland. |
Has any more progress been made on this? |
This makes it possible to have global shortcuts on systems running the XDG Desktop Portal service. This is especially relevant on Wayland where we are not able to run a system-wide keylogger to get the global shortcuts triggers.
Fixes #5257
Checks
WIP because I'm not very familiar because this is a codebase alien to me and I'm aware it's doing some nasty things. Still, I'd prefer to know how the maintainers want to do it rather than imagining myself what they want instead.
Note the GlobalShortcuts portal is merged to master but it still isn't released.