[Xfce4-commits] [xfce/xfce4-panel] 01/01: Add support for XRandR's primary monitor feature (Bug #9338)

noreply at xfce.org noreply at xfce.org
Thu Mar 16 00:10:29 CET 2017


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository xfce/xfce4-panel.

commit a24b0214c9218ab39581d0e40b1b441913d631f7
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Feb 27 23:33:01 2017 +0100

    Add support for XRandR's primary monitor feature (Bug #9338)
    
    If there is no output name set in xfconf it behaves like before,
    i.e. "Automatic" mode.
    However if the driver does not return a monitor name it now falls
    back to the primary display.
---
 panel/panel-preferences-dialog.c |  5 ++++-
 panel/panel-window.c             | 14 +++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/panel/panel-preferences-dialog.c b/panel/panel-preferences-dialog.c
index 7a93e24..f700b18 100644
--- a/panel/panel-preferences-dialog.c
+++ b/panel/panel-preferences-dialog.c
@@ -490,8 +490,11 @@ panel_preferences_dialog_bindings_update (PanelPreferencesDialog *dialog)
       || !panel_str_is_empty (output_name))
     {
       gtk_list_store_insert_with_values (GTK_LIST_STORE (store), &iter, n++,
-                                         OUTPUT_NAME, NULL,
+                                         OUTPUT_NAME, "Automatic",
                                          OUTPUT_TITLE, _("Automatic"), -1);
+      gtk_list_store_insert_with_values (GTK_LIST_STORE (store), &iter, n++,
+                                         OUTPUT_NAME, "Primary",
+                                         OUTPUT_TITLE, _("Primary"), -1);
       if (panel_str_is_empty (output_name))
         {
           gtk_combo_box_set_active_iter  (GTK_COMBO_BOX (object), &iter);
diff --git a/panel/panel-window.c b/panel/panel-window.c
index e7b23b2..81231e8 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -2079,16 +2079,24 @@ panel_window_screen_layout_changed (GdkScreen   *screen,
     }
   else
     {
-      if (panel_str_is_empty (window->output_name))
+      if (g_strcmp0 (window->output_name, "Automatic") == 0
+          || window->output_name == NULL)
         {
-          normal_monitor_positioning:
-
           /* get the monitor geometry based on the panel position */
           monitor_num = gdk_screen_get_monitor_at_point (screen, window->base_x,
                                                          window->base_y);
           gdk_screen_get_monitor_geometry (screen, monitor_num, &a);
           panel_return_if_fail (a.width > 0 && a.height > 0);
         }
+      else if (g_strcmp0 (window->output_name, "Primary") == 0)
+        {
+          normal_monitor_positioning:
+          /* get the primary monitor */
+          monitor_num = gdk_screen_get_primary_monitor (screen);
+
+          gdk_screen_get_monitor_geometry (screen, monitor_num, &a);
+          panel_return_if_fail (a.width > 0 && a.height > 0);
+        }
       else
         {
           /* check if we've stored the monitor number in the config or

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list