[Xfce4-commits] xfce4-settings:bluesabre/display-settings Plugged in mirror displays checkbox.

2013-12-09 Thread Nick Schermer
Updating branch refs/heads/bluesabre/display-settings
 to 13cc6a31ba8a89976149034bcd8a9354b3681adf (commit)
   from 402a724d0734f2c54ffef8574cb9f6e84708fe5e (commit)

commit 13cc6a31ba8a89976149034bcd8a9354b3681adf
Author: Sean Davis smd.seanda...@gmail.com
Date:   Thu Sep 27 10:58:53 2012 -0400

Plugged in mirror displays checkbox.

 dialogs/display-settings/main.c |   30 ++
 1 file changed, 30 insertions(+)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index af39b61..5c61662 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -962,12 +962,15 @@ display_setting_mirror_displays_toggled (GtkToggleButton 
*togglebutton,
 GtkBuilder  *builder)
 {
 GObject *positions, *active_displays;
+guint n, current_display;
 
 if (!xfce_randr)
 return;
 
 if (xfce_randr-noutput = 1)
 return;
+
+current_display = xfce_randr-active_output;
 
 positions = gtk_builder_get_object (builder, randr-position);
 active_displays = gtk_builder_get_object (builder, 
randr-active-displays);
@@ -976,6 +979,23 @@ display_setting_mirror_displays_toggled (GtkToggleButton 
*togglebutton,
 {
 /* Activate mirror-mode */
 
+/* Apply mirror settings to each monitor */
+for (n = 0; n  display_settings_get_n_active_outputs (); n++)
+{
+xfce_randr-active_output = n;
+
+XFCE_RANDR_POS_X (xfce_randr) = 0;
+XFCE_RANDR_POS_Y (xfce_randr) = 0;
+
+xfce_randr_save_output (xfce_randr, Default, display_channel,
+xfce_randr-active_output);
+
+}
+
+xfce_randr-active_output = current_display;
+
+xfce_randr_apply (xfce_randr, Default, display_channel);
+
 /* Disable the position comboboxes */
 gtk_widget_set_sensitive (GTK_WIDGET (positions), FALSE);
 gtk_widget_set_sensitive (GTK_WIDGET (active_displays), FALSE);
@@ -1127,6 +1147,7 @@ display_settings_treeview_selection_changed 
(GtkTreeSelection *selection,
 GtkTreeIter   iter;
 gboolean  has_selection;
 gint  active_id;
+GObject *mirror_displays, *position_combo, *display_combo;
 
 /* Get the selection */
 has_selection = gtk_tree_selection_get_selected (selection, model, iter);
@@ -1148,6 +1169,15 @@ display_settings_treeview_selection_changed 
(GtkTreeSelection *selection,
 display_setting_refresh_rates_populate (builder);
 display_setting_rotations_populate (builder);
 display_setting_reflections_populate (builder);
+
+mirror_displays = gtk_builder_get_object(builder, mirror-displays);
+if (gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(mirror_displays) 
)) {
+position_combo = gtk_builder_get_object(builder, randr-position);
+display_combo = gtk_builder_get_object(builder, 
randr-active-displays);
+
+gtk_widget_set_sensitive( GTK_WIDGET(position_combo), FALSE );
+gtk_widget_set_sensitive( GTK_WIDGET(display_combo), FALSE );
+}
 }
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-settings:bluesabre/display-settings Plugged in mirror displays checkbox.

2012-09-27 Thread Sean Davis
Updating branch refs/heads/bluesabre/display-settings
 to 70e1b53d387a5fb4991aeb969c2887c873f36b72 (commit)
   from dc10e401b2a5889a53ec1df459043deed0ffcc81 (commit)

commit 70e1b53d387a5fb4991aeb969c2887c873f36b72
Author: Sean Davis smd.seanda...@gmail.com
Date:   Thu Sep 27 10:58:53 2012 -0400

Plugged in mirror displays checkbox.

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

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index af39b61..5c61662 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -962,12 +962,15 @@ display_setting_mirror_displays_toggled (GtkToggleButton 
*togglebutton,
 GtkBuilder  *builder)
 {
 GObject *positions, *active_displays;
+guint n, current_display;
 
 if (!xfce_randr)
 return;
 
 if (xfce_randr-noutput = 1)
 return;
+
+current_display = xfce_randr-active_output;
 
 positions = gtk_builder_get_object (builder, randr-position);
 active_displays = gtk_builder_get_object (builder, 
randr-active-displays);
@@ -976,6 +979,23 @@ display_setting_mirror_displays_toggled (GtkToggleButton 
*togglebutton,
 {
 /* Activate mirror-mode */
 
+/* Apply mirror settings to each monitor */
+for (n = 0; n  display_settings_get_n_active_outputs (); n++)
+{
+xfce_randr-active_output = n;
+
+XFCE_RANDR_POS_X (xfce_randr) = 0;
+XFCE_RANDR_POS_Y (xfce_randr) = 0;
+
+xfce_randr_save_output (xfce_randr, Default, display_channel,
+xfce_randr-active_output);
+
+}
+
+xfce_randr-active_output = current_display;
+
+xfce_randr_apply (xfce_randr, Default, display_channel);
+
 /* Disable the position comboboxes */
 gtk_widget_set_sensitive (GTK_WIDGET (positions), FALSE);
 gtk_widget_set_sensitive (GTK_WIDGET (active_displays), FALSE);
@@ -1127,6 +1147,7 @@ display_settings_treeview_selection_changed 
(GtkTreeSelection *selection,
 GtkTreeIter   iter;
 gboolean  has_selection;
 gint  active_id;
+GObject *mirror_displays, *position_combo, *display_combo;
 
 /* Get the selection */
 has_selection = gtk_tree_selection_get_selected (selection, model, iter);
@@ -1148,6 +1169,15 @@ display_settings_treeview_selection_changed 
(GtkTreeSelection *selection,
 display_setting_refresh_rates_populate (builder);
 display_setting_rotations_populate (builder);
 display_setting_reflections_populate (builder);
+
+mirror_displays = gtk_builder_get_object(builder, mirror-displays);
+if (gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(mirror_displays) 
)) {
+position_combo = gtk_builder_get_object(builder, randr-position);
+display_combo = gtk_builder_get_object(builder, 
randr-active-displays);
+
+gtk_widget_set_sensitive( GTK_WIDGET(position_combo), FALSE );
+gtk_widget_set_sensitive( GTK_WIDGET(display_combo), FALSE );
+}
 }
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits