[Xfce4-commits] <xfce4-settings:xrandr-display-settings> If the user attempted to disable an output, forcefully reload the view

Jérôme Guelfucci noreply at xfce.org
Sun Jun 27 23:04:03 CEST 2010


Updating branch refs/heads/xrandr-display-settings
         to 99bf2e28ee1db5d5273f2120eafd7fba3a9295ee (commit)
       from c3e08946f4d74d6530fc97dc40ae61ded82e7af8 (commit)

commit 99bf2e28ee1db5d5273f2120eafd7fba3a9295ee
Author: Lionel Le Folgoc <mrpouit at gmail.com>
Date:   Sun Jun 27 19:47:45 2010 +0200

    If the user attempted to disable an output, forcefully reload the view
    
    It is possible that it failed because this was the last active output, and
    xfce4-settings-helper prevented that from happening. In that case, the screen
    state didn't change, no notification is emitted, so xfce4-display-settings will
    think that the output is disabled while it is not. Forcefully reloading the
    view should avoid that.

 dialogs/display-settings/main.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index e5a9dd2..a0db5e6 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -780,11 +780,15 @@ display_setting_resolutions_populate (GtkBuilder *builder)
 
 
 #ifdef HAS_RANDR_ONE_POINT_TWO
+/* Forward-declaration only needed for display_setting_output_toggled () */
+static void
+display_settings_treeview_populate (GtkBuilder *builder);
+
 static void
 display_setting_output_toggled (GtkToggleButton *togglebutton,
                                 GtkBuilder      *builder)
 {
-    gint is_active;
+    gint is_active, disabling;
 
     if (!xfce_randr)
         return;
@@ -794,14 +798,27 @@ display_setting_output_toggled (GtkToggleButton *togglebutton,
     else
         is_active = TRUE;
 
+    disabling = FALSE;
     if (is_active && XFCE_RANDR_MODE (xfce_randr) == None)
         XFCE_RANDR_MODE (xfce_randr) =
             xfce_randr_preferred_mode (xfce_randr, xfce_randr->active_output);
     else if (!is_active && XFCE_RANDR_MODE (xfce_randr) != None)
+    {
         XFCE_RANDR_MODE (xfce_randr) = None;
+        disabling = TRUE;
+    }
 
     /* Apply the changes */
     xfce_randr_save (xfce_randr, "Default", display_channel);
+
+    /* if the user attempted to disable an output, forcefully reload the view.
+     * It's possible that it failed because it was the last active output.
+     */
+    if (disabling)
+    {
+        xfce_randr_reload (xfce_randr);
+        display_settings_treeview_populate (builder);
+    }
 }
 
 



More information about the Xfce4-commits mailing list