summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/Wayland')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx14
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;