[gnome-settings-daemon/randr-hotplug: 11/13] Run the display capplet when autoconfiguration is done



commit 5ae522491d90660cc5208311ab1513090979dd11
Author: Federico Mena Quintero <federico novell com>
Date:   Sun May 31 14:09:18 2009 -0500

    Run the display capplet when autoconfiguration is done
    
    Although we do a best-effort of automatically configuring new outputs on hotplug,
    we don't actually know the physical layout of the monitors.  So we start the
    display capplet to let the user tweak that.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>
---
 plugins/xrandr/gsd-xrandr-manager.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index f4e18ed..ececa44 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -111,6 +111,7 @@ static void     gsd_xrandr_manager_finalize    (GObject             *object);
 static void error_message (GsdXrandrManager *mgr, const char *primary_text, GError *error_to_display, const char *secondary_text);
 
 static void status_icon_popup_menu (GsdXrandrManager *manager, guint button, guint32 timestamp);
+static void run_display_capplet (GtkWidget *widget);
 
 G_DEFINE_TYPE (GsdXrandrManager, gsd_xrandr_manager, G_TYPE_OBJECT)
 
@@ -1001,6 +1002,8 @@ auto_configure_outputs (GsdXrandrManager *manager, guint32 timestamp)
          * start the display capplet so that the user can tweak things to his
          * liking.
          */
+
+        run_display_capplet (NULL);
 }
 
 static void
@@ -1093,12 +1096,15 @@ on_randr_event (GnomeRRScreen *screen, gpointer data)
 }
 
 static void
-popup_menu_configure_display_cb (GtkMenuItem *item, gpointer data)
+run_display_capplet (GtkWidget *widget)
 {
         GdkScreen *screen;
         GError *error;
 
-        screen = gtk_widget_get_screen (GTK_WIDGET (item));
+        if (widget)
+                screen = gtk_widget_get_screen (widget);
+        else
+                screen = gdk_screen_get_default ();
 
         error = NULL;
         if (!gdk_spawn_command_line_on_screen (screen, GSD_XRANDR_DISPLAY_CAPPLET, &error)) {
@@ -1117,6 +1123,12 @@ popup_menu_configure_display_cb (GtkMenuItem *item, gpointer data)
 }
 
 static void
+popup_menu_configure_display_cb (GtkMenuItem *item, gpointer data)
+{
+        run_display_capplet (GTK_WIDGET (item));
+}
+
+static void
 status_icon_popup_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
 {
         GsdXrandrManager *manager = GSD_XRANDR_MANAGER (data);



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