Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libdecor for openSUSE:Factory 
checked in at 2026-01-07 16:00:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libdecor (Old)
 and      /work/SRC/openSUSE:Factory/.libdecor.new.1928 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libdecor"

Wed Jan  7 16:00:47 2026 rev:7 rq:1325625 version:0.2.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/libdecor/libdecor.changes        2024-07-25 
11:55:19.976985797 +0200
+++ /work/SRC/openSUSE:Factory/.libdecor.new.1928/libdecor.changes      
2026-01-07 16:01:05.018290464 +0100
@@ -1,0 +2,9 @@
+Sun Dec 28 22:57:12 UTC 2025 - Dirk Müller <[email protected]>
+
+- update to 0.2.5:
+  * libdecor: Fix set_visibility for SSD compositors
+  * Don't commit frame when with no content set
+  * Always apply limits no matter the window state
+  * Only query border size when decorated
+
+-------------------------------------------------------------------

Old:
----
  libdecor-0.2.2.tar.xz

New:
----
  libdecor-0.2.5.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libdecor.spec ++++++
--- /var/tmp/diff_new_pack.cTqce0/_old  2026-01-07 16:01:05.542312274 +0100
+++ /var/tmp/diff_new_pack.cTqce0/_new  2026-01-07 16:01:05.542312274 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libdecor
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           libdecor
-Version:        0.2.2
+Version:        0.2.5
 Release:        0
 Summary:        Wayland client side decoration library
 License:        MIT

++++++ libdecor-0.2.2.tar.xz -> libdecor-0.2.5.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/config.h.meson 
new/libdecor-0.2.5/config.h.meson
--- old/libdecor-0.2.2/config.h.meson   2024-01-15 22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/config.h.meson   2025-12-16 10:21:49.000000000 +0100
@@ -12,5 +12,6 @@
 #mesondefine HAVE_MKOSTEMP
 #mesondefine HAVE_POSIX_FALLOCATE
 #mesondefine HAVE_MEMFD_CREATE
+#mesondefine HAVE_GETTID
 
 #mesondefine HAVE_XDG_SHELL_V6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/demo/c++-demo.cc 
new/libdecor-0.2.5/demo/c++-demo.cc
--- old/libdecor-0.2.2/demo/c++-demo.cc 2024-01-15 22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/demo/c++-demo.cc 2025-12-16 10:21:49.000000000 +0100
@@ -41,7 +41,7 @@
 
 #include "libdecor.h"
 #include "utils.h"
-#include "cursor-settings.h"
+#include "desktop-settings.h"
 extern "C" {
 #include "os-compatibility.h"
 }
@@ -94,7 +94,7 @@
                stride = width * 4;
                size = stride * height;
 
