-
-
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
Push to talk does not work in Wayland / Gnome3 #3243
Comments
Hi, Not allowing clients to sniff on the input when they don’t have focus is a feature in Wayland, and it will be kept that way. The use can then trust their input to go where it is expected. There are four cases of global bindings that I am aware of:
Under Wayland, the first case will work as usual, since the compositor has control over the input. The second case would ideally be split between the first one (for launching stuff) and a non-problem, see below. Also, the average user doesn’t need such tweaks in the first place. So the ideal protocol would:
To have both, I went with an action-based protocol. I sent a proposal a few years ago and more recently, I made a cleaner one to allow for global action bindings. The action are namespaced, and you are expected to use fallbacks. For Mumble, it means you would ask for the (I should probably write all that to the mailing list, for the record if nothing else.) If there is any interest from Mumble developers for this solution, I am willing to implement the compositor side for Weston (and all libweston-based compositors) as well as WLC-based compositors (at least via an |
Sorry for taking so long to respond. @itsrachelfish Mumble currently defaults to using XInput2 to "sniff" keypresses and mouse events. However, it can also use raw evdev. Usually, the default device node permissions OSes allow you to read mouse clicks, but keyboards are off-limits (obviously). However, if you configure the device node permissions, Mumble can happily use your raw evdev device nodes to read key events, which should work on Wayland, or everything, really. The setting is "shortcut/linux/evdev/enable". To configure it on Linux, you'd add
to However, there is a bit of a misbehavior right now, where Mumble will fall back to XInput2 when no keyboards can be opened via evdev. This behavior is from back when evdev was our default. That's the workaround until we figure something proper out for Wayland. |
Bug for evdev misbehavior is at #3269 |
@sardemff7 I think your proposal (the August-dated one) looks solid. Is there an implementation of this stuff anywhere, or is it just a spec for now? |
...But I'm not sure it's enough in its current incarnation. At least it doesn't map fully onto the way global shortcuts work in Mumble currently. (And obviously: it doesn't need to. We're willing to use different UI if we need to, for different platforms.) It seems like, if we were to use the current API, Mumble would simply bind to "mumble/push-to-talk", "mumble/volume-up", "mumble/volume-down", etc. -- and we wouldn't be able to show the actual bound key to the user, because that part is handled by the compositor. That means the UI for shortcuts would be less than ideal for users. Perhaps we need a way to query which keys/events are bound to an action, so we can show that to the user? How would the flow work from a user perspective? Do you configure the actions outside the app itself? Kind of ties into my previous comment, but I suppose the current API requires us to bind to the actions on startup, correct? If we don't, we won't receive notifications when the action is triggered? |
Hmmm. Actually, on my Ubuntu 16.10 test VM, /dev/input/mice (or mouseXX) are also only root readable (or rw by group 'input'). |
Not allowing sniffing on evdev directly is also a goal (that most OSes now do right because device nodes are root, as you noticed). For now, there is no code behind my proposal, because nobody actually had (code-backed) interest in it. If Mumble is willing to implement it, I can make a Weston implementation, but I think at least a GNOME or KDE implementation would be needed to really push that protocol forward. The client (Mumble) binds actions at startup, as you guessed. As for the UI/UX, it would be compositor-dependent. Each DE/compositor would have its own UI (for Weston, it would just be the configuration file, at first, but writing a GUI tool is not really hard to do either). I can imagine GNOME and KDE having a new thing in their control panel, with a list of action strings and the corresponding binding(s). Mumble would bind actions in the |
I was impacted by this and came up with a possibly solution. I extended mumble's dbus api to include Then I wrote a small program that looked for the mouse button event I was using for push to talk that I could run with root permissions that could then send startTalk on mouse button down and stopTalk on mouse button up. In the long term the desktops need to define some wayland accessibility system where users can bind global hot keys, and having such a thing send dbus messages seems reasonable. But for the moment my little hard coded program will get me through my next gaming session. Mumble patch
Hackish program.
|
It seems weird to disallow broadcast (or multicast) in the spec. I can imagine examples where the user would want to broadcast voip/push-to-talk to multiple apps. Imagine a gamer with their friends on mumble, but also other randomly matched teammates using the voip built into the game. They'd have one key bound to mumble/push-to-talk for their friends, but when they want to talk to their whole team, they want one button to activate push-to-talk in both apps. Of course, usually in this case, the game would be in focus and could get the key presses that way, but that seems like a weird and unnecessary limitation. As that user, I would expect my global push-to-talk key to keep working even if I alt-tab out to my browser for a second. Could we leave it entirely up to the compositor to decide where to send the actions? |
From my proposed protocol:
It is up to the compositor. With that protocol, anyway. |
Doh. I should have looked at the actual proposal instead of only reading this issue. |
Would it be an idea to allow push-to-talk to be triggered through the RPC (to both start and stop)? That way, under wayland, one can simply configure their desktop environment to run Edit: upon closer inspection, the dbus PR already covers my usecase. |
@detrout's patch + following sway config snippet (with swaywm/sway#5132) is working nicely for me:
Would there be any problems with merging the patch? |
It's already merged, but after 1.3.0 release, so we need to wait for the next release of Mumble. |
It'll be part of the 1.4 release. Since it is not a hotfix, it won't be in 1.3.1. |
Since #3675 has been merged into master already, I'll also close this issue as resolved. |
Oh, I see. Thanks! I've opened swaywm/sway#5132 to allow using this without constantly reinvoking the |
If any Fedora users want to try out the dbus calls from #3675, I have created a copr repository with that pull request patched into version 1.3.2. https://copr.fedorainfracloud.org/coprs/carlwgeorge/mumble-wayland/ You'll still have to configure the dbus calls as shortcuts in your desktop environment. |
I was annoyed with this, but in my case, after activating the topicons extension (to get legacy trayicons on top bar) the keyboard shortcut started to be received by mumble! So, it's a workaround but it maybe helpful meantime |
bump |
@JuniorJPDJ To my knowledge Wayland does not provide support for registering global shortcuts but inhibits keyboard event polling (what we are currently doing) when the application doesn't have focus. That means we'd have to write specific code for every (major) DE out there in order to hook into their way of doing this (if there is one). Thus as far as long as this situation doesn't change, I don't see us going down that route. Imo this is just a major missing feature of Wayland. |
We have to prioritize Evdev over X11. |
The best solution is probably: flatpak/xdg-desktop-portal#624 This would ideally be a universal way of registering global keyboard shortcuts. You wouldn't need to do compositor-specific tweaks. |
I published a small generic workaround for Wayland push to talk that listens on specific key events on evdev and pushes those events to Xwayland. https://github.com/Rush/wayland-push-to-talk-fix I think it can be easily adjusted to send those to dbus instead. |
I recently upgraded my OS to use Gnome 3.24.2 which now uses Wayland instead of X. Gnome has used Wayland by default since version 3.16, which was released in 2015.
Push to talk works as expected when Mumble has focus and also works when certain applications like Firefox or my text editor are in focus.
However, push to talk does not work when a Wayland native application is in focus, like gnome-terminal or gnome-files.
If I start pressing push to talk with Mumble focused and switch tabs to a Wayland native application, Mumble does not detect when I stop pressing the push to talk key and it stays open until I switch back.
I've tried using both keyboard and mouse hotkeys, but the behavior is the same.
I couldn't find any other issues related to this bug on GitHub, but I did find this similar bug report in the Red Hat bug tracker: https://bugzilla.redhat.com/show_bug.cgi?id=1417576
Any further information about what could be causing this bug would be appreciated, thank you!
The text was updated successfully, but these errors were encountered: