icewm icon indicating copy to clipboard operation
icewm copied to clipboard

Alt-Tab behaviour wrong when changing key combination

Open marcelkorpel opened this issue 3 years ago • 7 comments

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.

marcelkorpel avatar Apr 09 '21 09:04 marcelkorpel

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

gijsbers avatar Apr 09 '21 16:04 gijsbers

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

marcelkorpel avatar Apr 09 '21 17:04 marcelkorpel

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?

gijsbers avatar Apr 09 '21 19:04 gijsbers

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.

marcelkorpel avatar Apr 09 '21 20:04 marcelkorpel

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.

gijsbers avatar Apr 09 '21 21:04 gijsbers

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...

wongma7 avatar Jun 02 '21 20:06 wongma7

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.

gijsbers avatar Jun 05 '21 23:06 gijsbers