From 266bf1d3c0c5ff2131e3c52b8994083eccb27da4 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:08:11 +0100 Subject: Update libdecor to commit 7807ae34 dated 15-Jan-2024 --- libdecor/src/plugins/cairo/libdecor-cairo.c | 8 ++++---- libdecor/src/plugins/gtk/libdecor-gtk.c | 29 +++++++++++------------------ 2 files changed, 15 insertions(+), 22 deletions(-) (limited to 'libdecor/src/plugins') diff --git a/libdecor/src/plugins/cairo/libdecor-cairo.c b/libdecor/src/plugins/cairo/libdecor-cairo.c index f8beb7aa1..765800df6 100644 --- a/libdecor/src/plugins/cairo/libdecor-cairo.c +++ b/libdecor/src/plugins/cairo/libdecor-cairo.c @@ -2074,10 +2074,10 @@ component_edge(const struct border_component *cmpnt, const int pointer_y, const int margin) { - const bool top = pointer_y < margin; - const bool bottom = pointer_y > (cmpnt->server.buffer->height - margin); - const bool left = pointer_x < margin; - const bool right = pointer_x > (cmpnt->server.buffer->width - margin); + const bool top = pointer_y < margin * 2; + const bool bottom = pointer_y > (cmpnt->server.buffer->height - margin * 2); + const bool left = pointer_x < margin * 2; + const bool right = pointer_x > (cmpnt->server.buffer->width - margin * 2); if (top) if (left) diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c index 9a9bc5e26..ef638f1a9 100644 --- a/libdecor/src/plugins/gtk/libdecor-gtk.c +++ b/libdecor/src/plugins/gtk/libdecor-gtk.c @@ -421,6 +421,7 @@ libdecor_plugin_gtk_destroy(struct libdecor_plugin *plugin) free(cursor_output); } + free(seat->name); free(seat); } @@ -449,7 +450,7 @@ libdecor_plugin_gtk_destroy(struct libdecor_plugin *plugin) if (plugin_gtk->wl_subcompositor) wl_subcompositor_destroy(plugin_gtk->wl_subcompositor); - + libdecor_plugin_release(&plugin_gtk->plugin); free(plugin_gtk); } @@ -673,24 +674,16 @@ libdecor_plugin_gtk_frame_free(struct libdecor_plugin *plugin, struct libdecor_frame_gtk *frame_gtk = (struct libdecor_frame_gtk *) frame; - /* when in SSD mode, frame_gtk->header is not a proper GTK widget */ - if (!GTK_IS_WIDGET(frame_gtk->header)) return; - gtk_widget_destroy(frame_gtk->header); - frame_gtk->header = NULL; - if (!GTK_IS_WIDGET(frame_gtk->window)) return; - gtk_widget_destroy(frame_gtk->window); - frame_gtk->window = NULL; + g_clear_pointer (&frame_gtk->header, gtk_widget_destroy); + g_clear_pointer (&frame_gtk->window, gtk_widget_destroy); free_border_component(&frame_gtk->headerbar); free_border_component(&frame_gtk->shadow); frame_gtk->shadow_showing = false; - if (frame_gtk->shadow_blur != NULL) { - cairo_surface_destroy(frame_gtk->shadow_blur); - frame_gtk->shadow_blur = NULL; - } - free(frame_gtk->title); - frame_gtk->title = NULL; + g_clear_pointer (&frame_gtk->shadow_blur, cairo_surface_destroy); + + g_clear_pointer (&frame_gtk->title, free); frame_gtk->decoration_type = DECORATION_TYPE_NONE; @@ -1966,10 +1959,10 @@ component_edge(const struct border_component *cmpnt, const int pointer_y, const int margin) { - const bool top = pointer_y < margin; - const bool bottom = pointer_y > (cmpnt->buffer->height - margin); - const bool left = pointer_x < margin; - const bool right = pointer_x > (cmpnt->buffer->width - margin); + const bool top = pointer_y < margin * 2; + const bool bottom = pointer_y > (cmpnt->buffer->height - margin * 2); + const bool left = pointer_x < margin * 2; + const bool right = pointer_x > (cmpnt->buffer->width - margin * 2); if (top) { if (left) -- cgit v1.2.3