diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-14 07:55:31 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-14 07:55:31 +0100 |
| commit | 673fa2e09c178b6c49fddba53ca3d49ceb9bcd73 (patch) | |
| tree | 2dbcf47aab1d9c02ec2c59c625f1b7e5f88a5fbd /src | |
| parent | 6ac3e8e2303f95fb7dfb844e7c3192c627156205 (diff) | |
FLTK implementation of the "GTK Shell" Wayland protocol - cont'd
The loop over all libdecor-gtk decorations is now made using libdecor's
data structures, rather than using FLTK's mapped window list.
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 26f85ede0..b1590e2de 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -47,7 +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); + bool fl_is_surface_gtk_titlebar(struct wl_surface *, struct libdecor *); } @@ -203,15 +203,9 @@ static void pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t se 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) { // 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; + Fl_Wayland_Screen_Driver *scr_driver = (Fl_Wayland_Screen_Driver*)Fl::screen_driver(); + if (fl_is_surface_gtk_titlebar(surface, scr_driver->libdecor_context)) { + gtk_shell_surface = surface; } } if (!win) return; |
