ch11ng / exwm

Emacs X Window Manager
2.85k stars 134 forks source link

Gracefully handle xmodmap -e "clear mod4" #655

Closed emacksnotes closed 5 years ago

emacksnotes commented 5 years ago

Gracefully handle xmodmap -e "clear mod4"

My init file has some bindings on the super key (as below). It has a mix of standard and my own functions.

When I try xmodmap -e "clear mod4", I see [XELB ERROR] (wrong-type-argument number-or-marker-p nil). The debug log shows a stacktrace when handling the s-c key. (s-c is the first of the keys in exwm-input-global-keys and is bound to my own custom command).

Once the above error happens, some of the keys on my keyboard stops working and for all practical purposes the laptop becomes useless. I have no other go, but to logout and login again.

Kindly handle the error gracefully so that my system remains usable.

 '(exwm-input-global-keys
   '(([8388707]
      . exwm-capture)
     ([8388722]
      . exwm-reset)
     ([8388727]
      . exwm-workspace-switch)
~$ date; xmodmap; date; xmodmap -e "clear mod4"; date;
Mon Sep 16 19:45:19 IST 2019
xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5      

Mon Sep 16 19:45:19 IST 2019
Mon Sep 16 19:45:19 IST 2019
[XELB ERROR] (wrong-type-argument number-or-marker-p nil)
[19:45:19] xcb:-connection-filter:  Event received: [28 0 89 36 3 0 96 1 188 1 0 0 153 82 74 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [28 0 89 36 3 0 96 1 189 1 0 0 153 82 74 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[19:45:19] exwm--on-PropertyNotify: atom=_NET_WM_STRUT(444)
[19:45:19] exwm--update-struts-legacy:  #x1600003
[19:45:19] exwm-input--on-PropertyNotify:   
[19:45:19] exwm--on-PropertyNotify: atom=_NET_WM_STRUT_PARTIAL(445)
[19:45:19] exwm--update-struts-partial: #x1600003
[19:45:19] xcb:-cache-request:  Cache request #9306: [20 0 6 0 3 0 96 1 189 1 0 0 6 0 0 0 0 0 0 0 12 0 0 0]
[19:45:19] xcb:-connection-filter:  Reply received: [1 32 90 36 12 0 0 0 6 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 85 5 0 0 0 0 0 0 0 0 0 0]
[19:45:19] exwm-workspace--update-struts:   ([top 24 [0 1365]] [bottom 24 [0 1365]])
[19:45:19] exwm-workspace--update-workareas:    ([0 24 1366 720] [0 24 1366 720] [0 24 1366 720] [0 24 1366 720])
[19:45:19] exwm-workspace--set-fullscreen:  frame=#<frame Firefox-esr<2> 0x55e641668e80>
[19:45:19] exwm-workspace--set-fullscreen:  x=0; y=24; w=1366; h=720
[19:45:19] exwm--set-geometry:  Setting #x3200027 to 1366x720+0+24
[19:45:19] xcb:-cache-request:  Cache request #9307: [12 0 7 0 39 0 32 3 15 0 0 0 0 0 0 0 24 0 0 0 86 5 0 0 208 2 0 0]
[19:45:19] exwm--set-geometry:  Setting #x2000143 to 1366x720+nil+nil
[19:45:19] xcb:-cache-request:  Cache request #9308: [12 0 5 0 67 1 0 2 12 0 0 0 86 5 0 0 208 2 0 0]
[19:45:19] exwm-workspace--set-fullscreen:  frame=#<frame *scratch* 0x55e642e6a7d0>
[19:45:19] exwm-workspace--set-fullscreen:  x=0; y=24; w=1366; h=720
[19:45:19] exwm--set-geometry:  Setting #x3200028 to 1x1+0+24
[19:45:19] xcb:-cache-request:  Cache request #9309: [12 0 7 0 40 0 32 3 15 0 0 0 0 0 0 0 24 0 0 0 1 0 0 0 1 0 0 0]
[19:45:19] exwm--set-geometry:  Setting #x20002ae to 1366x720+nil+nil
[19:45:19] xcb:-cache-request:  Cache request #9310: [12 0 5 0 174 2 0 2 12 0 0 0 86 5 0 0 208 2 0 0]
[19:45:19] exwm-workspace--set-fullscreen:  frame=#<frame *scratch* 0x55e642c50b30>
[19:45:19] exwm-workspace--set-fullscreen:  x=0; y=24; w=1366; h=720
[19:45:19] exwm--set-geometry:  Setting #x3200029 to 1x1+0+24
[19:45:19] xcb:-cache-request:  Cache request #9311: [12 0 7 0 41 0 32 3 15 0 0 0 0 0 0 0 24 0 0 0 1 0 0 0 1 0 0 0]
[19:45:19] exwm--set-geometry:  Setting #x20003f8 to 1366x720+nil+nil
[19:45:19] xcb:-cache-request:  Cache request #9312: [12 0 5 0 248 3 0 2 12 0 0 0 86 5 0 0 208 2 0 0]
[19:45:19] exwm-workspace--set-fullscreen:  frame=#<frame *scratch* 0x55e642dfae00>
[19:45:19] exwm-workspace--set-fullscreen:  x=0; y=24; w=1366; h=720
[19:45:19] exwm--set-geometry:  Setting #x320002a to 1x1+0+24
[19:45:19] xcb:-cache-request:  Cache request #9313: [12 0 7 0 42 0 32 3 15 0 0 0 0 0 0 0 24 0 0 0 1 0 0 0 1 0 0 0]
[19:45:19] exwm--set-geometry:  Setting #x2000542 to 1366x720+nil+nil
[19:45:19] xcb:-cache-request:  Cache request #9314: [12 0 5 0 66 5 0 2 12 0 0 0 86 5 0 0 208 2 0 0]
[19:45:19] exwm-input--on-PropertyNotify:   
[19:45:19] xcb:-connection-filter:  Event received: [28 0 98 36 10 0 96 3 115 1 0 0 221 82 74 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[19:45:19] exwm--on-PropertyNotify: atom=_NET_WM_USER_TIME(371)
[19:45:19] exwm-input--on-PropertyNotify:   
[19:45:19] xcb:-connection-filter:  Event received: [28 0 98 36 10 0 96 3 115 1 0 0 225 85 74 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[19:45:19] exwm--on-PropertyNotify: atom=_NET_WM_USER_TIME(371)
[19:45:19] exwm-input--on-PropertyNotify:   
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 250 85 74 0 3 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-cache-request:  Cache request #9315: [119 0 1 0]
[19:45:19] xcb:-connection-filter:  Event received: [34 0 98 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 255 85 74 0 5 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 0 86 74 0 6 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 1 86 74 0 7 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 2 86 74 0 8 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 2 86 74 0 9 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 3 86 74 0 11 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 4 86 74 0 12 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 4 86 74 0 13 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Event received: [85 1 98 36 5 86 74 0 15 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0]
[19:45:19] xcb:-connection-filter:  Reply received: [1 3 99 36 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 50 62 0 66 0 0 37 105 0 64 108 205 77 0 0 0 0 0 0 0 0 0 0 0]
[19:45:19] exwm-input--on-keysyms-update:   
[19:45:19] exwm-input--update-global-prefix-keys:   
[19:45:19] xcb:-cache-request:  Cache request #9316: [15 0 2 0 62 1 0 0]
[19:45:19] xcb:-connection-filter:  Reply received: [1 0 100 36 64 0 0 0 62 1 0 0 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 42 0 32 3 41 0 32 3 40 0 32 3 1 0 32 0 1 0 96 0 1 0 64 0 3 0 96 0 1 0 128 0 1 0 192 0 1 0 0 1 1 0 224 0 1 0 32 1 2 0 128 0 1 0 64 1 1 0 128 1 2 0 32 1 12 0 32 0 1 0 96 1 9 0 96 1 3 0 96 1 22 0 96 1 1 0 192 1 36 0 96 1 1 0 0 2 23 0 0 2 8 0 96 0 3 0 192 1 37 0 96 1 80 1 0 2 1 0 32 2 1 0 64 2 1 0 128 2 1 0 192 2 109 1 0 2 1 0 160 2 2 0 32 2 8 0 192 2 4 0 224 2 1 0 0 3 8 0 224 2 3 0 128 2 1 0 32 3 39 0 32 3 2 0 32 3 45 0 64 3 3 0 64 3 43 0 32 3 1 0 96 3 2 0 96 3 6 0 96 3 33 6 0 2 44 0 32 3 10 0 96 3 1 0 64 3 16 0 64 3 1 0 128 3 19 0 64 3 22 0 64 3 1 0 192 3 1 0 224 3 1 0 0 4 56 0 64 3 1 0 32 4 63 0 64 3]
[19:45:19] exwm-input--grab-global-prefix-keys: 
[19:45:19] exwm-input--grab-global-prefix-keys: k: 8388707
[19:45:19] exwm-input--grab-global-prefix-keys: keysyms: nil
  backtrace()
  #f(compiled-function (&rest _) #<bytecode 0x15799076d3cd>)(error (wrong-type-argument number-or-marker-p nil))
  #f(compiled-function (obj keysym) "Convert keysym to (the first matching) keycode.\n\nReturn 0 if conversion fails." #<bytecode 0x15799086929d>)(#<xcb:connection xcb:connection-157990b54720> nil)
  apply(#f(compiled-function (obj keysym) "Convert keysym to (the first matching) keycode.\n\nReturn 0 if conversion fails." #<bytecode 0x15799086929d>) #<xcb:connection xcb:connection-157990b54720> nil)
  xcb:keysyms:keysym->keycode(#<xcb:connection xcb:connection-157990b54720> nil)
  exwm-input--grab-global-prefix-keys(52428842 52428841 52428840 2097153 6291457 4194305 6291459 8388609 12582913 16777217 14680065 18874369 8388610 20971521 25165825 18874370 2097164 23068673 23068681 23068675 23068694 29360129 23068708 33554433 33554455 6291464 29360131 23068709 33554768 35651585 37748737 41943041 46137345 33554797 44040193 35651586 46137352 48234500 50331649 48234504 41943043 52428801 52428839 52428802 54525997 54525955 52428843 56623105 56623106 56623110 ...)
  apply(exwm-input--grab-global-prefix-keys (52428842 52428841 52428840 2097153 6291457 4194305 6291459 8388609 12582913 16777217 14680065 18874369 8388610 20971521 25165825 18874370 2097164 23068673 23068681 23068675 23068694 29360129 23068708 33554433 33554455 6291464 29360131 23068709 33554768 35651585 37748737 41943041 46137345 33554797 44040193 35651586 46137352 48234500 50331649 48234504 41943043 52428801 52428839 52428802 54525997 54525955 52428843 56623105 56623106 56623110 ...))
  exwm-input--update-global-prefix-keys()
  exwm-input--on-keysyms-update()
  #f(compiled-function (obj data) "Handle 'MapNotify' event." #<bytecode 0x157990835769>)(#<xcb:connection xcb:connection-157990b54720> [85 1 98 36 250 85 74 0 3 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0])
  apply(#f(compiled-function (obj data) "Handle 'MapNotify' event." #<bytecode 0x157990835769>) #<xcb:connection xcb:connection-157990b54720> [85 1 98 36 250 85 74 0 3 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0])
  xcb:keysyms:-on-MapNotify(#<xcb:connection xcb:connection-157990b54720> [85 1 98 36 250 85 74 0 3 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0])
  #f(compiled-function (data _) #<bytecode 0x157990b9d645>)([85 1 98 36 250 85 74 0 3 0 148 0 8 255 0 0 0 0 8 73 0 0 0 0 8 248 133 3 0 0 0 0] nil)
  #f(compiled-function (conn) "Process cached events." #<bytecode 0x15799079bd21>)(#<xcb:connection xcb:connection-157990b54720>)
  apply(#f(compiled-function (conn) "Process cached events." #<bytecode 0x15799079bd21>) #<xcb:connection xcb:connection-157990b54720> nil)
  xcb:-process-events(#<xcb:connection xcb:connection-157990b54720>)
  xcb:-connection-filter(#<process XELB> "U\1b$\372UJ\0\3\0\224\0\10\377\0\0\0\0\10I\0\0\0\0\10\370\205\3\0\0\0\0")
ch11ng commented 5 years ago

Thanks for the report. This is fixed with 9c85f172e5697f85bdea67ef8b23819448abd31a.