bbidulock / icewm

A window manager designed for speed, usability, and consistency
Other
585 stars 98 forks source link

Alt-Tab behaviour wrong when changing key combination #574

Closed marcelkorpel closed 1 year ago

marcelkorpel commented 3 years ago

Since 2.3.0, when setting

KeySysSwitchNext="Super+Tab"

KeySysSwitchLast="Super+Shift+Tab"

in preferences (instead of the default Alt+Tab) the behaviour of the QuickSwitch window is wrong: after releasing the Super key (Windows key in my case), the window stays in place, having to press Enter of select a window with a mouse click before switching windows.

In 2.2.1, this behaviour was still correct. When leaving the keys to Alt+Tab and Alt+Shift+Tab, the behaviour is also still correct in 2.3.1.

gijsbers commented 3 years ago

Works fine here with those settings. Does it matter what you do with Win95Keys and ModSuperIsCtrlAlt?

marcelkorpel commented 3 years ago

Setting Win95Keys has no effect, but setting ModSuperIsCtrlAlt to 0 alleviates this issue.

gijsbers commented 3 years ago

Good! ModSuperIsCtrlAlt is a hack of nearly 20 years ago. Why would the WM need to be responsible for remapping the Super key to Ctrl+Alt? Then the default value of true also doesn't make sense to me. I favor removing this preference entirely. Any objections from anyone?

marcelkorpel commented 3 years ago

No problems whatsoever from my side (can you see what the need was of that hack?), but is this solution not a workaround of the actual issue? I mean, prior to 2.3.0 it didn't exist.

gijsbers commented 3 years ago

The ModSuperIsCtrlAlt allows to emulate the Super key by pressing Ctrl+Alt instead. It is there for keyboards without Super keys. But if you do have Super keys then it can complicate things, like here. We may assume that now nearly all keyboards have Super keys and hence disable this by default and leave it there just in case. The new code in 2.3.0 improves the old code by being more strict about what is recognized as a valid modifier key to close the switch, but it wasn't prepared to handle the ModSuperIsCtrlAlt case yet.

wongma7 commented 3 years ago

This is me complaining about "Change the default value for ModSuperIsCtrlAlt from true to false to see if anyone complains for issue #574." :-P

All my keybinds are left with the default CtrlAlt modifier but I have always used Super instead, so I was a bit baffled after updating why my keybinds didn't seem to work. What if all default keybinds changed from CtrlAlt to Super too? In that case, I wouldn't have noticed. But then it would break people who rely on the CtrlAlt versions of the keybinds.

I guess there is no perfect solution. I understand that the hack has existed for 20 years and am totally fine with it getting removed. As long as there is notice in the repo somewhere, in general I don't really mind if keybinds/ModSuperIsCtrlAlt break/get removed. I update frequently and at my own risk. But I can only speak for myself...

gijsbers commented 3 years ago

Thanks for complaining :) Just for correctness: the hack isn't removed. It is still there. You only need to become aware of what it is that you are using and explicitly enable it. It was announced in the release notes of 2.3.2.