I observed some segfaults and was finally able to catch them in the debugger. Turns out some key events are
getting dispatched before the eventloop is initialized, which will try to insert some timers in the non existing
loop. So this PR moves initialization of the eventloop to directly after initializing the connection.
(Note: There is a loop_destroy function defined, but it seems to be unused)
#1 0x000055bd6d561cf2 in loop_add_timer
(loop=0x0, ms=<optimized out>, callback=callback@entry=0x55bd6d564540 <keyboard_repeat>, data=data@entry=0x55bd6ec1fdd0)
I observed some segfaults and was finally able to catch them in the debugger. Turns out some key events are getting dispatched before the
eventloop
is initialized, which will try to insert some timers in the non existing loop. So this PR moves initialization of the eventloop to directly after initializing the connection.(Note: There is a
loop_destroy
function defined, but it seems to be unused)Backtrace
``` #0 0x00007fe8f4d393a9 in wl_list_insert (list=list@entry=0x20, elm=elm@entry=0x55bd6ec10508) at ../src/wayland-util.c:48 #1 0x000055bd6d561cf2 in loop_add_timer (loop=0x0, ms=State
``` { eventloop = 0x0, clear_indicator_timer = 0x0, clear_password_timer = 0x0, display = 0x55bd6ec19bc0, compositor = 0x55bd6ec20dc0, subcompositor = 0x55bd6ec20f90, layer_shell = 0x55bd6ec21120, input_inhibit_manager = 0x0, shm = 0x55bd6ec21440, surfaces = { prev = 0x55bd6ec20708, next = 0x55bd6ec20908 }, images = { prev = 0x55bd6d56da78