Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libdecor for openSUSE:Factory checked in at 2024-07-24 15:32:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libdecor (Old) and /work/SRC/openSUSE:Factory/.libdecor.new.1869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libdecor" Wed Jul 24 15:32:55 2024 rev:6 rq:1188991 version:0.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libdecor/libdecor.changes 2024-02-21 17:54:20.522799340 +0100 +++ /work/SRC/openSUSE:Factory/.libdecor.new.1869/libdecor.changes 2024-07-25 11:55:19.976985797 +0200 @@ -1,0 +2,22 @@ +Thu Jul 18 14:16:13 UTC 2024 - Sean Baggaley <me@drinkybird.net> + +- Update to version 0.2.2: + * gtk: fix memory leak when destroying the gtk plugin + * gtk: fix memory leak when freeing seats + * gtk: Make resize corner region larger + * cairo: Make resize corner region larger + * cursor-settings: Get theme/size from env if D-Bus call fails + * gtk: Use g_clear_pointer() in a couple of places + * gtk: Don't early out of frame free function + + Includes changes from 0.2.1: + * gtk: Don't report errors during construction + * Handle NULL wl_output as argument + * gtk: Optionally use wl_output_release + * cairo: Optionally use wl_output_release + * libdecor: fix leak of DBusError in get_setting_sync + * gtk: use error notification with string formatting + * gtk: disable setlocale() + * build: Use `gnu_symbol_visibility` everywhere + +------------------------------------------------------------------- Old: ---- libdecor-0.2.0.tar.xz New: ---- libdecor-0.2.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libdecor.spec ++++++ --- /var/tmp/diff_new_pack.oo7ASr/_old 2024-07-25 11:55:20.501006944 +0200 +++ /var/tmp/diff_new_pack.oo7ASr/_new 2024-07-25 11:55:20.505007106 +0200 @@ -17,7 +17,7 @@ Name: libdecor -Version: 0.2.0 +Version: 0.2.2 Release: 0 Summary: Wayland client side decoration library License: MIT ++++++ libdecor-0.2.0.tar.xz -> libdecor-0.2.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/demo/demo.c new/libdecor-0.2.2/demo/demo.c --- old/libdecor-0.2.0/demo/demo.c 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/demo/demo.c 2024-01-15 22:00:42.000000000 +0100 @@ -81,6 +81,9 @@ static bool own_output(struct wl_output *output) { + if (!output) + return false; + return own_proxy((struct wl_proxy *) output); } @@ -1210,6 +1213,9 @@ struct window *window = data; struct window_output *window_output; + if (!own_output(wl_output)) + return; + wl_list_for_each(window_output, &window->outputs, link) { if (window_output->output->wl_output == wl_output) { wl_list_remove(&window_output->link); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/meson.build new/libdecor-0.2.2/meson.build --- old/libdecor-0.2.0/meson.build 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/meson.build 2024-01-15 22:00:42.000000000 +0100 @@ -1,6 +1,6 @@ project('libdecor', 'c', - version: '0.2.0', - meson_version: '>= 0.47.0', + version: '0.2.2', + meson_version: '>= 0.49.0', license: 'MIT', default_options: [ 'c_std=c99', @@ -67,10 +67,6 @@ plugindir = join_paths(pkglibdir, 'plugins-@0@'.format(plugin_api_version_string)) -libdecor_c_args = [ - '-fvisibility=hidden', -] - cdata = configuration_data() cdata.set_quoted('VERSION', meson.project_version()) cdata.set_quoted('LIBDECOR_PLUGIN_DIR', plugindir) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/src/cursor-settings.c new/libdecor-0.2.2/src/cursor-settings.c --- old/libdecor-0.2.0/src/cursor-settings.c 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/src/cursor-settings.c 2024-01-15 22:00:42.000000000 +0100 @@ -29,6 +29,23 @@ #include <stdbool.h> #include "config.h" +static bool +get_cursor_settings_from_env(char **theme, int *size) +{ + char *env_xtheme; + char *env_xsize; + + env_xtheme = getenv("XCURSOR_THEME"); + if (env_xtheme != NULL) + *theme = strdup(env_xtheme); + + env_xsize = getenv("XCURSOR_SIZE"); + if (env_xsize != NULL) + *size = atoi(env_xsize); + + return env_xtheme != NULL && env_xsize != NULL; +} + #ifdef HAS_DBUS #include <dbus/dbus.h> @@ -42,8 +59,6 @@ DBusMessage *message; DBusMessage *reply; - dbus_error_init(&error); - message = dbus_message_new_method_call( "org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", @@ -58,6 +73,8 @@ if (!success) return NULL; + dbus_error_init(&error); + reply = dbus_connection_send_with_reply_and_block( connection, message, @@ -66,9 +83,12 @@ dbus_message_unref(message); - if (dbus_error_is_set(&error)) + if (dbus_error_is_set(&error)) { + dbus_error_free(&error); return NULL; + } + dbus_error_free(&error); return reply; } @@ -113,15 +133,15 @@ connection = dbus_bus_get(DBUS_BUS_SESSION, &error); if (dbus_error_is_set(&error)) - return false; + goto fallback; reply = get_setting_sync(connection, name, key_theme); if (!reply) - return false; + goto fallback; if (!parse_type(reply, DBUS_TYPE_STRING, &value_theme)) { dbus_message_unref(reply); - return false; + goto fallback; } *theme = strdup(value_theme); @@ -130,32 +150,24 @@ reply = get_setting_sync(connection, name, key_size); if (!reply) - return false; + goto fallback; if (!parse_type(reply, DBUS_TYPE_INT32, size)) { dbus_message_unref(reply); - return false; + goto fallback; } dbus_message_unref(reply); return true; + +fallback: + return get_cursor_settings_from_env(theme, size); } #else bool libdecor_get_cursor_settings(char **theme, int *size) { - char *env_xtheme; - char *env_xsize; - - env_xtheme = getenv("XCURSOR_THEME"); - if (env_xtheme != NULL) - *theme = strdup(env_xtheme); - - env_xsize = getenv("XCURSOR_SIZE"); - if (env_xsize != NULL) - *size = atoi(env_xsize); - - return env_xtheme != NULL && env_xsize != NULL; + return get_cursor_settings_from_env(theme, size); } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/src/meson.build new/libdecor-0.2.2/src/meson.build --- old/libdecor-0.2.0/src/meson.build 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/src/meson.build 2024-01-15 22:00:42.000000000 +0100 @@ -72,6 +72,7 @@ sources: ['cursor-settings.c'], include_directories: [top_includepath], dependencies: [dbus_dep], + gnu_symbol_visibility: 'hidden', ) cursor_settings_dep = declare_dependency( @@ -83,6 +84,7 @@ os_compatibility = static_library('os_compatibility', sources: ['os-compatibility.c'], include_directories: [top_includepath], + gnu_symbol_visibility: 'hidden', ) os_compatibility_dep = declare_dependency( @@ -98,7 +100,7 @@ soversion: libdecor_soversion, version: libdecor_libversion, include_directories: libdecor_includes, - c_args: libdecor_c_args, + gnu_symbol_visibility: 'hidden', dependencies: [ wayland_client_dep, dl_dep, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/src/plugins/cairo/libdecor-cairo.c new/libdecor-0.2.2/src/plugins/cairo/libdecor-cairo.c --- old/libdecor-0.2.0/src/plugins/cairo/libdecor-cairo.c 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/src/plugins/cairo/libdecor-cairo.c 2024-01-15 22:00:42.000000000 +0100 @@ -296,6 +296,9 @@ static bool own_proxy(struct wl_proxy *proxy) { + if (!proxy) + return false; + return (wl_proxy_get_tag(proxy) == &libdecor_cairo_proxy_tag); } @@ -387,7 +390,11 @@ wl_list_for_each_safe(output, output_tmp, &plugin_cairo->output_list, link) { - wl_output_destroy(output->wl_output); + if (wl_output_get_version (output->wl_output) >= + WL_OUTPUT_RELEASE_SINCE_VERSION) + wl_output_release(output->wl_output); + else + wl_output_destroy(output->wl_output); free(output); } @@ -2067,10 +2074,10 @@ 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) @@ -2570,7 +2577,8 @@ output->id = id; output->wl_output = wl_registry_bind(plugin_cairo->wl_registry, - id, &wl_output_interface, 2); + id, &wl_output_interface, + MIN (version, 3)); wl_proxy_set_tag((struct wl_proxy *) output->wl_output, &libdecor_cairo_proxy_tag); wl_output_add_listener(output->wl_output, &output_listener, output); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/src/plugins/cairo/meson.build new/libdecor-0.2.2/src/plugins/cairo/meson.build --- old/libdecor-0.2.0/src/plugins/cairo/meson.build 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/src/plugins/cairo/meson.build 2024-01-15 22:00:42.000000000 +0100 @@ -10,7 +10,7 @@ libdecor_includepath, plugin_include_path, ], - c_args: libdecor_c_args, + gnu_symbol_visibility: 'hidden', dependencies: [ libdecor_dep, pangocairo_dep, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/src/plugins/common/meson.build new/libdecor-0.2.2/src/plugins/common/meson.build --- old/libdecor-0.2.0/src/plugins/common/meson.build 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/src/plugins/common/meson.build 2024-01-15 22:00:42.000000000 +0100 @@ -9,5 +9,6 @@ cairo_dep, math_dep, ], + gnu_symbol_visibility: 'hidden', install: false, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/src/plugins/dummy/meson.build new/libdecor-0.2.2/src/plugins/dummy/meson.build --- old/libdecor-0.2.0/src/plugins/dummy/meson.build 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/src/plugins/dummy/meson.build 2024-01-15 22:00:42.000000000 +0100 @@ -6,7 +6,7 @@ top_includepath, libdecor_includepath, ], - c_args: libdecor_c_args, + gnu_symbol_visibility: 'hidden', dependencies: [ libdecor_dep, ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/src/plugins/gtk/libdecor-gtk.c new/libdecor-0.2.2/src/plugins/gtk/libdecor-gtk.c --- old/libdecor-0.2.0/src/plugins/gtk/libdecor-gtk.c 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/src/plugins/gtk/libdecor-gtk.c 2024-01-15 22:00:42.000000000 +0100 @@ -330,6 +330,9 @@ static bool own_proxy(struct wl_proxy *proxy) { + if (!proxy) + return false; + return (wl_proxy_get_tag(proxy) == &libdecor_gtk_proxy_tag); } @@ -418,12 +421,17 @@ free(cursor_output); } + free(seat->name); free(seat); } wl_list_for_each_safe(output, output_tmp, &plugin_gtk->output_list, link) { - wl_output_destroy(output->wl_output); + if (wl_output_get_version (output->wl_output) >= + WL_OUTPUT_RELEASE_SINCE_VERSION) + wl_output_release(output->wl_output); + else + wl_output_destroy(output->wl_output); free(output); } @@ -442,7 +450,7 @@ if (plugin_gtk->wl_subcompositor) wl_subcompositor_destroy(plugin_gtk->wl_subcompositor); - + libdecor_plugin_release(&plugin_gtk->plugin); free(plugin_gtk); } @@ -666,24 +674,16 @@ 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; @@ -1959,10 +1959,10 @@ 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) @@ -2548,15 +2548,12 @@ struct seat *seat; if (version < 3) { - char *err_msg; - asprintf(&err_msg, - "%s version 3 required but only version %i is available\n", - wl_seat_interface.name, version); libdecor_notify_plugin_error( plugin_gtk->context, LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE, - err_msg); - free(err_msg); + "%s version 3 required but only version %i is available\n", + wl_seat_interface.name, + version); } seat = zalloc(sizeof *seat); @@ -2640,15 +2637,12 @@ struct output *output; if (version < 2) { - char *err_msg; - asprintf(&err_msg, - "%s version 2 required but only version %i is available\n", - wl_output_interface.name, version); libdecor_notify_plugin_error( plugin_gtk->context, LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE, - err_msg); - free(err_msg); + "%s version 2 required but only version %i is available\n", + wl_output_interface.name, + version); } output = zalloc(sizeof *output); @@ -2657,7 +2651,8 @@ output->id = id; output->wl_output = wl_registry_bind(plugin_gtk->wl_registry, - id, &wl_output_interface, 2); + id, &wl_output_interface, + MIN (version, 3)); wl_proxy_set_tag((struct wl_proxy *) output->wl_output, &libdecor_gtk_proxy_tag); wl_output_add_listener(output->wl_output, &output_listener, output); @@ -2814,11 +2809,11 @@ /* setup GTK context */ gdk_set_allowed_backends("wayland"); + gtk_disable_setlocale(); + if (!gtk_init_check(NULL, NULL)) { - libdecor_notify_plugin_error( - plugin_gtk->context, - LIBDECOR_ERROR_COMPOSITOR_INCOMPATIBLE, - "GTK cannot connect to Wayland compositor"); + fprintf(stderr, "libdecor-gtk-WARNING: Failed to initialize GTK\n"); + libdecor_plugin_gtk_destroy(&plugin_gtk->plugin); return NULL; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdecor-0.2.0/src/plugins/gtk/meson.build new/libdecor-0.2.2/src/plugins/gtk/meson.build --- old/libdecor-0.2.0/src/plugins/gtk/meson.build 2023-09-25 08:49:43.000000000 +0200 +++ new/libdecor-0.2.2/src/plugins/gtk/meson.build 2024-01-15 22:00:42.000000000 +0100 @@ -9,7 +9,7 @@ libdecor_includepath, plugin_include_path, ], - c_args: libdecor_c_args, + gnu_symbol_visibility: 'hidden', dependencies: [ libdecor_dep, cairo_dep,
participants (1)
-
Source-Sync