-               fd = os_create_anonymous_file(size);
+               fd = libdecor_os_create_anonymous_file(size);
                if (fd < 0) {
                        cerr << "Creating a buffer file for " << size <<
                                " B failed: " << strerror(errno) << endl;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/demo/demo.c 
new/libdecor-0.2.5/demo/demo.c
--- old/libdecor-0.2.2/demo/demo.c      2024-01-15 22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/demo/demo.c      2025-12-16 10:21:49.000000000 +0100
@@ -41,7 +41,7 @@
 
 #include "libdecor.h"
 #include "utils.h"
-#include "cursor-settings.h"
+#include "desktop-settings.h"
 #include "os-compatibility.h"
 
 #include "xdg-shell-client-protocol.h"
@@ -1026,7 +1026,7 @@
        stride = width * 4;
        size = stride * height;
 
-       fd = os_create_anonymous_file(size);
+       fd = libdecor_os_create_anonymous_file(size);
        if (fd < 0) {
                fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
                        size, strerror(errno));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/demo/meson.build 
new/libdecor-0.2.5/demo/meson.build
--- old/libdecor-0.2.2/demo/meson.build 2024-01-15 22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/demo/meson.build 2025-12-16 10:21:49.000000000 +0100
@@ -1,4 +1,4 @@
-add_languages('cpp')
+add_languages('cpp', native: false)
 
 wayland_cursor_dep = dependency('wayland-cursor')
 
@@ -44,7 +44,7 @@
   dependencies: [
     libdecor_dep,
     wayland_cursor_dep,
-    cursor_settings_dep,
+    desktop_settings_dep,
     os_compatibility_dep,
     xkb_dep],
   install: get_option('install_demo'),
@@ -75,7 +75,7 @@
   dependencies: [
     libdecor_dep,
     wayland_cursor_dep,
-    cursor_settings_dep,
+    desktop_settings_dep,
     os_compatibility_dep,
     xkb_dep],
   install: get_option('install_demo'),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/meson.build 
new/libdecor-0.2.5/meson.build
--- old/libdecor-0.2.2/meson.build      2024-01-15 22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/meson.build      2025-12-16 10:21:49.000000000 +0100
@@ -1,5 +1,5 @@
 project('libdecor', 'c',
-  version: '0.2.2',
+  version: '0.2.5',
   meson_version: '>= 0.49.0',
   license: 'MIT',
   default_options: [
@@ -84,6 +84,9 @@
 if cc.has_function('memfd_create', prefix: '#define _GNU_SOURCE\n#include 
<sys/mman.h>')
   cdata.set('HAVE_MEMFD_CREATE', true)
 endif
+if cc.has_function('gettid', prefix: '#define _GNU_SOURCE\n#include 
<unistd.h>')
+  cdata.set('HAVE_GETTID', true)
+endif
 
 if wayland_protocols_dep.version().version_compare('>=1.32')
   cdata.set('HAVE_XDG_SHELL_V6', true)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/cursor-settings.c 
new/libdecor-0.2.5/src/cursor-settings.c
--- old/libdecor-0.2.2/src/cursor-settings.c    2024-01-15 22:00:42.000000000 
+0100
+++ new/libdecor-0.2.5/src/cursor-settings.c    1970-01-01 01:00:00.000000000 
+0100
@@ -1,173 +0,0 @@
-/*
- * Copyright © 2019 Christian Rauch
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include "cursor-settings.h"
-#include <stdlib.h>
-#include <string.h>
-#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>
-
-static DBusMessage *
-get_setting_sync(DBusConnection *const connection,
-                const char *key,
-                const char *value)
-{
-       DBusError error;
-       dbus_bool_t success;
-       DBusMessage *message;
-       DBusMessage *reply;
-
-       message = dbus_message_new_method_call(
-               "org.freedesktop.portal.Desktop",
-               "/org/freedesktop/portal/desktop",
-               "org.freedesktop.portal.Settings",
-               "Read");
-
-       success = dbus_message_append_args(message,
-               DBUS_TYPE_STRING, &key,
-               DBUS_TYPE_STRING, &value,
-               DBUS_TYPE_INVALID);
-
-       if (!success)
-               return NULL;
-
-       dbus_error_init(&error);
-
-       reply = dbus_connection_send_with_reply_and_block(
-                            connection,
-                            message,
-                            DBUS_TIMEOUT_USE_DEFAULT,
-                            &error);
-
-       dbus_message_unref(message);
-
-       if (dbus_error_is_set(&error)) {
-               dbus_error_free(&error);
-               return NULL;
-       }
-
-       dbus_error_free(&error);
-       return reply;
-}
-
-static bool
-parse_type(DBusMessage *const reply,
-          const int type,
-          void *value)
-{
-       DBusMessageIter iter[3];
-
-       dbus_message_iter_init(reply, &iter[0]);
-       if (dbus_message_iter_get_arg_type(&iter[0]) != DBUS_TYPE_VARIANT)
-               return false;
-
-       dbus_message_iter_recurse(&iter[0], &iter[1]);
-       if (dbus_message_iter_get_arg_type(&iter[1]) != DBUS_TYPE_VARIANT)
-               return false;
-
-       dbus_message_iter_recurse(&iter[1], &iter[2]);
-       if (dbus_message_iter_get_arg_type(&iter[2]) != type)
-               return false;
-
-       dbus_message_iter_get_basic(&iter[2], value);
-
-       return true;
-}
-
-bool
-libdecor_get_cursor_settings(char **theme, int *size)
-{
-       static const char name[] = "org.gnome.desktop.interface";
-       static const char key_theme[] = "cursor-theme";
-       static const char key_size[] = "cursor-size";
-
-       DBusError error;
-       DBusConnection *connection;
-       DBusMessage *reply;
-       const char *value_theme = NULL;
-
-       dbus_error_init(&error);
-
-       connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
-
-       if (dbus_error_is_set(&error))
-               goto fallback;
-
-       reply = get_setting_sync(connection, name, key_theme);
-       if (!reply)
-               goto fallback;
-
-       if (!parse_type(reply, DBUS_TYPE_STRING, &value_theme)) {
-               dbus_message_unref(reply);
-               goto fallback;
-       }
-
-       *theme = strdup(value_theme);
-
-       dbus_message_unref(reply);
-
-       reply = get_setting_sync(connection, name, key_size);
-       if (!reply)
-               goto fallback;
-
-       if (!parse_type(reply, DBUS_TYPE_INT32, size)) {
-               dbus_message_unref(reply);
-               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)
-{
-       return get_cursor_settings_from_env(theme, size);
-}
-#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/cursor-settings.h 
new/libdecor-0.2.5/src/cursor-settings.h
--- old/libdecor-0.2.2/src/cursor-settings.h    2024-01-15 22:00:42.000000000 
+0100
+++ new/libdecor-0.2.5/src/cursor-settings.h    1970-01-01 01:00:00.000000000 
+0100
@@ -1,31 +0,0 @@
-/*
- * Copyright © 2019 Christian Rauch
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#pragma once
-
-#include <stdbool.h>
-
-bool
-libdecor_get_cursor_settings(char **theme, int *size);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/desktop-settings.c 
new/libdecor-0.2.5/src/desktop-settings.c
--- old/libdecor-0.2.2/src/desktop-settings.c   1970-01-01 01:00:00.000000000 
+0100
+++ new/libdecor-0.2.5/src/desktop-settings.c   2025-12-16 10:21:49.000000000 
+0100
@@ -0,0 +1,213 @@
+/*
+ * Copyright © 2019 Christian Rauch
+ * Copyright © 2024 Colin Kinloch
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "desktop-settings.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+#include <stdint.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>
+
+static DBusMessage *
+get_setting_sync(DBusConnection *const connection,
+                const char *key,
+                const char *value)
+{
+       DBusError error;
+       dbus_bool_t success;
+       DBusMessage *message;
+       DBusMessage *reply;
+
+       message = dbus_message_new_method_call(
+               "org.freedesktop.portal.Desktop",
+               "/org/freedesktop/portal/desktop",
+               "org.freedesktop.portal.Settings",
+               "Read");
+
+       success = dbus_message_append_args(message,
+               DBUS_TYPE_STRING, &key,
+               DBUS_TYPE_STRING, &value,
+               DBUS_TYPE_INVALID);
+
+       if (!success)
+               return NULL;
+
+       dbus_error_init(&error);
+
+       reply = dbus_connection_send_with_reply_and_block(
+                            connection,
+                            message,
+                            DBUS_TIMEOUT_USE_DEFAULT,
+                            &error);
+
+       dbus_message_unref(message);
+
+       if (dbus_error_is_set(&error)) {
+               dbus_error_free(&error);
+               return NULL;
+       }
+
+       dbus_error_free(&error);
+       return reply;
+}
+
+static bool
+parse_type(DBusMessage *const reply,
+          const int type,
+          void *value)
+{
+       DBusMessageIter iter[3];
+
+       dbus_message_iter_init(reply, &iter[0]);
+       if (dbus_message_iter_get_arg_type(&iter[0]) != DBUS_TYPE_VARIANT)
+               return false;
+
+       dbus_message_iter_recurse(&iter[0], &iter[1]);
+       if (dbus_message_iter_get_arg_type(&iter[1]) != DBUS_TYPE_VARIANT)
+               return false;
+
+       dbus_message_iter_recurse(&iter[1], &iter[2]);
+       if (dbus_message_iter_get_arg_type(&iter[2]) != type)
+               return false;
+
+       dbus_message_iter_get_basic(&iter[2], value);
+
+       return true;
+}
+
+bool
+libdecor_get_cursor_settings(char **theme, int *size)
+{
+       static const char name[] = "org.gnome.desktop.interface";
+       static const char key_theme[] = "cursor-theme";
+       static const char key_size[] = "cursor-size";
+
+       DBusError error;
+       DBusConnection *connection;
+       DBusMessage *reply;
+       const char *value_theme = NULL;
+
+       dbus_error_init(&error);
+
+       connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
+
+       if (dbus_error_is_set(&error))
+               goto fallback;
+
+       reply = get_setting_sync(connection, name, key_theme);
+       if (!reply)
+               goto fallback;
+
+       if (!parse_type(reply, DBUS_TYPE_STRING, &value_theme)) {
+               dbus_message_unref(reply);
+               goto fallback;
+       }
+
+       *theme = strdup(value_theme);
+
+       dbus_message_unref(reply);
+
+       reply = get_setting_sync(connection, name, key_size);
+       if (!reply)
+               goto fallback;
+
+       if (!parse_type(reply, DBUS_TYPE_INT32, size)) {
+               dbus_message_unref(reply);
+               goto fallback;
+       }
+
+       dbus_message_unref(reply);
+
+       return true;
+
+fallback:
+       return get_cursor_settings_from_env(theme, size);
+}
+
+enum libdecor_color_scheme
+libdecor_get_color_scheme()
+{
+       static const char name[] = "org.freedesktop.appearance";
+       static const char key_color_scheme[] = "color-scheme";
+       uint32_t color = 0;
+
+       DBusError error;
+       DBusConnection *connection;
+       DBusMessage *reply;
+
+       dbus_error_init(&error);
+
+       connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
+
+       if (dbus_error_is_set(&error))
+               return 0;
+
+       reply = get_setting_sync(connection, name, key_color_scheme);
+       if (!reply)
+               return 0;
+
+       if (!parse_type(reply, DBUS_TYPE_UINT32, &color)) {
+               dbus_message_unref(reply);
+               return 0;
+       }
+
+       dbus_message_unref(reply);
+
+       return color;
+}
+#else
+bool
+libdecor_get_cursor_settings(char **theme, int *size)
+{
+       return get_cursor_settings_from_env(theme, size);
+}
+
+uint32_t
+libdecor_get_color_scheme()
+{
+       return LIBDECOR_COLOR_SCHEME_DEFAULT;
+}
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/desktop-settings.h 
new/libdecor-0.2.5/src/desktop-settings.h
--- old/libdecor-0.2.2/src/desktop-settings.h   1970-01-01 01:00:00.000000000 
+0100
+++ new/libdecor-0.2.5/src/desktop-settings.h   2025-12-16 10:21:49.000000000 
+0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright © 2019 Christian Rauch
+ * Copyright © 2024 Colin Kinloch
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#pragma once
+
+#include <stdbool.h>
+
+enum libdecor_color_scheme {
+       LIBDECOR_COLOR_SCHEME_DEFAULT,
+       LIBDECOR_COLOR_SCHEME_PREFER_DARK,
+       LIBDECOR_COLOR_SCHEME_PREFER_LIGHT,
+};
+
+bool
+libdecor_get_cursor_settings(char **theme, int *size);
+
+enum libdecor_color_scheme
+libdecor_get_color_scheme();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/libdecor.c 
new/libdecor-0.2.5/src/libdecor.c
--- old/libdecor-0.2.2/src/libdecor.c   2024-01-15 22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/src/libdecor.c   2025-12-16 10:21:49.000000000 +0100
@@ -123,6 +123,7 @@
 
        enum libdecor_window_state window_state;
 
+       bool has_decoration_mode;
        enum zxdg_toplevel_decoration_v1_mode decoration_mode;
 
        enum libdecor_capabilities capabilities;
@@ -276,12 +277,22 @@
        int x, y, width, height;
        int left, right, top, bottom;
 
-       plugin->priv->iface->frame_get_border_size(plugin, frame, NULL,
-                                                  &left, &right, &top, 
&bottom);
-       x = -left;
-       y = -top;
-       width = content_width + left + right;
-       height = content_height + top + bottom;
+       if (frame_has_visible_client_side_decoration(frame) &&
+           plugin->priv->iface->frame_get_border_size(plugin, frame,
+                                                      NULL,
+                                                      &left, &right,
+                                                      &top, &bottom)) {
+               x = -left;
+               y = -top;
+               width = content_width + left + right;
+               height = content_height + top + bottom;
+       } else {
+               x = 0;
+               y = 0;
+               width = content_width;
+               height = content_height;
+       }
+
        xdg_surface_set_window_geometry(frame->priv->xdg_surface, x, y, width, 
height);
 }
 
@@ -474,7 +485,13 @@
                struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,
                uint32_t mode)
 {
-       ((struct libdecor_frame_private *)(data))->decoration_mode = mode;
+       struct libdecor_frame_private *frame_priv = (struct 
libdecor_frame_private *)data;
+       /* Ignore any _configure calls after the first, they will be
+        * from our set_mode call. */
+       if (!frame_priv->has_decoration_mode) {
+               frame_priv->has_decoration_mode = true;
+               frame_priv->decoration_mode = mode;
+       }
 }
 
 static const struct zxdg_toplevel_decoration_v1_listener
@@ -606,9 +623,9 @@
                struct libdecor_plugin *plugin = context->plugin;
 
                if (context->decoration_manager && 
frame_priv->toplevel_decoration) {
-                       
zxdg_toplevel_decoration_v1_destroy(frame_priv->toplevel_decoration);
-                       frame_priv->toplevel_decoration = NULL;
-               }
+                       
zxdg_toplevel_decoration_v1_destroy(frame_priv->toplevel_decoration);
+                       frame_priv->toplevel_decoration = NULL;
+               }
 
                wl_list_remove(&frame->link);
 
@@ -638,26 +655,27 @@
 
        frame_priv->visible = visible;
 
-       /* enable/disable decorations that are managed by the compositor,
-        * only xdg-decoration version 2 and above allows to toggle decoration 
*/
+       /* enable/disable decorations that are managed by the compositor.
+        * Note that, as of xdg_decoration v1, this is just a hint and there is
+        * no reliable way of disabling all decorations. In practice this should
+        * work but per spec this is not guaranteed.
+        *
+        * See also: 
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/17
+        */
        if (context->decoration_manager &&
-           zxdg_decoration_manager_v1_get_version(context->decoration_manager) 
> 1) {
-               if (frame_priv->visible &&
-                   frame_priv->toplevel_decoration == NULL) {
-                       /* - request to SHOW decorations
-                        * - decorations are NOT HANDLED
-                        * => create new decorations for already mapped surface 
*/
-                       libdecor_frame_create_xdg_decoration(frame_priv);
-               } else if (!frame_priv->visible &&
-                        frame_priv->toplevel_decoration != NULL) {
-                       /* - request to HIDE decorations
-                        * - decorations are HANDLED
-                        * => destroy decorations */
-                       
zxdg_toplevel_decoration_v1_destroy(frame_priv->toplevel_decoration);
-                       frame_priv->toplevel_decoration = NULL;
-               }
+           frame_priv->toplevel_decoration &&
+           frame_priv->has_decoration_mode &&
+           frame_priv->decoration_mode == 
ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE) {
+               
zxdg_toplevel_decoration_v1_set_mode(frame_priv->toplevel_decoration,
+                                                    frame->priv->visible
+                                                    ? 
ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE
+                                                    : 
ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE);
        }
 
+       if (frame_priv->content_width <= 0 ||
+           frame_priv->content_height <= 0)
+               return;
+
        /* enable/disable decorations that are managed by a plugin */
        if (frame_has_visible_client_side_decoration(frame)) {
                /* show client-side decorations */
@@ -689,10 +707,10 @@
        if (!frame_priv->xdg_toplevel)
                return;
 
-       frame_priv->state.parent = parent->priv->xdg_toplevel;
+       frame_priv->state.parent = parent ? parent->priv->xdg_toplevel : NULL;
 
        xdg_toplevel_set_parent(frame_priv->xdg_toplevel,
-                               parent->priv->xdg_toplevel);
+                               frame_priv->state.parent);
 }
 
 LIBDECOR_EXPORT void
@@ -1117,10 +1135,7 @@
        frame_priv->content_width = state->content_width;
        frame_priv->content_height = state->content_height;
 
-       /* do not set limits in non-floating states */
-       if (state_is_floating(state->window_state)) {
-               libdecor_frame_apply_limits(frame, state->window_state);
-       }
+       libdecor_frame_apply_limits(frame, state->window_state);
 }
 
 LIBDECOR_EXPORT void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/meson.build 
new/libdecor-0.2.5/src/meson.build
--- old/libdecor-0.2.2/src/meson.build  2024-01-15 22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/src/meson.build  2025-12-16 10:21:49.000000000 +0100
@@ -67,16 +67,16 @@
   )
 endforeach
 
