mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-19 09:13:33 +01:00
This patch is to fix an issue seen on FreeBSD 15 where keybinding are mixed up at the cold start of wmaker. It is mentioned at https://github.com/window-maker/wmaker/issues/43 Seems that issue is not happening on Linux. A warm restart ("restart window maker") from the root menu is getting rid of that issue temporarily. To solve that issue, now wmaker is reloading the keyboard mapping via the new wReadKeybindings function when a XkbNewKeyboardNotifyMask event is received. It means xkb, which is part of X11 core, is now used by default and not conditionally with modelock. I tried to delay reading the keybinding as late as possible but it did not solve the issue as seems X is started with a improper keyboard by default. Here some debug trace when the bindings are loaded by wmaker on FreeBSD: Keybind F12: keycode=96 modifier=0x0 <--- cold starting wmaker Keybind F11: keycode=95 modifier=0x0 Keybind Escape: keycode=9 modifier=0x4 Keybind M: keycode=58 modifier=0x8 Keybind H: keycode=43 modifier=0x8 Keybind Up: keycode=98 modifier=0x8 <--- keycode is wrong, provided by X11 Keybind Down: keycode=104 modifier=0x8 Keybind Tab: keycode=23 modifier=0x8 Keybind Tab: keycode=23 modifier=0x9 Keybind Right: keycode=102 modifier=0xc Keybind Left: keycode=100 modifier=0xc Keybind 1: keycode=10 modifier=0x8 Keybind 2: keycode=11 modifier=0x8 Keybind 3: keycode=12 modifier=0x8 Keybind 4: keycode=13 modifier=0x8 Keybind 5: keycode=14 modifier=0x8 Keybind 6: keycode=15 modifier=0x8 Keybind 7: keycode=16 modifier=0x8 Keybind 8: keycode=17 modifier=0x8 Keybind 9: keycode=18 modifier=0x8 Keybind 0: keycode=19 modifier=0x8 Keybind Print: keycode=111 modifier=0x0 <--- keycode is wrong, 111 is UP key /usr/ports/x11-wm/windowmaker/work/WindowMaker-0.96.0/src/.libs/wmaker(execInitScript(main.c:531)): error: /root/GNUstep/Library/WindowMaker/autostart:could not execute initialization script <--- warm restart from wmaker Keybind F12: keycode=96 modifier=0x0 Keybind F11: keycode=95 modifier=0x0 Keybind Escape: keycode=9 modifier=0x4 Keybind M: keycode=58 modifier=0x8 Keybind H: keycode=43 modifier=0x8 Keybind Up: keycode=111 modifier=0x8 <--- UP key keycode is correct Keybind Down: keycode=116 modifier=0x8 Keybind Tab: keycode=23 modifier=0x8 Keybind Tab: keycode=23 modifier=0x9 Keybind Right: keycode=114 modifier=0xc Keybind Left: keycode=113 modifier=0xc Keybind 1: keycode=10 modifier=0x8 Keybind 2: keycode=11 modifier=0x8 Keybind 3: keycode=12 modifier=0x8 Keybind 4: keycode=13 modifier=0x8 Keybind 5: keycode=14 modifier=0x8 Keybind 6: keycode=15 modifier=0x8 Keybind 7: keycode=16 modifier=0x8 Keybind 8: keycode=17 modifier=0x8 Keybind 9: keycode=18 modifier=0x8 Keybind 0: keycode=19 modifier=0x8 Keybind Print: keycode=107 modifier=0x0 <--- Print keycode is correct Alternatively, to mitigate the issue, .xinitrc can be set to: setxkbmap -layout us exec wmaker or whatever layout you are using.