[Xfce4-commits] <xfce4-settings:bluesabre/display-settings> Beginning randr stuff for left/right.
Sean Davis
noreply at xfce.org
Wed Sep 26 15:26:01 CEST 2012
Updating branch refs/heads/bluesabre/display-settings
to c53592d5473c0315465c90a67a0171008c85cec3 (commit)
from 623f6fab576e65c9a51e9ea541d03b83a120174f (commit)
commit c53592d5473c0315465c90a67a0171008c85cec3
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Wed Sep 26 09:25:08 2012 -0400
Beginning randr stuff for left/right.
dialogs/display-settings/main.c | 57 ++++++++++++++++++++++++++++++++++++---
1 files changed, 53 insertions(+), 4 deletions(-)
diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index fccc3e0..2d77156 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -141,7 +141,23 @@ display_settings_get_n_active_outputs (void)
return count;
}
+static gboolean
+display_setting_combo_box_get_str (GtkComboBox *combobox,
+ gchar **str)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ if (gtk_combo_box_get_active_iter (combobox, &iter))
+ {
+ model = gtk_combo_box_get_model (combobox);
+ gtk_tree_model_get (model, &iter, COLUMN_COMBO_VALUE, str, -1);
+
+ return TRUE;
+ }
+ return FALSE;
+}
static gboolean
display_setting_combo_box_get_value (GtkComboBox *combobox,
@@ -249,10 +265,45 @@ static void
display_setting_positions_changed (GtkComboBox *combobox,
GtkBuilder *builder)
{
- gint value;
+ /* This part is incomplete. We should check if the display combobox is
+ also already selected, then move on with working with the specific
+ displays. */
+ RRMode old_mode;
+ gchar *value;
- if (!display_setting_combo_box_get_value (combobox, &value))
+ if (!display_setting_combo_box_get_str (combobox, &value))
return;
+
+ /* Extend Left */
+ if (g_strcmp0(value, "left") == 0)
+ {
+
+ }
+
+ /* Extend Right */
+ if (g_strcmp0(value, "right") == 0)
+ {
+
+ }
+
+ /* Set new resolution */
+ old_mode = XFCE_RANDR_MODE (xfce_randr);
+ //XFCE_RANDR_MODE (xfce_randr) = value;
+
+ /* Apply the changes */
+ xfce_randr_save_output (xfce_randr, "Default", display_channel,
+ xfce_randr->active_output);
+ xfce_randr_apply (xfce_randr, "Default", display_channel);
+
+ /* Ask user confirmation */
+ if (!display_setting_timed_confirmation (builder))
+ {
+ XFCE_RANDR_MODE (xfce_randr) = old_mode;
+ xfce_randr_save_output (xfce_randr, "Default", display_channel,
+ xfce_randr->active_output);
+ xfce_randr_apply (xfce_randr, "Default", display_channel);
+ }
+
}
static void
@@ -646,8 +697,6 @@ display_setting_refresh_rates_populate (GtkBuilder *builder)
g_signal_connect (G_OBJECT (combobox), "changed", G_CALLBACK (display_setting_refresh_rates_changed), builder);
}
-
-
static void
display_setting_resolutions_changed (GtkComboBox *combobox,
GtkBuilder *builder)
More information about the Xfce4-commits
mailing list