[Xfce4-commits] [apps/xfce4-screensaver] 01/01: Send empty DBus responses (bug #16522)

noreply at xfce.org noreply at xfce.org
Sat Mar 28 13:23:11 CET 2020


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit cc33cea3df2ab361cdbddecfa901fbc048ce278b
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Mar 28 08:23:00 2020 -0400

    Send empty DBus responses (bug #16522)
---
 src/gs-listener-dbus.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/src/gs-listener-dbus.c b/src/gs-listener-dbus.c
index 3463ef9..6307324 100644
--- a/src/gs-listener-dbus.c
+++ b/src/gs-listener-dbus.c
@@ -833,6 +833,25 @@ listener_remove_ck_ref_entry (GSListener *listener,
 #endif
 
 static DBusHandlerResult
+listener_dbus_confirm (DBusConnection *connection,
+                       DBusMessage    *message) {
+    DBusMessage        *reply;
+
+    reply = dbus_message_new_method_return (message);
+    if (reply == NULL) {
+        g_error ("No memory");
+    }
+
+    if (!dbus_connection_send (connection, reply, NULL)) {
+        g_error ("No memory");
+    }
+
+    dbus_message_unref (reply);
+
+    return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static DBusHandlerResult
 listener_dbus_add_ref_entry (GSListener     *listener,
                              int             entry_type,
                              DBusConnection *connection,
@@ -1306,15 +1325,15 @@ listener_dbus_handle_session_message (DBusConnection *connection,
 
     if (dbus_message_is_method_call (message, GS_LISTENER_SERVICE, "Lock")) {
         g_signal_emit (listener, signals[LOCK], 0);
-        return DBUS_HANDLER_RESULT_HANDLED;
+        return listener_dbus_confirm (connection, message);
     }
     if (dbus_message_is_method_call (message, GS_LISTENER_SERVICE, "Quit")) {
         g_signal_emit (listener, signals[QUIT], 0);
-        return DBUS_HANDLER_RESULT_HANDLED;
+        return listener_dbus_confirm (connection, message);
     }
     if (dbus_message_is_method_call (message, GS_LISTENER_SERVICE, "Cycle")) {
         g_signal_emit (listener, signals[CYCLE], 0);
-        return DBUS_HANDLER_RESULT_HANDLED;
+        return listener_dbus_confirm (connection, message);
     }
     if (dbus_message_is_method_call (message, GS_LISTENER_SERVICE, "Inhibit")) {
         return listener_dbus_add_ref_entry (listener, REF_ENTRY_TYPE_INHIBIT, connection, message);
@@ -1345,7 +1364,7 @@ listener_dbus_handle_session_message (DBusConnection *connection,
     }
     if (dbus_message_is_method_call (message, GS_LISTENER_SERVICE, "SimulateUserActivity")) {
         g_signal_emit (listener, signals[SIMULATE_USER_ACTIVITY], 0);
-        return DBUS_HANDLER_RESULT_HANDLED;
+        return listener_dbus_confirm (connection, message);
     }
     if (dbus_message_is_method_call (message, "org.freedesktop.DBus.Introspectable", "Introspect")) {
         return do_introspect (connection, message, local_interface);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list