[xfce4-settings: 1/3] Add patch for multi monitor position settings. Fixes bug #773780

Kevin Fenzi kevin at fedoraproject.org
Sat Jan 21 19:39:03 UTC 2012


commit d6dfba0cfd0aa72997c8b5293ffbb5c80b04a4b3
Author: Kevin Fenzi <kevin at scrye.com>
Date:   Sat Jan 21 12:35:24 2012 -0700

    Add patch for multi monitor position settings. Fixes bug #773780

 xfce4-settings-4.8.3-monitor-position.patch |  282 +++++++++++++++++++++++++++
 xfce4-settings.spec                         |   12 +-
 2 files changed, 292 insertions(+), 2 deletions(-)
---
diff --git a/xfce4-settings-4.8.3-monitor-position.patch b/xfce4-settings-4.8.3-monitor-position.patch
new file mode 100644
index 0000000..8a17729
--- /dev/null
+++ b/xfce4-settings-4.8.3-monitor-position.patch
@@ -0,0 +1,282 @@
+diff -Nur xfce4-settings-4.8.3.orig/dialogs/display-settings/display-dialog.glade xfce4-settings-4.8.3/dialogs/display-settings/display-dialog.glade
+--- xfce4-settings-4.8.3.orig/dialogs/display-settings/display-dialog.glade	2011-09-22 13:30:15.000000000 -0600
++++ xfce4-settings-4.8.3/dialogs/display-settings/display-dialog.glade	2012-01-21 12:23:13.056574990 -0700
+@@ -10,7 +10,6 @@
+     <property name="default_height">350</property>
+     <property name="icon_name">video-display</property>
+     <property name="type_hint">dialog</property>
+-    <property name="has_separator">False</property>
+     <property name="subtitle" translatable="yes">Configure screen settings and layout</property>
+     <child internal-child="vbox">
+       <object class="GtkVBox" id="dialog-vbox1">
+@@ -40,6 +39,9 @@
+                   </object>
+                 </child>
+               </object>
++              <packing>
++                <property name="position">0</property>
++              </packing>
+             </child>
+             <child>
+               <object class="GtkVBox" id="vbox1">
+@@ -49,7 +51,10 @@
+                 <child>
+                   <object class="GtkCheckButton" id="output-on">
+                     <property name="label" translatable="yes">_Use this output</property>
++                    <property name="can_focus">False</property>
++                    <property name="receives_default">False</property>
+                     <property name="use_underline">True</property>
++                    <property name="draw_indicator">True</property>
+                   </object>
+                   <packing>
+                     <property name="position">0</property>
+@@ -58,7 +63,7 @@
+                 <child>
+                   <object class="GtkTable" id="table1">
+                     <property name="visible">True</property>
+-                    <property name="n_rows">4</property>
++                    <property name="n_rows">5</property>
+                     <property name="n_columns">2</property>
+                     <property name="column_spacing">12</property>
+                     <property name="row_spacing">6</property>
+@@ -163,7 +168,77 @@
+                         <property name="y_options">GTK_FILL</property>
+                       </packing>
+                     </child>
++                    <child>
++                      <object class="GtkTable" id="table2">
++                        <property name="visible">True</property>
++                        <property name="n_columns">4</property>
++                        <child>
++                          <object class="GtkLabel" id="label2">
++                            <property name="visible">True</property>
++                            <property name="label" translatable="yes">X:</property>
++                          </object>
++                        </child>
++                        <child>
++                          <object class="GtkLabel" id="label6">
++                            <property name="visible">True</property>
++                            <property name="label" translatable="yes">Y:</property>
++                          </object>
++                          <packing>
++                            <property name="left_attach">2</property>
++                            <property name="right_attach">3</property>
++                          </packing>
++                        </child>
++                        <child>
++                          <object class="GtkSpinButton" id="randr-xpos">
++                            <property name="visible">True</property>
++                            <property name="can_focus">True</property>
++                            <property name="max_length">5</property>
++                            <property name="invisible_char">&#x2022;</property>
++                            <property name="snap_to_ticks">True</property>
++                            <property name="numeric">True</property>
++                          </object>
++                          <packing>
++                            <property name="left_attach">1</property>
++                            <property name="right_attach">2</property>
++                          </packing>
++                        </child>
++                        <child>
++                          <object class="GtkSpinButton" id="randr-ypos">
++                            <property name="visible">True</property>
++                            <property name="can_focus">True</property>
++                            <property name="max_length">5</property>
++                            <property name="invisible_char">&#x2022;</property>
++                            <property name="snap_to_ticks">True</property>
++                            <property name="numeric">True</property>
++                          </object>
++                          <packing>
++                            <property name="left_attach">3</property>
++                            <property name="right_attach">4</property>
++                          </packing>
++                        </child>
++                      </object>
++                      <packing>
++                        <property name="left_attach">1</property>
++                        <property name="right_attach">2</property>
++                        <property name="top_attach">4</property>
++                        <property name="bottom_attach">5</property>
++                      </packing>
++                    </child>
++                    <child>
++                      <object class="GtkLabel" id="label1">
++                        <property name="visible">True</property>
++                        <property name="xalign">0</property>
++                        <property name="label" translatable="yes">Position:</property>
++                      </object>
++                      <packing>
++                        <property name="top_attach">4</property>
++                        <property name="bottom_attach">5</property>
++                      </packing>
++                    </child>
+                   </object>
++                  <packing>
++                    <property name="position">1</property>
++                  </packing>
+                 </child>
+               </object>
+               <packing>
+diff -Nur xfce4-settings-4.8.3.orig/dialogs/display-settings/main.c xfce4-settings-4.8.3/dialogs/display-settings/main.c
+--- xfce4-settings-4.8.3.orig/dialogs/display-settings/main.c	2011-09-22 13:30:15.000000000 -0600
++++ xfce4-settings-4.8.3/dialogs/display-settings/main.c	2012-01-21 12:23:13.057574995 -0700
+@@ -699,6 +699,98 @@
+ 
+ 
+ static void
++display_setting_xpos_changed (GtkSpinButton *spinbutton,
++                                GtkBuilder      *builder)
++{
++    gint value;
++
++    value = gtk_spin_button_get_value_as_int  (spinbutton);
++
++    XFCE_RANDR_POS_X (xfce_randr) = value;
++
++    display_setting_refresh_rates_populate (builder);
++
++    /* Apply the changes */
++    xfce_randr_save_output (xfce_randr, "Default", display_channel,
++                            xfce_randr->active_output);
++    xfce_randr_apply (xfce_randr, "Default", display_channel);
++}
++
++
++
++static void
++display_setting_xpos_status_populate (GtkBuilder *builder)
++{
++    GObject *xpos;
++    gchar    property[512];
++
++    if (!xfce_randr)
++        return;
++
++    if (xfce_randr->noutput <= 1)
++        return;
++
++    xpos = gtk_builder_get_object (builder, "randr-xpos");
++
++    /* Disconnect the "toggled" signal to avoid writing the config again */
++    g_object_disconnect (xpos, "any_signal::value-changed",
++                         display_setting_xpos_changed,
++                         builder, NULL);
++    gtk_spin_button_set_value (GTK_SPIN_BUTTON (xpos),
++                                  XFCE_RANDR_POS_X (xfce_randr));
++    /* Reconnect the signal */
++    g_signal_connect (G_OBJECT (xpos), "value-changed", G_CALLBACK (display_setting_xpos_changed),
++                      builder);
++}
++
++
++
++static void
++display_setting_ypos_changed (GtkSpinButton *spinbutton,
++                                GtkBuilder      *builder)
++{
++    gint value;
++
++    value = gtk_spin_button_get_value_as_int  (spinbutton);
++
++    XFCE_RANDR_POS_Y (xfce_randr) = value;
++
++    display_setting_refresh_rates_populate (builder);
++
++    /* Apply the changes */
++    xfce_randr_save_output (xfce_randr, "Default", display_channel,
++                            xfce_randr->active_output);
++    xfce_randr_apply (xfce_randr, "Default", display_channel);
++}
++
++
++
++static void
++display_setting_ypos_status_populate (GtkBuilder *builder)
++{
++    GObject *ypos;
++
++    if (!xfce_randr)
++        return;
++
++    if (xfce_randr->noutput <= 1)
++        return;
++
++    ypos = gtk_builder_get_object (builder, "randr-ypos");
++    /* Disconnect the "value-changed" signal to avoid writing the config again */
++    g_object_disconnect (ypos, "any_signal::value-changed",
++                         display_setting_ypos_changed,
++                         builder, NULL);
++    gtk_spin_button_set_value (GTK_SPIN_BUTTON (ypos),
++                                  XFCE_RANDR_POS_Y (xfce_randr));
++    /* Reconnect the signal */
++    g_signal_connect (G_OBJECT (ypos), "value-changed", G_CALLBACK (display_setting_ypos_changed),
++                      builder);
++}
++
++
++
++static void
+ display_settings_treeview_selection_changed (GtkTreeSelection *selection,
+                                              GtkBuilder       *builder)
+ {
+@@ -723,6 +815,8 @@
+         display_setting_refresh_rates_populate (builder);
+         display_setting_rotations_populate (builder);
+         display_setting_reflections_populate (builder);
++        display_setting_xpos_status_populate (builder);
++        display_setting_ypos_status_populate (builder);
+     }
+ }
+ 
+@@ -827,6 +921,15 @@
+ 
+ 
+ static void
++display_settings_spin_button_create (GtkSpinButton *spinbutton)
++{
++	gtk_spin_button_set_increments(spinbutton, 1,0);
++	gtk_spin_button_set_range(spinbutton,0,4096);
++}
++
++
++
++static void
+ display_settings_dialog_response (GtkDialog  *dialog,
+                                   gint        response_id,
+                                   GtkBuilder *builder)
+@@ -843,7 +946,7 @@
+     GtkCellRenderer  *renderer;
+     GtkTreeSelection *selection;
+     GObject          *combobox;
+-    GObject          *label, *check;
++    GObject          *label, *check, *spin;
+ 
+     /* Get the treeview */
+     treeview = gtk_builder_get_object (builder, "randr-outputs");
+@@ -874,6 +977,26 @@
+     else
+         gtk_widget_hide (GTK_WIDGET (check));
+ 
++    spin = gtk_builder_get_object (builder, "randr-xpos");
++    display_settings_spin_button_create(GTK_SPIN_BUTTON (spin));
++    if (xfce_randr->noutput > 1)
++    {
++        gtk_widget_show (GTK_WIDGET (spin));
++        g_signal_connect (G_OBJECT (spin), "value-changed", G_CALLBACK (display_setting_xpos_changed), builder);
++    }
++    else
++        gtk_widget_hide (GTK_WIDGET (spin));
++
++    spin = gtk_builder_get_object (builder, "randr-ypos");
++    display_settings_spin_button_create(GTK_SPIN_BUTTON (spin));
++    if (xfce_randr->noutput > 1)
++    {
++        gtk_widget_show (GTK_WIDGET (spin));
++        g_signal_connect (G_OBJECT (spin), "value-changed", G_CALLBACK (display_setting_ypos_changed), builder);
++    }
++    else
++        gtk_widget_hide (GTK_WIDGET (spin));
++
+     label = gtk_builder_get_object (builder, "label-reflection");
+     gtk_widget_show (GTK_WIDGET (label));
+ 
diff --git a/xfce4-settings.spec b/xfce4-settings.spec
index ea751bf..a1c5b55 100644
--- a/xfce4-settings.spec
+++ b/xfce4-settings.spec
@@ -2,7 +2,7 @@
 
 Name:           xfce4-settings
 Version:        4.8.3
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Settings Manager for Xfce
 
 Group:          User Interface/Desktops
