[Xfce4-commits] <xfce4-settings:master> Added above (broken) and below code.

Nick Schermer noreply at xfce.org
Sun Oct 28 10:44:12 CET 2012


Updating branch refs/heads/master
         to 37d456cf9f52bcddcf8d009af909ff4b69331bc2 (commit)
       from f97545f2fd40630aff3adb67195315ff81321a14 (commit)

commit 37d456cf9f52bcddcf8d009af909ff4b69331bc2
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Wed Sep 26 16:01:29 2012 -0400

    Added above (broken) and below code.

 dialogs/display-settings/main.c |   50 +++++++++++++++++++++++++++++++++++---
 1 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 2147c68..2c17dfe 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -299,8 +299,40 @@ display_setting_positions_changed (GtkComboBox *combobox,
                 }
             }
             break;
-        case XFCE_RANDR_PLACEMENT_UP:
-        case XFCE_RANDR_PLACEMENT_DOWN:
+        case XFCE_RANDR_PLACEMENT_UP: // Extend Above
+            /* Walk all supported modes of current display */
+            modes = XFCE_RANDR_SUPPORTED_MODES (xfce_randr);
+            for (n = 0; n < XFCE_RANDR_OUTPUT_INFO (xfce_randr)->nmode; ++n)
+            {
+                /* Find the current mode. */
+                if (modes[n].id == XFCE_RANDR_MODE (xfce_randr))
+                {
+                    /* Change active output to secondary display. */
+                    xfce_randr->active_output = selected_display;
+                    /* Move the secondary display to the above the primary display. */
+                    XFCE_RANDR_POS_Y (xfce_randr) = modes[n].height;
+                    break;
+                }
+            }
+            break;
+        case XFCE_RANDR_PLACEMENT_DOWN: // Extend Below
+            /* Change active output to secondary display. */
+            xfce_randr->active_output = selected_display;
+            
+            /* Find the current mode. */
+            modes = XFCE_RANDR_SUPPORTED_MODES (xfce_randr);
+            for (n = 0; n < XFCE_RANDR_OUTPUT_INFO (xfce_randr)->nmode; ++n)
+            {
+                if (modes[n].id == XFCE_RANDR_MODE (xfce_randr))
+                {
+                    /* Change active output to primary display. */
+                    xfce_randr->active_output = current_display;
+                    /* Move the primary display to the below the secondary display. */
+                    XFCE_RANDR_POS_Y (xfce_randr) = modes[n].height;
+                    break;
+                }
+            }
+            break;
         default:
             break;
     }
@@ -352,6 +384,18 @@ display_setting_positions_populate (GtkBuilder *builder)
     gtk_list_store_set (GTK_LIST_STORE (model), &iter,
                         COLUMN_COMBO_NAME, _("right of"),
                         COLUMN_COMBO_VALUE, XFCE_RANDR_PLACEMENT_RIGHT, -1);
+                        
+    /* Insert above */
+    gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+    gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+                        COLUMN_COMBO_NAME, _("above"),
+                        COLUMN_COMBO_VALUE, XFCE_RANDR_PLACEMENT_UP, -1);
+                        
+    /* Insert below */
+    gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+    gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+                        COLUMN_COMBO_NAME, _("below"),
+                        COLUMN_COMBO_VALUE, XFCE_RANDR_PLACEMENT_DOWN, -1);
 
     
     /* Reconnect the signal */
@@ -755,8 +799,6 @@ display_setting_resolutions_populate (GtkBuilder *builder)
     GtkTreeIter    iter;
     XfceRRMode   *modes;
     
-    g_print("get resolutions");
-
     /* Get the combo box store and clear it */
     combobox = gtk_builder_get_object (builder, "randr-resolution");
     model = gtk_combo_box_get_model (GTK_COMBO_BOX (combobox));


More information about the Xfce4-commits mailing list