diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-13 14:48:08 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-13 14:48:08 +0100 |
| commit | 0936c2a55da0d7a64a2142ed0d4f6d8b80f2eefa (patch) | |
| tree | 6e56657110c84e340d3018beaf53dcbe43e51dbf /src/drivers | |
| parent | eedc5bdc0ecb77515a986e8ec064453503cab780 (diff) | |
FLTK implementation of the "GTK Shell" Wayland protocol - cont'd
The pointer_enter() function now checks that its non-FLTK wl_surface argument
is the wl_surface of the titlebar of a GTK-decorated window.
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index cd98d23a0..26f85ede0 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -47,6 +47,7 @@ #include <string.h> // for strerror() extern "C" { bool libdecor_get_cursor_settings(char **theme, int *size); + struct wl_surface *fl_headerbar_surface(struct libdecor_frame *frame); } @@ -201,7 +202,18 @@ static Fl_Window *event_coords_from_surface(struct wl_surface *surface, static void pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) { Fl_Window *win = event_coords_from_surface(surface, surface_x, surface_y); - if (!win && gtk_shell) gtk_shell_surface = surface; + if (!win && gtk_shell) { // check that surface is the headerbar of a GTK-decorated window + Fl_X *x = Fl_X::first; + while (x) { + struct wld_window *xid = (struct wld_window*)x->xid; + if (xid->kind == Fl_Wayland_Window_Driver::DECORATED && + surface == fl_headerbar_surface(xid->frame)) { + gtk_shell_surface = surface; + return; + } + x = x->next; + } + } if (!win) return; // use custom cursor if present struct wl_cursor *cursor = |