@@ -12,6 +12,9 @@ URL:            http://www.xfce.org/
 Source0:        http://archive.xfce.org/src/xfce/%{name}/%{xfceversion}/%{name}-%{version}.tar.bz2
 # use vendor's artwork
 Patch0:         xfce4-settings-4.6.0-fedora.patch
+# Add patch to handle position settings on multi monitor setups
+# https://bugzilla.xfce.org/show_bug.cgi?id=7465
+Patch1:         xfce4-settings-4.8.3-monitor-position.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  gettext
@@ -44,9 +47,11 @@ This package includes the settings manager applications for the Xfce desktop.
 %prep
 %setup -q
 %patch0 -p1 -b .vendor
+%patch1 -p1 -b .multi-monitor-position
 
 %build
-%configure --enable-sound-settings --enable-pluggable-dialogs
+# add --enable-maintainer-mode to regen after multi monitor setup patch.
+%configure --enable-maintainer-mode --enable-sound-settings --enable-pluggable-dialogs
 make %{?_smp_mflags}
 
 
@@ -85,6 +90,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/applications/xfce*.desktop
 
 %changelog
+* Sat Jan 21 2012 Kevin Fenzi <kevin at scrye.com> - 4.8.3-2
+- Add patch for multi monitor position settings. Fixes bug #773780
+
 * Fri Sep 23 2011 Kevin Fenzi <kevin at scrye.com> - 4.8.3-1
 - Update to 4.8.3
 


More information about the scm-commits mailing list