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

toggling guake show/hide under wayland looses focus #492

Open
andreicristianpetcu opened this issue Apr 13, 2015 · 77 comments

Comments

@andreicristianpetcu
Copy link

commented Apr 13, 2015

Hi,

I am running Arch GNU/Linux with Gnome shell 3.16 on top of Wayland.
I have F12 set to show/hide Guake but when I run it under Wayland and press F12 Guake does not appear. This happens when I have no other apps opened. If I have any app opened and focused (for example Firefox) and press F12, Guake appears.

Another related issue is once Guake is opened, if I press F12 again to close it, it does not close. I need to press other keys and then F12 in order for it to work.

Basically I cannot press F12/F12/F12.... to show/hide Guake. I managed to reproduce this on Arch with Gnome shell 3.14 and Wayland also, not only with 3.16. It runs perfectly on Xorg on both Gnome shell versions.

If you wish I can try to make a Vagrant box with GUI running a Fedora and I can make it easy for you to reproduce it.

PS: This bug it the only thing blocking me from switching to Wayland :P

Thank you for building Guake! :D

@gsemet gsemet added this to the 0.6.0 milestone Apr 13, 2015

@gsemet

This comment has been minimized.

Copy link
Member

commented Apr 13, 2015

I cannot reproduce it and don't have vagrant so if you have something to help I'll welcome it !

@andreicristianpetcu

This comment has been minimized.

Copy link
Author

commented Apr 13, 2015

Hmmm so your are you unwilling to install Vagrant? What distro are you using? What gnome shell version? I want to find a way for you to reproduce the issue. Thank you!

@gsemet

This comment has been minimized.

Copy link
Member

commented Apr 13, 2015

Never used vagrant
Ubuntu 14.04 gnome

@andreicristianpetcu

This comment has been minimized.

Copy link
Author

commented Apr 14, 2015

In order to reproduce this bug you need to run a fairly recent Gnome Shell under Wayland. How do you prefer to do this? I suggest using Vagrant even if you did not use it before since it is easy for you to use it. Will Ubuntu Gnome switch to Wayland soon?

@gsemet

This comment has been minimized.

Copy link
Member

commented Apr 14, 2015

I cannot do anything that requires large among of work to change my environment. It will be easier for you if you try to debug the code yourself, there are log, it's python code so pretty easy to understand. I guess however this is a tricky bug :(

@andreicristianpetcu

This comment has been minimized.

Copy link
Author

commented Apr 14, 2015

I've just put a 10$ bounty on this bug on bountysource. I'll try to get more people interested in this bug, I hope it will change the priority from "Low" :P It breaks toggle functionality on new software and toggle functionality is a core feature of Guake I hope I'm not the only person with this issue :P https://www.bountysource.com/issues/11035271-toggling-guake-show-hide-under-wayland-looses-focus

@andreicristianpetcu

This comment has been minimized.

Copy link
Author

commented Apr 14, 2015

Will it be easier for you if I manage to give you a virtual machine with Ubuntu Gnome beta installed?

@gsemet

This comment has been minimized.

Copy link
Member

commented Apr 14, 2015

yes it can :) I had tried to install gnome beta several months ago but I don't have the VM anymore :(

@gsemet gsemet added Priority: High and removed Priority: Low labels Apr 14, 2015

@gsemet

This comment has been minimized.

Copy link
Member

commented Apr 14, 2015

Defect passed high for andrei

@andreicristianpetcu

This comment has been minimized.

Copy link
Author

commented Apr 14, 2015

Thank you! :D I'll try to make a Gnome VM in the following days. This will help you get a beta machine quite fast. But I will need to take a ubuntu 15.04 server or cloud, strap Gnome on it and export the VM somewhere.

@andreicristianpetcu

This comment has been minimized.

Copy link
Author

commented Apr 15, 2015

Making a Gnome Virtual Machine with both VirtualBox and Gnome Boxes failed. The current beta is pretty much broken. I don't want to get into more details.
I managed to reproduce the bug on a Ubuntu Gnome 15.04 beta1 live USB.

  1. get the beta http://cdimage.ubuntu.com/ubuntu-gnome/releases/vivid/beta-1/ & write it on a USB
  2. boot form it
  3. connect to the Internet, open a terminal and run
    sudo apt-get update && apt-get install -y gnome-session-wayland && apt-get install -y guake
  4. logout from the menu and login back selecting Wayland like in this image http://worldofgnome.org/uploads/2014/03/wayland-gdm.png (leave the password empty)
  5. start guake
  6. leave all applications closed except for guake in the background and press "F12". Nothing happens.
    If you start Firefox and press F12 in Firefox, Guake pops up but if Firefox is closed it does not.
    Hope this helps you reproduce the bug on a environment similar to your dev env.
    It seems that I am not the only person that has/will have this problem https://plus.google.com/u/0/117017819812643628894/posts/YY363wktxV8
    I hope this extra information is useful :)
@beanaroo

