Wayland: allow Fl_Window::cursor(Fl_Cursor) for whole window
This commit is contained in:
parent
9ff67f013e
commit
a4d0f7d269
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user