Skip to content
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

[gtk3] Binding of show/hide hotkey fails on Wayland #1109

Closed
coder-hugo opened this issue Jan 19, 2018 · 7 comments
Closed

[gtk3] Binding of show/hide hotkey fails on Wayland #1109

coder-hugo opened this issue Jan 19, 2018 · 7 comments

Comments

@coder-hugo
Copy link

coder-hugo commented Jan 19, 2018

I just upgraded to version 3.0.2 of guake which uses GTK3 instead of GTK2. As a result of this guake runs with full Wayland support. With Wayland there is no way for an application to register a global hotkey like it's possible with X11. My current workaround to get the new version of guake running under Wayland is to set the following environement variable GDK_BACKEND=x11 for the guake process. With this guake 3 will use also XWayland like it was the case for guake 2. So for now it's working but I think the better approach to solve this issue is to create a GAction which would appear in the global hotkeys section of the compositor. See this issus for more information.

Edit: I just figured out that the workaround with the GDK_BACKEND environment variable isn't the best. In this case the show/hide hotkey works only if the window that has currently the focus is also rendered by XWayland. So I looked for a better workaround and found the command line flag --toggle-visibility. So I configured a global hotkey in my compositor that calls guake --toggle-visibility. With this there is no need to run guake using the x11 backend. But to get this working the changes of the following commit 0f2da79 are required which aren't yet contained in a release.

@coder-hugo coder-hugo changed the title Binding of show/hide hotkey fails on Wayland [gtk3] Binding of show/hide hotkey fails on Wayland Jan 19, 2018
@coder-hugo
Copy link
Author

Just saw the following issue #1084 that describes the same issue. Unfortunately I haven't found it during my searches before I opened this separate issue. So one of these issues can be closed.

@gsemet
Copy link
Member

gsemet commented Jan 19, 2018

Issues look not the same, I ll keep them both

@egmontkob
Copy link

Not sure if the comments to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857228 give some additional info here (probably not).

I'm also wondering if Guake could offer a compatibility config option where it forces the use of X11/XWaylayd (maybe by just setting that env variable early in the startup phase). It's not as clean as @coder-hugo's suggestion with the GAction and global hotkeys, but still might have its valid use case.

@gsemet gsemet self-assigned this Jan 21, 2018
@gsemet gsemet modified the milestones: 3.0.2, 3.0.3, 3.0.4, 3.0.5 Jan 21, 2018
@gsemet gsemet modified the milestones: 3.0.5, 3.0.6 Mar 26, 2018
@gsemet gsemet modified the milestones: 3.0.6, 3.1.0, 3.2.0 Apr 9, 2018
gsemet added a commit to gsemet/guake that referenced this issue Jun 5, 2018
@gsemet gsemet modified the milestones: Backlog, -- Next Version -- Jun 5, 2018
@gsemet gsemet closed this as completed in 51aa791 Jun 6, 2018
@coder-hugo
Copy link
Author

Forcing to use the X11 backend is no solution for this issue. Additionally I think the backend to use shouldn't be hard-coded but configurable. I don't have any other issues with the wayland backend. I just can't configure the global hot-key for show/hide within guake but there is a workaround available as you can show and hide guake via the dbus interface. By using the X11 backend instead of the wayland backend you also break the scaling of the app as this just works properly using the wayland backend with the x11 backend the scaled content looks blurry.

@gsemet
Copy link
Member

gsemet commented Jun 6, 2018

Hi @coder-hugo. I understand your point, but I need to find a solution that satisfy the most people. I got the packaging of Guake blocked on Fedora because the global hotkey does not work by default, and I receive several new issues every week about Guake not working on Wayland. So for the moment, if the X11 backend works, I'll stick with it.

I cannot develop under wayland, I don't use it on any of my systems, sadly (I have 2 ubuntu baremetal + lot of VM but wayland never worked under Parallels).

So, feel free to hack into the code and propose a pull request. I have opened a ticket to add this support on #1343.

@coder-hugo
Copy link
Author

Hi @gsemet. I also understand your point. But in this case I would definitely prefer to have an option for forcing the X11 backend. To prevent all those new issues of course this should be set to true by default. And the UI for this option should show a hint that disabling it may cause some issues.
The reason why I'm not happy with this change is that this is a step backwards for the next version of Guake. It's not just that the scaling doesn't work properly with the X11 backend. The X11 is also a very insecure protocol compared with wayland. With wayland an application can only access the content of its own windows. This is not the case for X11. Under X11 each application can access the content of other windows and also catch events that happened outside of its window(s). I'm pretty happy that currently more and more of my day-to-day used apps get adapted to support wayland so that losing this support for Guake wouldn't be that cool.
Maybe I find some time at the weekend to open a pull request at least to have an option to disable the forcing of the X11 backend.

@gsemet
Copy link
Member

gsemet commented Jun 8, 2018

i'll be thinking into adding the "X11 compatibility mode for wayland" option, but currently there is no way to have libkeybinder work under wayland. So user needs to hack their own guake shortcut on GNOME, and kde user has to make the same, and so on. If i can get help on this maybe guake can be smoothly integrated and future-proof, but most of the time, I cannot do it alone, not having a Wayland nor a KDE or other than Gnome desktop.

@gsemet gsemet modified the milestones: -- Next Version --, 3.3.0 Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants