raduprv / Eternal-Lands

http://www.eternal-lands.com
Other
158 stars 57 forks source link

Client thinks there was a click when pressing the Meta key #191

Open NetSysFire opened 2 years ago

NetSysFire commented 2 years ago

Potentially affects Linux only, but it might also work with Windows' virtual desktops.

Steps to reproduce:

Video of me reproducing the problem:

https://user-images.githubusercontent.com/59517351/166610287-7c1c841b-1f5e-4475-8955-d36f49621c55.mp4

I position the cursor on a clickable element, do Windows+left arrow and you see ffmpeg recording my screen, then I switch back with Windows+right arrow and suddenly the client thinks I clicked. I did not touch my mouse at all (minus moving the cursor to the tab in the encyclopedia) during this capture. I can also reproduce this by using any other keybind to change virtual desktops and switch back (So Windows+5 to switch to desktop 5 and Windows+< to switch to the previously viewed desktop). I am absolutely positive that there is no click, as I tested with other applications and the X event tester (xev). The only thing that may happen when using the Windows+<left/right arrow> keybind is me accidentally holding down the arrow button too long and a left/right arrow keypress gets sent to the application, but this does not trigger the click. I tested it by pressing just Windows or any arrow key and there was no click.

Expected behavior: No click. This is an annoying issue because when I am mixing or harvesting and do something else, like watching a video or even playing another game and switch back to the client, it might accidentally click buttons which usually causes me to interrupt my mixing or walk somewhere by accident Disproven. See comment below.

NetSysFire commented 2 years ago

Little update: I did some more testing and I dont know why I walked somewhere once but it is not reproducible anymore. This affects the UI only. Accidental map walking: Not possible (neither in the 3D view or tab map view). Accidental click on Xaquelina "You are done with harvesting" dialogues? Yes.

Curiously enough this does not affect the login screen.

NetSysFire commented 1 year ago

I found out that the cause is the meta/windows/super_l key. It reliably produces a click within the client, but only within certain windows.

    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,

I asked others to reproduce but they could not, probably because they all use DEs or WMs which bind the meta key by default. In my case it is sent to the client verbatim because it is not bound by my WM.

Windows which are affected by this include:

Unaffected parts:

AnnahsTail commented 1 year ago

I can confirm, can reproduce it reliably on my system (Gentoo with plasma/kde). Holding down "windows"/super key together with mouse movement produces same effect as pressing middle mouse button in EL:

One window i found unaffected for me is inventory and item lists, probably because normal MMB doesn't do anything in in as well.

Holding down or just pressing super_l / super_r key by itself doesn't produce any effect, only when paired with mouse movement. Pretty sure it only started happening last few years, i've always configured my WMs to use "windows" key for moving/resizing windows and switching tasks/desktops (all the way back to playing EL on FreeBSD 8 with dwm so 2009+-); and only EL is affected this ways.

update edit: in the mean time switched WM to i3 - same behavior as with KDE.