This comment has been minimized.

Copy link

commented Apr 17, 2015

Just wanted to confirm bug on Arch running 3.16.1. Hot key works when guake preferences is in focus.

@nilehmann

This comment has been minimized.

Copy link

commented Apr 18, 2015

I came to report the same thing. Also Arch running gnome 3.16.1

@gsemet gsemet modified the milestones: 0.6.0, 0.7.0 Apr 19, 2015

@varemenos

This comment has been minimized.

Copy link
Contributor

commented Apr 28, 2015

Can also confirm this on Arch running Gnome 3.16.1

@gsemet gsemet modified the milestones: 0.7.0, 0.8.0 May 2, 2015

@matachi

This comment has been minimized.

Copy link
Contributor

commented May 10, 2015

I took a look at this. Sadly I haven't managed to fix the problem. However, I believe the problem resides in the globalhotkeys C code.

In the file keybinder.c during the initialization it calls gdk_window_add_filter, where the first parameter is a window and the second parameter is a function that will be called for each event produced in the window. As it is being called now, it does it with the root window gdk_get_default_root_window (). Reading the documentation for gdk_window_add_filter we find:

Pass NULL for window to get all events for all windows, instead of events for a specific window.

This is what I tried, and it did not make any difference.

If we uncomment the 21st line in keybinder.c and recompile it by running ./dev.sh, we will get additional terminal output when pressing F12. When pressing F12 a couple of times to reveal and hide Guake with a window in focus we get the following output:

Got accel 65481, 0
Got keycode 96
Got modmask 0
--no-startup-script argument defined, so don't execute the startup script
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 2, -1
Got KeyPress! keycode: 96, modifiers: 0
Calling handler for 'F12'...
DBG Window display
DBG: Showing the terminal
do not set background from user
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 65, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 22, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 22, -1
Got Event! 22, -1
Got Event! 28, -1
Got Event! 19, -1
Got Event! 15, -1
Got Event! 12, -1
Got Event! 9, -1
Got Event! 65, -1
Got Event! 3, -1
Got KeyRelease!
Got Event! 9, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 33, -1
Got Event! 33, -1
Got Event! 65, -1
Got Event! 65, -1
Got Event! 65, -1
Got Event! 65, -1
Got Event! 65, -1
Got Event! 65, -1
Got Event! 65, -1
Got Event! 65, -1
Got Event! 65, -1
Got Event! 10, -1
Got Event! 9, -1
Got Event! 10, -1
Got Event! 10, -1
Got Event! 2, -1
Got KeyPress! keycode: 96, modifiers: 0
Calling handler for 'F12'...
DBG Window display
DBG: gtk.gdk.WindowState = <flags GDK_WINDOW_STATE_STICKY |
GDK_WINDOW_STATE_ABOVE of type GdkWindowState>

DBG: gtk.gdk.WindowState = 40
DBG: GDK_WINDOW_STATE_STICKY? True
DBG: GDK_WINDOW_STATE_WITHDRAWN? False
DBG: GDK_WINDOW_STATE_ABOVE? True
DBG: hiding the terminal
Got Event! 18, -1
Got Event! 10, -1
Got Event! 10, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 28, -1
Got Event! 3, -1
Got KeyRelease!

I have highlighted the more interesting sections in bold.

If we change workspace in Gnome Shell to an empty one, i.e. where we don't have any window in focus, and press F12, these sections aren't produced. Therefore we can draw the conclusion that the keypress isn't detected since the output on line 168 in keybinder.c is never produced.

I don't know what is causing this behavior though; Wayland? Mutter? Globalhotkeys? Guake?

However, I see that there is a proposal, #510, to replace Globalhotkeys with a different library. I don't know though. keybinder hasn't been updated since 2012, so I doubt it will make any difference to be honest.

I did this testing in a virtual machine running Ubuntu GNOME 15.04 32-bit. Since VirtualBox doesn't support Wayland (yet), I used VMware instead. However, VMware is proprietary and only has a free 30 days trial.

@gsemet

This comment has been minimized.

Copy link
Member

commented Jun 6, 2015

Hello
Can you try with the latest HEAD, we have switched to an keybinder module

@gsemet gsemet added this to the 0.8.0 milestone Jun 6, 2015

@brhahlen

This comment has been minimized.

Copy link

commented Feb 21, 2017

It started working for me again, a week ago. Setting and resetting the Global Keyboard Shortcut (in Gnome Settings, not in guake) fixed it for me

@pypingou

This comment has been minimized.

Copy link
Member

commented Feb 21, 2017

Setting and resetting the Global Keyboard Shortcut (in Gnome Settings, not in guake) fixed it for me

Could you describe a little more what you did?

@brhahlen

This comment has been minimized.

Copy link

commented Feb 21, 2017

Go to the Gnome Applications Menu, type in "Keyboard", and click on the "Keyboard" Settings shortcut.
This will open a list with the default Global Keyboard Shortcuts.
Scroll all the way down, click the "+" and add Guake:
Name: Guake
Command: guake -t
Shortcut: F9 (in my case)

