sixxie wrote: ↑Thu Oct 10, 2024 10:00 am
Can you try the "x11fix" branch (or download http://www.6809.org.uk/tmp/xroar/xroar-x11fix.tar.gz) and see if that helps? I make an explicit call to XkbQueryExtension() when the display is set. It's _just about_ possible that GTK+ 3 hasn't initialised it by that point where for some reason GTK+ 2 has.
Sorry about the delay. It's been a busy day. The fix doesn't compile for me...
Thread 1 "xroar" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e19678 in _XkbReloadDpy () from /lib/x86_64-linux-gnu/libX11.so.6
(gdb) bt
#0 0x00007ffff7e19678 in _XkbReloadDpy () at /lib/x86_64-linux-gnu/libX11.so.6
#1 0x00007ffff7e19c2c in XKeysymToKeycode () at /lib/x86_64-linux-gnu/libX11.so.6
#2 0x00005555555c9cac in hk_x11_update_keymap () at x11/hkbd_x11.c:109
#3 0x0000555555580e3f in hk_update_keymap () at hkbd.c:1159
#4 0x00005555555812f9 in hk_init () at hkbd.c:1129
#5 0x00005555555cf639 in ui_gtk3_new (cfg=0x55555562c860 <xroar_ui_cfg>) at gtk3/ui_gtk3.c:438
#6 0x0000555555585557 in module_init
(module=module@entry=0x55555562dae0 <ui_gtk3_module>, cfg=cfg@entry=0x55555562c860 <xroar_ui_cfg>) at module.c:74
#7 0x00005555555a0fb7 in xroar_init (argc=argc@entry=1, argv=argv@entry=0x7fffffffdb78) at xroar.c:1032
#8 0x0000555555577aaa in main (argc=1, argv=0x7fffffffdb78) at main_unix.c:48
(gdb)
Thread 1 "xroar" received signal SIGSEGV, Segmentation fault.
0x00007ffff7e1920b in XkbGetMapChanges () from /lib/x86_64-linux-gnu/libX11.so.6
(gdb) bt
#0 0x00007ffff7e1920b in XkbGetMapChanges () at /lib/x86_64-linux-gnu/libX11.so.6
#1 0x00007ffff7e19c90 in XKeysymToKeycode () at /lib/x86_64-linux-gnu/libX11.so.6
#2 0x00005555555c9c0c in hk_x11_update_keymap () at x11/hkbd_x11.c:103
#3 0x0000555555580e1f in hk_update_keymap () at hkbd.c:1159
#4 0x00005555555812d9 in hk_init () at hkbd.c:1129
#5 0x00005555555cf599 in ui_gtk3_new (cfg=0x55555562c860 <xroar_ui_cfg>) at gtk3/ui_gtk3.c:439
#6 0x0000555555585537 in module_init
(module=module@entry=0x55555562dae0 <ui_gtk3_module>, cfg=cfg@entry=0x55555562c860 <xroar_ui_cfg>) at module.c:74
#7 0x00005555555a0f97 in xroar_init (argc=argc@entry=1, argv=argv@entry=0x7fffffffdb58) at xroar.c:1032
#8 0x0000555555577a8a in main (argc=1, argv=0x7fffffffdb58) at main_unix.c:48
(gdb)
I really appreciate the effort, but unfortunately, still more or less the same result. Only tested under wsl2 this time...
Well, thank you for testing...
This article mentions an identical crash in pa-applet on a switch to wayland, so I'm at least moderately sure this is due to wayland not doing X11 properly.
The last thing I can think of trying is to force the backend to X11, running like this:
Might do nothing different, as it may already be assuming that backend, but it may be that GTK+ has been doing wayland things all along and just mistakenly returns a valid value when the X11 display it's using is requested from it. XRoar then takes that value and goes on using it to query things.
Otherwise I'm going to have to find some way to try things in wayland...