diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-05-01 21:41:26 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-05-01 21:41:26 +0200 |
| commit | 0394a27074b8067bf22b586ab52f22d79f088f10 (patch) | |
| tree | 25f56b73cd2df23a3016e5ca2c489372c326ea64 | |
| parent | 02c7ee5128c02f25c1f46cea12d5c5dbba1eca55 (diff) | |
Wayland: wl_cursor_theme_load() may return NULL
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 5 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index d7f6a32be..ed9ae1313 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -1227,7 +1227,10 @@ void Fl_Wayland_Screen_Driver::close_display() { } wl_subcompositor_destroy(wl_subcompositor); wl_subcompositor = NULL; wl_surface_destroy(seat->cursor_surface); seat->cursor_surface = NULL; - wl_cursor_theme_destroy(seat->cursor_theme); seat->cursor_theme = NULL; + if (seat->cursor_theme) { + wl_cursor_theme_destroy(seat->cursor_theme); + seat->cursor_theme = NULL; + } wl_compositor_destroy(wl_compositor); wl_compositor = NULL; wl_shm_destroy(wl_shm); wl_shm = NULL; if (seat->wl_keyboard) { diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 080f7f149..fc3d22801 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -1330,7 +1330,7 @@ void Fl_Wayland_Window_Driver::resize_after_screen_change(void *data) { int Fl_Wayland_Window_Driver::set_cursor(Fl_Cursor c) { Fl_Wayland_Screen_Driver *scr_driver = (Fl_Wayland_Screen_Driver*)Fl::screen_driver(); struct wld_window *xid = (struct wld_window *)Fl_Window_Driver::xid(pWindow); - + if (!scr_driver->seat->cursor_theme) return 1; // Cursor names are the files of directory /usr/share/icons/XXXX/cursors/ // where XXXX is the name of the current 'cursor theme'. switch (c) { |
