aboutsummaryrefslogtreecommitdiff
path: root/src/cursor.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-18 18:16:50 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-18 18:16:50 +0200
commita6422818b8498021f00629d9b3ddb549c39ed27c (patch)
treeb85124157a870a83902e32f69e622b87c9361725 /src/cursor.c
parentc57d78f177d27c077eb907ea6c24e903da595690 (diff)
x11 cursor deinit: check if display is valid
Diffstat (limited to 'src/cursor.c')
-rw-r--r--src/cursor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cursor.c b/src/cursor.c
index 078b55d..ffa1562 100644
--- a/src/cursor.c
+++ b/src/cursor.c
@@ -146,8 +146,10 @@ void gsr_cursor_deinit(gsr_cursor *self) {
self->texture_id = 0;
}
- XISelectEvents(self->display, DefaultRootWindow(self->display), NULL, 0);
- XFixesSelectCursorInput(self->display, DefaultRootWindow(self->display), 0);
+ if(self->display) {
+ XISelectEvents(self->display, DefaultRootWindow(self->display), NULL, 0);
+ XFixesSelectCursorInput(self->display, DefaultRootWindow(self->display), 0);
+ }
self->display = NULL;
self->egl = NULL;