Do a reboot, just to be sure, because it didn't initially register for me.

@erbridge

This comment has been minimized.

Copy link

commented Feb 21, 2017

Mine is now working again in the Guake settings, too.

@gsemet

This comment has been minimized.

Copy link
Member

commented Feb 21, 2017

@brhahlen

This comment has been minimized.

Copy link

commented Feb 21, 2017

I didn't specifically replace anything :-)
The hotkey is set both in Guake and in Gnome, and it works now. The advantage is that I don't need the autostart for Guake, as just pressing F9 will start Guake for me.

So I don't want to say this is the ideal solution, just what works for me.

@livthomas

This comment has been minimized.

Copy link

commented Feb 21, 2017

@brhahlen, thanks, it works after changing the Gnome shortcut and restarting the system.

@thedrint

This comment has been minimized.

Copy link

commented Mar 14, 2017

@brhahlen your method works for me, without restarting the system.
With a global hotkey guake shows up a little bit slower, but it works everywhere. So i use different hotkeys to run and to toggle guake. If local not working, global does.

@stibbons, i can add another one case with Fedora 25, Gnome3.22, Wayland.
If I run Naitilus and focuse it, my guake's hotkey ctrl + space not show guake, but toogle selection of directory under mouse.

@yunhao94

This comment has been minimized.

Copy link

commented Mar 21, 2017

@brhahlen thank you, it works!

@LaurentDumont

This comment has been minimized.

Copy link

commented Aug 19, 2017

Just updated my Debian laptop and it seems I'm hitting the same issue. I can add the shortcut, but it introduces a small delay on the Guake shell spawning. It's a bit weird when you are used to the proper speed.

For now, I've switched to Gnome on X11 when login in, which fixes the shortcut not working on the Desktop or in files.

@jorgeecardona

This comment has been minimized.

Copy link

commented Aug 22, 2017

I have updated my Debian (testing) installation and I have the same issue now, the workaround works well. I reduced the delay by using the following code:

#!/usr/bin/env python2
# -*- coding: utf-8; -*- 
import dbus

try:
    bus = dbus.SessionBus()
    remote_object = bus.get_object('org.guake.RemoteControl', '/org/guake/RemoteControl')
    remote_object.show_hide()
except dbus.DBusException:
    pass

I put this in /usr/bin/guake-toggle.py with exec permissions, and changed the shortcut to execute this command. I used the strings DBUS_NAME and DBUS_PATH directly to avoid importing anything from guake.


I am not sure if this is a solely wayland bug, in such case maybe adding this command to guake is a good idea and it would help in future similar bugs.

@XaF

This comment has been minimized.

Copy link

commented Sep 5, 2017

Another situation that is linked: as it is, you can show the guake window when there is another window of a non-gnome program that's open. The problem also appears to show the guake window on the right screen. i.e. if you have no window, or only gnome apps windows, open on one screen, you won't be able to open your guake window on that screen even if your mouse is there. If you have at least one non-gnome window on that screen, it works. Seems moving your mouse around in gnome windows / gnome desktop does not update the mouse position...

@nathanaelmeister

This comment has been minimized.

Copy link

commented Sep 11, 2017

@brhahlen nice one this works for me too, now since I found out how to make @jorgeecardona script work it also starts pretty smooth :-) Did need to reboot though!

@camabeh

This comment has been minimized.

Copy link

commented Sep 15, 2017

@brhahlen, thanks working perfectly

@sylvainvh

This comment has been minimized.

Copy link

commented Dec 15, 2017

Hello,
this workaround work really well with a single monitor. When you have multiple monitors guake appear only on the first monitor.

@gsemet gsemet removed this from the 0.8.11 milestone Jan 11, 2018

@bhaskarkc

This comment has been minimized.

Copy link

commented May 11, 2018

The workaround still works on Antergos + Wayland.

@and-semakin

This comment has been minimized.

Copy link

commented Sep 8, 2018

I have the same bug on Fedora 28, GNOME Shell 3.28.1.

@mrshu

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2018

I've ran into a different bug on Fedora 28, GNOME Shell 3.28.2:

I have had F12 mapped to guake -t and it worked quite well. However, as part of some recent update it seems I am no longer able to map F12 to anything. I therefore had to resort to mapping guake -t to F10 which thankfully still works but is far from optimal.

If anyone has any clue as to how to get F12 to work again, I would greatly appreciate it.

@hmayer

This comment has been minimized.

Copy link

commented Nov 3, 2018

I have the same bug on Archlinux, GNOME Shell 3.30.1
The workaround mapping two times the same shortcut (Guake and GNOME Settings) works for me.
Edit: versions

Guake Terminal: 3.3.2
VTE: 0.54.2
VTE runtime: 0.54.2
Gtk: 3.24.1

@Ealrann

This comment has been minimized.

Copy link

commented Nov 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.