summaryrefslogtreecommitdiff
path: root/gnome-settings-daemon
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2002-07-28 19:09:02 +0000
committerMark McLoughlin <mmclouglin@src.gnome.org>2002-07-28 19:09:02 +0000
commit13e1dd836d1ea6fef147cdce639be912e4dfc81a (patch)
tree6ac95f3caa26860ddc2c1340409f6525665a5271 /gnome-settings-daemon
parent73b80d87c799f6168dbdc33591cb617047cdabef (diff)
downloadgnome-control-center-13e1dd836d1ea6fef147cdce639be912e4dfc81a.tar.gz
add check for gtk+ with multihead support and define HAVE_GTK_MULTIHEAD if
2002-07-27 Mark McLoughlin <mark@skynet.ie> * configure.in: add check for gtk+ with multihead support and define HAVE_GTK_MULTIHEAD if found. 2002-07-27 Mark McLoughlin <mark@skynet.ie> Add support for rendering the wallpaper on a particular physical screen. * applier.[ch]: (bg_applier_init): init screen and root_window. (bg_applier_class_init), (bg_applier_set_prop), (bg_applier_get_prop): add "screen" property. (bg_applier_new_for_screen): implement. (render_wallpaper), (render_to_screen), (create_pixmap), (wallpaper_full_cover_p): use the screen and root window information. (make_root_pixmap): add a GdkScreen arg, actually use the display we opened, use the correct root window and not the default one (set_root_pixmap): add a GdkScreen arg, use the default display, use the correct root window.
Diffstat (limited to 'gnome-settings-daemon')
-rw-r--r--gnome-settings-daemon/gnome-settings-background.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/gnome-settings-daemon/gnome-settings-background.c b/gnome-settings-daemon/gnome-settings-background.c
index cf4a7e22e..269b90498 100644
--- a/gnome-settings-daemon/gnome-settings-background.c
+++ b/gnome-settings-daemon/gnome-settings-background.c
@@ -36,20 +36,54 @@
#include "preferences.h"
#include "applier.h"
+#ifdef HAVE_GTK_MULTIHEAD
+static BGApplier **bg_appliers;
+#else
static BGApplier *bg_applier;
+#endif
static BGPreferences *prefs;
static void
background_callback (GConfEntry *entry)
{
+#ifdef HAVE_GTK_MULTIHEAD
+ int i;
+#endif
+
bg_preferences_merge_entry (prefs, entry);
+
+#ifdef HAVE_GTK_MULTIHEAD
+ for (i = 0; bg_appliers [i]; i++)
+ bg_applier_apply_prefs (bg_appliers [i], prefs);
+#else
bg_applier_apply_prefs (bg_applier, prefs);
+#endif
}
void
gnome_settings_background_init (GConfClient *client)
{
+#ifdef HAVE_GTK_MULTIHEAD
+ GdkDisplay *display;
+ int n_screens;
+ int i;
+
+ display = gdk_display_get_default ();
+ n_screens = gdk_display_get_n_screens (display);
+
+ bg_appliers = g_new (BGApplier *, n_screens + 1);
+
+ for (i = 0; i < n_screens; i++) {
+ GdkScreen *screen;
+
+ screen = gdk_display_get_screen (display, i);
+
+ bg_appliers [i] = BG_APPLIER (bg_applier_new_for_screen (BG_APPLIER_ROOT, screen));
+ }
+ bg_appliers [i] = NULL;
+#else
bg_applier = BG_APPLIER (bg_applier_new (BG_APPLIER_ROOT));
+#endif
prefs = BG_PREFERENCES (bg_preferences_new ());
bg_preferences_load (prefs);
@@ -60,6 +94,10 @@ gnome_settings_background_init (GConfClient *client)
void
gnome_settings_background_load (GConfClient *client)
{
+#ifdef HAVE_GTK_MULTIHEAD
+ int i;
+#endif
+
/* If this is set, nautilus will draw the background and is
* almost definitely in our session. however, it may not be
* running yet (so is_nautilus_running() will fail). so, on
@@ -71,5 +109,10 @@ gnome_settings_background_load (GConfClient *client)
if (gconf_client_get_bool (client, "/apps/nautilus/preferences/show_desktop", NULL))
return;
+#ifdef HAVE_GTK_MULTIHEAD
+ for (i = 0; bg_appliers [i]; i++)
+ bg_applier_apply_prefs (bg_appliers [i], prefs);
+#else
bg_applier_apply_prefs (bg_applier, prefs);
+#endif
}