[Xfce4-commits] <xfce4-settings:master> Do not cache the preferred mode anymore

Nick Schermer noreply at xfce.org
Sat Aug 28 23:04:39 CEST 2010


Updating branch refs/heads/master
         to 04ec4df16ae702f11f02491797b45a7d3ee755f5 (commit)
       from fe5c127453de1aff831f7409f2c6eca9c8272763 (commit)

commit 04ec4df16ae702f11f02491797b45a7d3ee755f5
Author: Lionel Le Folgoc <mrpouit at gmail.com>
Date:   Thu Jun 24 19:23:00 2010 +0200

    Do not cache the preferred mode anymore
    
    It is really easy to obtain it from the output info (and actually, it is not
    really *the* preferred mode, but the head of the preferred modes' list).

 dialogs/display-settings/main.c       |    9 ++++++---
 dialogs/display-settings/xfce-randr.c |    5 -----
 dialogs/display-settings/xfce-randr.h |    2 --
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 7214ee0..936d178 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -511,7 +511,8 @@ display_setting_output_toggled (GtkToggleButton *togglebutton,
     is_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio));
 
     if (is_active && XFCE_RANDR_MODE (xfce_randr) == None)
-        XFCE_RANDR_MODE (xfce_randr) = XFCE_RANDR_PREFERRED_MODE (xfce_randr);
+        XFCE_RANDR_MODE (xfce_randr) =
+            XFCE_RANDR_OUTPUT_INFO (xfce_randr)->modes[XFCE_RANDR_OUTPUT_INFO (xfce_randr)->npreferred];
     else if (!is_active && XFCE_RANDR_MODE (xfce_randr) != None)
         XFCE_RANDR_MODE (xfce_randr) = None;
 
@@ -890,12 +891,14 @@ display_settings_minimal_dialog_response (GtkDialog  *dialog,
 
         if (use_first_screen)
         {
-            xfce_randr->mode[first] = xfce_randr->preferred_mode[first];
+            xfce_randr->mode[first] =
+                xfce_randr->output_info[first]->modes[xfce_randr->output_info[first]->npreferred];
             xfce_randr->mode[second] = None;
         }
         else if (use_second_screen)
         {
-            xfce_randr->mode[second] = xfce_randr->preferred_mode[second];
+            xfce_randr->mode[second] =
+                xfce_randr->output_info[second]->modes[xfce_randr->output_info[second]->npreferred];
             xfce_randr->mode[first] = None;
         }
         else
diff --git a/dialogs/display-settings/xfce-randr.c b/dialogs/display-settings/xfce-randr.c
index 6782ecb..c855bc6 100644
--- a/dialogs/display-settings/xfce-randr.c
+++ b/dialogs/display-settings/xfce-randr.c
@@ -175,7 +175,6 @@ xfce_randr_populate (XfceRandr *randr,
 
     /* allocate space for the settings */
     randr->mode = g_new0 (RRMode, randr->resources->noutput);
-    randr->preferred_mode = g_new0 (RRMode, randr->resources->noutput);
     randr->modes = g_new0 (XfceRRMode *, randr->resources->noutput);
     randr->rotation = g_new0 (Rotation, randr->resources->noutput);
     randr->rotations = g_new0 (Rotation, randr->resources->noutput);
@@ -211,9 +210,6 @@ xfce_randr_populate (XfceRandr *randr,
         /* do not query disconnected outputs */
         if (randr->output_info[n]->connection == RR_Connected)
         {
-            /* load defaults */
-            randr->preferred_mode[n] = randr->output_info[n]->modes[randr->output_info[n]->npreferred];
-
 #ifdef HAS_RANDR_ONE_POINT_THREE
             /* find the primary screen if supported */
             if (randr->has_1_3 && XRRGetOutputPrimary (xdisplay, GDK_WINDOW_XID (root_window)) == randr->resources->outputs[n])
@@ -331,7 +327,6 @@ xfce_randr_cleanup (XfceRandr *randr)
     g_free (randr->clone_modes);
     g_free (randr->mode);
     g_free (randr->modes);
-    g_free (randr->preferred_mode);
     g_free (randr->rotation);
     g_free (randr->rotations);
     g_free (randr->status);
diff --git a/dialogs/display-settings/xfce-randr.h b/dialogs/display-settings/xfce-randr.h
index 7067fd6..d01a017 100644
--- a/dialogs/display-settings/xfce-randr.h
+++ b/dialogs/display-settings/xfce-randr.h
@@ -26,7 +26,6 @@
 
 #define XFCE_RANDR_EVENT_BASE(randr)      (randr->event_base)
 #define XFCE_RANDR_MODE(randr)            (randr->mode[randr->active_output])
-#define XFCE_RANDR_PREFERRED_MODE(randr)  (randr->preferred_mode[randr->active_output])
 #define XFCE_RANDR_SUPPORTED_MODES(randr) (randr->modes[randr->active_output])
 #define XFCE_RANDR_ROTATION(randr)        (randr->rotation[randr->active_output])
 #define XFCE_RANDR_ROTATIONS(randr)       (randr->rotations[randr->active_output])
@@ -101,7 +100,6 @@ struct _XfceRandr
 
     /* selected settings for all outputs */
     RRMode              *mode;
-    RRMode              *preferred_mode;
     Rotation            *rotation;
     Rotation            *rotations;
     XfceOutputPosition  *position;



More information about the Xfce4-commits mailing list