]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix wildcard signals in dbusbind.c
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 31 Mar 2024 17:59:58 +0000 (19:59 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 31 Mar 2024 18:06:58 +0000 (20:06 +0200)
* src/dbusbind.c (xd_read_message_1): Handle registered signals
with wildcards.  (Bug#69926)

(cherry picked from commit 09f381d70d8852d90cdd3c8d7e1e2786dbc61f92)

src/dbusbind.c

index 7069e27e3eb99a6111cd00634516484fc7974347..0441b07a3b27cbe9465abeccd25cee642880ccf2 100644 (file)
@@ -1689,6 +1689,22 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
                   bus, build_string (interface), build_string (member));
       value = Fgethash (key, Vdbus_registered_objects_table, Qnil);
 
+      /* A signal could be registered with a nil interface or member.  */
+      if (mtype == DBUS_MESSAGE_TYPE_SIGNAL)
+       {
+         key = list4 (QCsignal, bus, Qnil, build_string (member));
+         value = CALLN (Fappend, value,
+                        Fgethash (key, Vdbus_registered_objects_table, Qnil));
+
+         key = list4 (QCsignal, bus, build_string (interface), Qnil);
+         value = CALLN (Fappend, value,
+                        Fgethash (key, Vdbus_registered_objects_table, Qnil));
+
+         key = list4 (QCsignal, bus, Qnil, Qnil);
+         value = CALLN (Fappend, value,
+                        Fgethash (key, Vdbus_registered_objects_table, Qnil));
+       }
+
       /* Loop over the registered functions.  Construct an event.  */
       for (; !NILP (value); value = CDR_SAFE (value))
        {