[gnome-settings-daemon/docking-stations] Call the XRANDR plugin asynchronously



commit e399908d7745fde82d0c7332fd06b7ba1cdcccc7
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Dec 5 16:38:44 2011 -0600

    Call the XRANDR plugin asynchronously
    
    We can't make a sync call because
    
    a) the XRANDR plugin runs in the same process, but in another GMainContext than
    the one used for our sync call.  So, it can't accept connections while the
    sync call's innermost poll() is running.
    
    b) I guess this means DBus sucks for intra-process communication.
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 plugins/power/gsd-power-manager.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 3c7be2f..c0836d2 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2212,13 +2212,14 @@ up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
 
         /* tell the RANDR plugin to update its state; the display on the lid needs to be turned off */
         if (manager->priv->xrandr_internal_proxy != NULL) {
-                g_dbus_proxy_call_sync (manager->priv->xrandr_internal_proxy,
-                                        "LidStateChanged",
-                                        NULL,                     /* parameters */
-                                        G_DBUS_CALL_FLAGS_NONE,   /* flags */
-                                        -1,                       /* timeout */
-                                        NULL,                     /* cancellable */
-                                        NULL);                    /* NULL-GError */
+                g_dbus_proxy_call (manager->priv->xrandr_internal_proxy,
+                                   "LidStateChanged",
+                                   NULL,                     /* parameters */
+                                   G_DBUS_CALL_FLAGS_NONE,   /* flags */
+                                   -1,                       /* timeout */
+                                   NULL,                     /* cancellable */
+                                   NULL,                     /* callback */
+                                   NULL);                   /* user_data */
         }
 
         /* fake a keypress */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]