summaryrefslogtreecommitdiff
path: root/libdecor/src/plugins/gtk/libdecor-gtk.c
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-04-04 12:06:00 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2025-04-04 12:06:00 +0200
commit3cd3537ef8d077de9da2a041ee4268979feeb39d (patch)
tree6526e41cb0d4a3f377361f88e69632339526b3e7 /libdecor/src/plugins/gtk/libdecor-gtk.c
parentfb48bc22cca0adc38689ba7c96666ff772ab91a6 (diff)
Update bundled libdecor to last upstream version (Apr 4, 2025)
Diffstat (limited to 'libdecor/src/plugins/gtk/libdecor-gtk.c')
-rw-r--r--libdecor/src/plugins/gtk/libdecor-gtk.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c
index 5f010958a..3f2a54473 100644
--- a/libdecor/src/plugins/gtk/libdecor-gtk.c
+++ b/libdecor/src/plugins/gtk/libdecor-gtk.c
@@ -342,6 +342,8 @@ struct libdecor_plugin_gtk {
int double_click_time_ms;
int drag_threshold;
+
+ bool handle_cursor;
};
static const char *libdecor_gtk_proxy_tag = "libdecor-gtk";
@@ -555,6 +557,16 @@ libdecor_plugin_gtk_dispatch(struct libdecor_plugin *plugin,
}
}
+static void
+libdecor_plugin_gtk_set_handle_application_cursor(struct libdecor_plugin *plugin,
+ bool handle_cursor)
+{
+ struct libdecor_plugin_gtk *plugin_gtk =
+ (struct libdecor_plugin_gtk *) plugin;
+
+ plugin_gtk->handle_cursor = handle_cursor;
+}
+
static struct libdecor_frame *
libdecor_plugin_gtk_frame_new(struct libdecor_plugin *plugin)
{
@@ -1644,7 +1656,7 @@ synthesize_pointer_enter(struct seat *seat)
struct libdecor_frame_gtk *frame_gtk;
surface = seat->pointer_focus;
- if (!surface)
+ if (!surface || !own_surface(surface))
return;
frame_gtk = wl_surface_get_user_data(surface);
@@ -1671,7 +1683,7 @@ synthesize_pointer_leave(struct seat *seat)
struct libdecor_frame_gtk *frame_gtk;
surface = seat->pointer_focus;
- if (!surface)
+ if (!surface || !own_surface(surface))
return;
frame_gtk = wl_surface_get_user_data(surface);
@@ -1788,6 +1800,8 @@ static struct libdecor_plugin_interface gtk_plugin_iface = {
.get_fd = libdecor_plugin_gtk_get_fd,
.dispatch = libdecor_plugin_gtk_dispatch,
+ .set_handle_application_cursor = libdecor_plugin_gtk_set_handle_application_cursor,
+
.frame_new = libdecor_plugin_gtk_frame_new,
.frame_free = libdecor_plugin_gtk_frame_free,
.frame_commit = libdecor_plugin_gtk_frame_commit,
@@ -2089,12 +2103,17 @@ pointer_enter(void *data,
return;
struct seat *seat = data;
- struct libdecor_frame_gtk *frame_gtk;
+ struct libdecor_frame_gtk *frame_gtk = NULL;
- if (!own_surface(surface))
- return;
+ if (!own_surface(surface)) {
+ struct seat *seat = wl_pointer_get_user_data(wl_pointer);
+ struct libdecor_plugin_gtk *plugin_gtk = seat->plugin_gtk;
- frame_gtk = wl_surface_get_user_data(surface);
+ if (!plugin_gtk->handle_cursor)
+ return;
+ } else {
+ frame_gtk = wl_surface_get_user_data(surface);
+ }
ensure_cursor_surface(seat);
@@ -2124,18 +2143,19 @@ pointer_leave(void *data,
uint32_t serial,
struct wl_surface *surface)
{
- if (!surface)
- return;
-
struct seat *seat = data;
struct libdecor_frame_gtk *frame_gtk;
+ seat->pointer_focus = NULL;
+
+ if (!surface)
+ return;
+
if (!own_surface(surface))
return;
frame_gtk = wl_surface_get_user_data(surface);
- seat->pointer_focus = NULL;
if (frame_gtk) {
frame_gtk->titlebar_gesture.state =
TITLEBAR_GESTURE_STATE_INIT;