diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 30827508e..d0183ee46 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -438,9 +438,11 @@ static void cursor_surface_enter(void *data, Fl_Window *win = Fl::first_window(); if (win) { Fl_Wayland_Window_Driver *driver = Fl_Wayland_Window_Driver::driver(win); +//fprintf(stderr, "cursor_surface_enter: cursor_default=%d standard_cursor=%d\n", driver->cursor_default(), driver->standard_cursor()); struct wl_cursor *cursor = driver->cursor(); if (cursor) do_set_cursor(seat, cursor); - else driver->set_cursor(driver->cursor_default()); + else if (driver->cursor_default()) driver->set_cursor(driver->cursor_default()); + else win->cursor(driver->standard_cursor()); } } diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H index d1c724127..2ed5ed8e2 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.H @@ -59,10 +59,12 @@ private: cairo_rectangle_int_t *subRect_; // makes sure subwindow remains inside its parent window static bool in_flush; // useful for progressive window drawing static Fl_Wayland_Plugin *gl_plugin(); - struct wl_cursor *cursor_; + struct wl_cursor *cursor_; // non-null when using custom cursor + Fl_Cursor standard_cursor_; // window's standard custom kind void delete_cursor_(); struct gl_start_support *gl_start_support_; // for support of gl_start/gl_finish public: + inline Fl_Cursor standard_cursor() { return standard_cursor_; }; struct wl_cursor *cursor() { return cursor_; }; bool in_handle_configure; // distinguish OS and user window resize struct window_output { diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 55f54d275..2c8097e5e 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -74,6 +74,7 @@ Fl_Wayland_Window_Driver::Fl_Wayland_Window_Driver(Fl_Window *win) : Fl_Window_D { shape_data_ = NULL; cursor_ = NULL; + standard_cursor_ = FL_CURSOR_DEFAULT; in_handle_configure = false; screen_num_ = -1; gl_start_support_ = NULL; @@ -1425,6 +1426,7 @@ int Fl_Wayland_Window_Driver::set_cursor(Fl_Cursor c) { return 0; } if (cursor_) delete_cursor_(); + standard_cursor_ = c; scr_driver->set_cursor(); return 1; }