2005-05-22 Sebastien Bacher <seb128@debian.org> * ChangeLog capplets/about-me/e-image-chooser.c capplets/accessibility/at-properties/at-startup-session.h capplets/accessibility/keyboard/accessibility-keyboard.c capplets/background/gnome-wp-info.c capplets/common/gconf-property-editor.c capplets/common/gnome-theme-apply.c capplets/default-applications/gnome-default-applications-properties.c capplets/keybindings/gnome-keybinding-properties.c capplets/keyboard/gnome-keyboard-properties.c capplets/mouse/gnome-mouse-properties.c capplets/network/gnome-network-preferences.c capplets/sound/sound-properties-capplet.c capplets/theme-switcher/gnome-theme-details.c capplets/theme-switcher/gnome-theme-manager.c capplets/ui-properties/gnome-ui-properties.c capplets/windows/gnome-window-properties.c gnome-settings-daemon/factory.c gnome-settings-daemon/gnome-settings-accessibility-keyboard.c gnome-settings-daemon/gnome-settings-background.c gnome-settings-daemon/gnome-settings-daemon.c gnome-settings-daemon/gnome-settings-daemon.h gnome-settings-daemon/gnome-settings-font.c gnome-settings-daemon/gnome-settings-keybindings.c gnome-settings-daemon/gnome-settings-keybindings.h gnome-settings-daemon/gnome-settings-keyboard-xkb.c gnome-settings-daemon/gnome-settings-keyboard.c gnome-settings-daemon/gnome-settings-locate-pointer.h gnome-settings-daemon/gnome-settings-mouse.c gnome-settings-daemon/gnome-settings-multimedia-keys.c gnome-settings-daemon/gnome-settings-screensaver.c gnome-settings-daemon/gnome-settings-sound.c gnome-settings-daemon/gnome-settings-xmodmap.c gnome-settings-daemon/gnome-settings-xrdb.c gnome-settings-daemon/gnome-settings-xsettings.c libbackground/applier.c libbackground/applier.h libbackground/preferences.c libsounds/sound-properties.c libsounds/sound-view.h libwindow-settings/gnome-wm-manager.c libwindow-settings/metacity-window-manager.c typing-break/drw-break-window.c typing-break/drw-utils.h typing-break/drwright.c vfs-methods/fontilus/font-view.c vfs-methods/themus/themus-theme-applier.c: Cleanup of gconf and a few other things, patch from Kjartan Maraas <kmaraas@gnome.org> (Closes: #301945).
112 lines
2.9 KiB
C
112 lines
2.9 KiB
C
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
/* -*- mode: c; style: linux -*- */
|
|
|
|
/* gnome-settings-background.c
|
|
*
|
|
* Copyright © 2001 Ximian, Inc.
|
|
*
|
|
* Written by Bradford Hovinen <hovinen@ximian.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
* 02111-1307, USA.
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
# include "config.h"
|
|
#endif
|
|
|
|
#include <gdk/gdk.h>
|
|
#include <gdk/gdkx.h>
|
|
#include <gconf/gconf.h>
|
|
|
|
#include "gnome-settings-keyboard.h"
|
|
#include "gnome-settings-daemon.h"
|
|
|
|
#include "preferences.h"
|
|
#include "applier.h"
|
|
|
|
static BGApplier **bg_appliers;
|
|
static BGPreferences *prefs;
|
|
|
|
static guint applier_idle_id = 0;
|
|
|
|
static gboolean
|
|
applier_idle (gpointer data)
|
|
{
|
|
int i;
|
|
for (i = 0; bg_appliers [i]; i++)
|
|
bg_applier_apply_prefs (bg_appliers [i], prefs);
|
|
applier_idle_id = 0;
|
|
return FALSE;
|
|
}
|
|
|
|
static void
|
|
background_callback (GConfEntry *entry)
|
|
{
|
|
bg_preferences_merge_entry (prefs, entry);
|
|
|
|
if (applier_idle_id != 0) {
|
|
g_source_remove (applier_idle_id);
|
|
}
|
|
|
|
applier_idle_id = g_timeout_add (100, applier_idle, NULL);
|
|
}
|
|
|
|
void
|
|
gnome_settings_background_init (GConfClient *client)
|
|
{
|
|
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;
|
|
|
|
prefs = BG_PREFERENCES (bg_preferences_new ());
|
|
bg_preferences_load (prefs);
|
|
|
|
gnome_settings_daemon_register_callback ("/desktop/gnome/background", background_callback);
|
|
}
|
|
|
|
void
|
|
gnome_settings_background_load (GConfClient *client)
|
|
{
|
|
int i;
|
|
|
|
/* 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
|
|
* startup, just don't do anything if this key is set so we
|
|
* don't waste time setting the background only to have
|
|
* nautilus overwrite it.
|
|
*/
|
|
|
|
if (gconf_client_get_bool (client, "/apps/nautilus/preferences/show_desktop", NULL))
|
|
return;
|
|
|
|
for (i = 0; bg_appliers [i]; i++)
|
|
bg_applier_apply_prefs (bg_appliers [i], prefs);
|
|
}
|