raboof / notion

Tiling tabbed window manager
https://notionwm.net/
GNU Lesser General Public License v2.1
268 stars 63 forks source link

Weird scratchpad behaviour. Keypress are send to active window. #279

Open buhl opened 4 years ago

buhl commented 4 years ago

I have a program running in an open scratchpad. if I press F2 to open a new terminal in the scratchpad I get the new terminal but the active scratchpad window also receives the F2 key. Can anyone else confirm this? I am on master.

raboof commented 4 years ago

I see this as well

wilhelmy commented 4 years ago

I think this is what I meant to describe in #227, at least I'm seeing input weirdness with the scratchpad too, including across screens. Maybe #227 will go away if this is fixed.

buhl commented 4 years ago

Edit Btw. this is not related to the scratchpad. I see this on all windows.

Been looking a little more into this by trying to dive into the code. The input handling is quite layered and i came out with a rough idea to where i could start debugging this.

A little background first I have recently switched from xterm to gnome-terminal to alacritty. This made me think about when I started seeing these issues. So I did a little test: I started a terminal and ran alsamixer and then pressed F2 for a new terminal. I did it for my three terminal emulators and I only had the problem in alacritty.

So clearly this is an notion+program issue so for fun I started up xev -event keyboard and pressed F2 on the Event Test window


...

KeymapNotify event, serial 26, synthetic NO, window 0x0,
    keys:  4294967247 0   0   0   0   0   0   0   16  0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

KeyRelease event, serial 28, synthetic NO, window 0xc200001,
    root 0x5cf, subw 0x0, time 405499708, (193,482), root:(1474,496),
    state 0x0, keycode 68 (keysym 0xffbf, F2), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

So I suspect alacritty gets the KeyRelease event and assumes F2 was pressed? What terminal emulators are you using? Can one of you test with xev and tell me if you see the same?

buhl commented 4 years ago

@wilhelmy I do seem to recall odd focusing issues. But they are scarce. I will try to pay attention to them when they occur in the future. I just tried a hole lot of moving around spawning windows and toggling scratchpads without any issues...