[client] display: stop callbacks before state teardown
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled

This commit is contained in:
Geoffrey McRae
2026-08-12 03:00:25 +10:00
parent ebc9d076ec
commit f1615aa333
3 changed files with 15 additions and 10 deletions

View File

@@ -967,13 +967,19 @@ static void x11Startup(void)
static void x11Shutdown(void)
{
if (x11.jitRender)
if (x11.frameEvent)
x11SignalFrame(LG_DS_WAIT_FRAME_INTERRUPTED);
if (x11.eventThread)
{
lgJoinThread(x11.eventThread, NULL);
x11.eventThread = NULL;
}
}
static void x11Free(void)
{
lgJoinThread(x11.eventThread, NULL);
x11Shutdown();
if (x11.jitRender)
{

View File

@@ -149,10 +149,10 @@ struct LG_DisplayServerOps
/* called after window creation, renderer, and input providers are ready */
void (*startup)(void);
/* called just before final window destruction, before final free */
/* stop all callbacks before application subsystems are destroyed */
void (*shutdown)(void);
/* final free */
/* final resource destruction after shutdown */
void (*free)(void);
/*

View File

@@ -3483,6 +3483,11 @@ static void lg_shutdown(void)
lgJoinThread(t_render, NULL);
}
// Stop external input callbacks before tearing down shared client state
evdev_stop();
if (g_state.ds && g_state.dsInitialized)
g_state.ds->shutdown();
fallbackStop();
if (t_cursorRepaint)
@@ -3498,9 +3503,6 @@ static void lg_shutdown(void)
}
LG_LOCK_FREE(l_cursorRepaint.lock);
// An evdev batch may call input handlers; join before input teardown
evdev_stop();
if (g_state.transport.ops)
{
lgInput_dropTransport();
@@ -3534,9 +3536,6 @@ static void lg_shutdown(void)
e_startup = NULL;
}
if (g_state.ds)
g_state.ds->shutdown();
lgClipboard_free();
app_releaseAllKeybinds();