From 2034b88ae6a2b01a872cbc2b2eb5a520459783ea Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Thu, 9 Feb 2012 16:48:12 +0300 Subject: [PATCH] Stretch background across all monitors setting Added a 'Stretch background across all monitors.' checkbox to the xfdesktop-settings app. It will only be visible on the first monitor tab and only when multiple monitors are present. Bug 5690 --- settings/main.c | 19 +++++++++++++++++++ .../xfdesktop-settings-appearance-frame-ui.glade | 12 ++++++++++++ 2 files changed, 31 insertions(+), 0 deletions(-) diff --git a/settings/main.c b/settings/main.c index 1f76be9..718b952 100644 --- a/settings/main.c +++ b/settings/main.c @@ -103,6 +103,8 @@ typedef struct GtkWidget *brightness_slider; GtkWidget *saturation_slider; + + GtkWidget *chk_xinerama_stretch; } AppearancePanel; typedef struct @@ -1382,6 +1384,23 @@ xfdesktop_settings_dialog_add_screens(GtkBuilder *main_gxml, g_signal_connect(G_OBJECT(panel->btn_newlist), "clicked", G_CALLBACK(newlist_button_clicked), panel); + panel->chk_xinerama_stretch = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, + "chk_xinerama_stretch")); + + /* The first monitor has the option of doing the xinerama-stretch, + * but only if there's multiple monitors attached. Make it invisible + * in all other cases. + */ + if(j == 0 && nmonitors > 1) { + g_snprintf(buf, sizeof(buf), "/backdrop/screen%d/xinerama-stretch", + i); + xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN, + G_OBJECT(panel->chk_xinerama_stretch), "active"); + gtk_widget_set_sensitive(panel->chk_xinerama_stretch, TRUE); + } else { + gtk_widget_hide(panel->chk_xinerama_stretch); + } + panel->radio_singleimage = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, "radio_singleimage")); g_signal_connect(G_OBJECT(panel->radio_singleimage), "toggled", diff --git a/settings/xfdesktop-settings-appearance-frame-ui.glade b/settings/xfdesktop-settings-appearance-frame-ui.glade index 3a4fed6..d1cc799 100644 --- a/settings/xfdesktop-settings-appearance-frame-ui.glade +++ b/settings/xfdesktop-settings-appearance-frame-ui.glade @@ -528,6 +528,18 @@ 1 + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + St_retch this background across all monitors. + When multiple monitors are present, select this option to stretch the current background over all of them. + True + True + + -- 1.7.5.4