-## cursor settings
-cursor_settings = static_library('cursor_settings',
-  sources: ['cursor-settings.c'],
+## desktop settings
+desktop_settings = static_library('desktop_settings',
+  sources: ['desktop-settings.c'],
   include_directories: [top_includepath],
   dependencies: [dbus_dep],
   gnu_symbol_visibility: 'hidden',
 )
 
-cursor_settings_dep = declare_dependency(
-  link_with: cursor_settings,
+desktop_settings_dep = declare_dependency(
+  link_with: desktop_settings,
   dependencies: [dbus_dep],
 )
 
@@ -104,7 +104,7 @@
   dependencies: [
     wayland_client_dep,
     dl_dep,
-    cursor_settings_dep,
+    desktop_settings_dep,
   ],
   install: true
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/os-compatibility.c 
new/libdecor-0.2.5/src/os-compatibility.c
--- old/libdecor-0.2.2/src/os-compatibility.c   2024-01-15 22:00:42.000000000 
+0100
+++ new/libdecor-0.2.5/src/os-compatibility.c   2025-12-16 10:21:49.000000000 
+0100
@@ -148,7 +148,7 @@
  * XDG_RUNTIME_DIR.
  */
 int
-os_create_anonymous_file(off_t size)
+libdecor_os_create_anonymous_file(off_t size)
 {
        static const char template[] = "/libdecor-shared-XXXXXX";
        const char *path;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/os-compatibility.h 
new/libdecor-0.2.5/src/os-compatibility.h
--- old/libdecor-0.2.2/src/os-compatibility.h   2024-01-15 22:00:42.000000000 
+0100
+++ new/libdecor-0.2.5/src/os-compatibility.h   2025-12-16 10:21:49.000000000 
+0100
@@ -29,6 +29,6 @@
 #include <sys/types.h>
 
 int
-os_create_anonymous_file(off_t size);
+libdecor_os_create_anonymous_file(off_t size);
 
 #endif /* OS_COMPATIBILITY_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/plugins/cairo/libdecor-cairo.c 
new/libdecor-0.2.5/src/plugins/cairo/libdecor-cairo.c
--- old/libdecor-0.2.2/src/plugins/cairo/libdecor-cairo.c       2024-01-15 
22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/src/plugins/cairo/libdecor-cairo.c       2025-12-16 
10:21:49.000000000 +0100
@@ -39,7 +39,7 @@
 
 #include "libdecor-plugin.h"
 #include "utils.h"
-#include "cursor-settings.h"
+#include "desktop-settings.h"
 #include "os-compatibility.h"
 
 #include <cairo/cairo.h>
@@ -597,7 +597,7 @@
        stride = buffer_width * 4;
        size = stride * buffer_height;
 
-       fd = os_create_anonymous_file(size);
+       fd = libdecor_os_create_anonymous_file(size);
        if (fd < 0) {
                fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
                        size, strerror(errno));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/plugins/cairo/meson.build 
new/libdecor-0.2.5/src/plugins/cairo/meson.build
--- old/libdecor-0.2.2/src/plugins/cairo/meson.build    2024-01-15 
22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/src/plugins/cairo/meson.build    2025-12-16 
10:21:49.000000000 +0100
@@ -15,7 +15,7 @@
     libdecor_dep,
     pangocairo_dep,
     wayland_cursor_dep,
-    cursor_settings_dep,
+    desktop_settings_dep,
     os_compatibility_dep,
   ],
   link_with: plugin_common,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/plugins/gtk/libdecor-gtk.c 
new/libdecor-0.2.5/src/plugins/gtk/libdecor-gtk.c
--- old/libdecor-0.2.2/src/plugins/gtk/libdecor-gtk.c   2024-01-15 
22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/src/plugins/gtk/libdecor-gtk.c   2025-12-16 
10:21:49.000000000 +0100
@@ -38,7 +38,7 @@
 
 #include "libdecor-plugin.h"
 #include "utils.h"
-#include "cursor-settings.h"
+#include "desktop-settings.h"
 #include "os-compatibility.h"
 
 #include <cairo/cairo.h>
@@ -322,6 +322,8 @@
        char *cursor_theme_name;
        int cursor_size;
 
+       uint32_t color_scheme_setting;
+
        int double_click_time_ms;
 };
 
@@ -595,7 +597,7 @@
        stride = buffer_width * 4;
        size = stride * buffer_height;
 
-       fd = os_create_anonymous_file(size);
+       fd = libdecor_os_create_anonymous_file(size);
        if (fd < 0) {
                fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
                        size, strerror(errno));
@@ -740,7 +742,8 @@
        }
        if (scale != cmpnt->scale) {
                cmpnt->scale = scale;
-               if ((cmpnt->type != SHADOW) || 
is_border_surfaces_showing(frame_gtk)) {
+               if ((frame_gtk->decoration_type != DECORATION_TYPE_NONE) &&
+                   ((cmpnt->type != SHADOW) || 
is_border_surfaces_showing(frame_gtk))) {
                        draw_border_component(frame_gtk, cmpnt, cmpnt->type);
                        return true;
                }
@@ -892,6 +895,11 @@
        frame_gtk->headerbar.opaque = false;
        ensure_component(frame_gtk, &frame_gtk->headerbar);
 
+       if (frame_gtk->shadow.wl_surface) {
+               wl_subsurface_place_above(frame_gtk->headerbar.wl_subsurface,
+                                         frame_gtk->shadow.wl_surface);
+       }
+
        /* create an offscreen window with a header bar */
        /* TODO: This should only be done once at frame consutrction, but then
         *       the window and headerbar would not change style (e.g. backdrop)
@@ -1726,6 +1734,8 @@
                                          int *top,
                                          int *bottom)
 {
+       struct libdecor_frame_gtk *frame_gtk =
+               (struct libdecor_frame_gtk *) frame;
        enum libdecor_window_state window_state;
 
        if (configuration) {
@@ -1743,17 +1753,21 @@
        if (bottom)
                *bottom = 0;
        if (top) {
-               GtkWidget *header = ((struct libdecor_frame_gtk 
*)frame)->header;
                enum decoration_type type = 
window_state_to_decoration_type(window_state);
 
-               /* avoid warnings after decoration has been turned off */
-               if (GTK_IS_WIDGET(header) && (type != DECORATION_TYPE_NONE)) {
-                       /* Redraw title bar to ensure size will be up-to-date */
-                       if (configuration && type == DECORATION_TYPE_TITLE_ONLY)
-                               draw_title_bar((struct libdecor_frame_gtk *) 
frame);
-                       *top = gtk_widget_get_allocated_height(header);
-               } else {
+               switch (type) {
+               case DECORATION_TYPE_NONE:
                        *top = 0;
+                       break;
+               case DECORATION_TYPE_ALL:
+                       ensure_border_surfaces(frame_gtk);
+                       G_GNUC_FALLTHROUGH;
+               case DECORATION_TYPE_TITLE_ONLY:
+                       if (!frame_gtk->header)
+                               ensure_title_bar_surfaces(frame_gtk);
+                       gtk_widget_show_all(frame_gtk->window);
+                       gtk_widget_get_preferred_height(frame_gtk->header, 
NULL, top);
+                       break;
                }
        }
 
@@ -2772,6 +2786,12 @@
        struct libdecor_plugin_gtk *plugin_gtk;
        struct wl_display *wl_display;
 
+#ifdef HAVE_GETTID
+       /* Only support running on the main thread. */
+       if (getpid () != gettid ())
+               return NULL;
+#endif
+
        plugin_gtk = zalloc(sizeof *plugin_gtk);
        libdecor_plugin_init(&plugin_gtk->plugin,
                             context,
@@ -2789,6 +2809,8 @@
                plugin_gtk->cursor_size = 24;
        }
 
+       plugin_gtk->color_scheme_setting = libdecor_get_color_scheme();
+
        wl_display = libdecor_get_wl_display(context);
        plugin_gtk->wl_registry = wl_display_get_registry(wl_display);
        wl_registry_add_listener(plugin_gtk->wl_registry,
@@ -2817,6 +2839,11 @@
                return NULL;
        }
 
+       g_object_set(gtk_settings_get_default(),
+                    "gtk-application-prefer-dark-theme",
+                    plugin_gtk->color_scheme_setting == 
LIBDECOR_COLOR_SCHEME_PREFER_DARK,
+                    NULL);
+
        return &plugin_gtk->plugin;
 }
 
@@ -2833,6 +2860,7 @@
        .constructor = libdecor_plugin_new,
        .conflicting_symbols = {
                "png_free",
+               "gdk_get_use_xshm",
                NULL,
        },
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libdecor-0.2.2/src/plugins/gtk/meson.build 
new/libdecor-0.2.5/src/plugins/gtk/meson.build
--- old/libdecor-0.2.2/src/plugins/gtk/meson.build      2024-01-15 
22:00:42.000000000 +0100
+++ new/libdecor-0.2.5/src/plugins/gtk/meson.build      2025-12-16 
10:21:49.000000000 +0100
@@ -15,7 +15,7 @@
     cairo_dep,
     math_dep,
     wayland_cursor_dep,
-    cursor_settings_dep,
+    desktop_settings_dep,
     os_compatibility_dep,
     gtk_dep,
   ],

Reply via email to