Commit cc33cea3 authored by Sean Davis's avatar Sean Davis 🕶

Send empty DBus responses (bug #16522)

parent 672964e5
......@@ -832,6 +832,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,
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment