2001-12-09 18:50:32 +00:00
|
|
|
/*
|
2007-06-22 11:48:14 +00:00
|
|
|
* Copyright © 2001, 2007 Red Hat, Inc.
|
2001-12-09 18:50:32 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
* documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
* the above copyright notice appear in all copies and that both that
|
|
|
|
* copyright notice and this permission notice appear in supporting
|
|
|
|
* documentation, and that the name of Red Hat not be used in advertising or
|
|
|
|
* publicity pertaining to distribution of the software without specific,
|
|
|
|
* written prior permission. Red Hat makes no representations about the
|
|
|
|
* suitability of this software for any purpose. It is provided "as is"
|
|
|
|
* without express or implied warranty.
|
|
|
|
*
|
|
|
|
* RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
|
|
|
|
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
2007-08-17 19:02:13 +00:00
|
|
|
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
2001-12-09 18:50:32 +00:00
|
|
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*
|
2007-06-22 11:48:14 +00:00
|
|
|
* Authors: Owen Taylor, Havoc Pennington, Ray Strode, Rodrigo Moya
|
2001-12-09 18:50:32 +00:00
|
|
|
*/
|
2005-05-22 15:46:45 +00:00
|
|
|
#include <config.h>
|
2001-12-09 18:50:32 +00:00
|
|
|
|
|
|
|
#include <gdk/gdkx.h>
|
2005-05-22 15:46:45 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-12-09 18:50:32 +00:00
|
|
|
#include <gconf/gconf.h>
|
2002-01-08 14:54:35 +00:00
|
|
|
#include <libgnome/gnome-init.h>
|
|
|
|
#include <libgnomeui/gnome-ui-init.h>
|
2003-02-06 21:47:00 +00:00
|
|
|
|
2001-12-09 18:50:32 +00:00
|
|
|
#include "xsettings-manager.h"
|
|
|
|
#include "gnome-settings-daemon.h"
|
2007-05-08 10:51:22 +00:00
|
|
|
#include "gnome-settings-module.h"
|
2001-12-20 20:20:03 +00:00
|
|
|
|
2002-03-11 01:44:03 +00:00
|
|
|
struct _GnomeSettingsDaemonPrivate {
|
2007-08-17 19:02:13 +00:00
|
|
|
GSList *loaded_modules;
|
2007-06-22 11:48:14 +00:00
|
|
|
GObject *dbus_service;
|
2002-03-11 01:44:03 +00:00
|
|
|
};
|
|
|
|
|
2007-06-21 12:19:06 +00:00
|
|
|
GType gnome_settings_module_accessibility_keyboard_get_type (void);
|
2007-05-17 09:00:56 +00:00
|
|
|
GType gnome_settings_module_background_get_type (void);
|
|
|
|
GType gnome_settings_module_clipboard_get_type (void);
|
2007-06-06 11:51:40 +00:00
|
|
|
GType gnome_settings_module_default_editor_get_type (void);
|
2007-06-05 15:45:16 +00:00
|
|
|
GType gnome_settings_module_font_get_type (void);
|
2007-06-06 11:51:40 +00:00
|
|
|
GType gnome_settings_module_gtk1_get_type (void);
|
2007-06-21 12:19:06 +00:00
|
|
|
GType gnome_settings_module_keybindings_get_type (void);
|
|
|
|
GType gnome_settings_module_keyboard_get_type (void);
|
2007-06-06 11:51:40 +00:00
|
|
|
GType gnome_settings_module_mouse_get_type (void);
|
2007-06-21 12:19:06 +00:00
|
|
|
GType gnome_settings_module_multimedia_keys_get_type (void);
|
2007-05-17 09:00:56 +00:00
|
|
|
GType gnome_settings_module_screensaver_get_type (void);
|
2007-06-06 11:51:40 +00:00
|
|
|
GType gnome_settings_module_sound_get_type (void);
|
2007-06-18 20:50:39 +00:00
|
|
|
GType gnome_settings_module_typing_break_get_type (void);
|
2007-06-21 12:19:06 +00:00
|
|
|
GType gnome_settings_module_xrdb_get_type (void);
|
2007-06-06 11:51:40 +00:00
|
|
|
GType gnome_settings_module_xsettings_get_type (void);
|
2007-05-17 09:00:56 +00:00
|
|
|
|
2007-06-22 11:48:14 +00:00
|
|
|
static GObject *parent_class = NULL;
|
2002-11-08 03:26:33 +00:00
|
|
|
XSettingsManager **managers = NULL;
|
2005-06-03 08:29:45 +00:00
|
|
|
|
2001-12-09 18:50:32 +00:00
|
|
|
static void
|
|
|
|
terminate_cb (void *data)
|
|
|
|
{
|
2007-05-08 10:51:22 +00:00
|
|
|
gboolean *terminated = data;
|
2002-11-08 03:26:33 +00:00
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
if (*terminated)
|
|
|
|
return;
|
2007-08-17 19:02:13 +00:00
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
*terminated = TRUE;
|
|
|
|
gtk_main_quit ();
|
2001-12-09 18:50:32 +00:00
|
|
|
}
|
|
|
|
|
2007-08-17 19:02:13 +00:00
|
|
|
static GdkFilterReturn
|
2001-12-09 18:50:32 +00:00
|
|
|
manager_event_filter (GdkXEvent *xevent,
|
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2007-05-08 10:51:22 +00:00
|
|
|
int screen_num = GPOINTER_TO_INT (data);
|
2002-11-08 03:26:33 +00:00
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
g_return_val_if_fail (managers != NULL, GDK_FILTER_CONTINUE);
|
2002-11-08 03:26:33 +00:00
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
if (xsettings_manager_process_event (managers [screen_num], (XEvent *)xevent))
|
|
|
|
return GDK_FILTER_REMOVE;
|
|
|
|
else
|
|
|
|
return GDK_FILTER_CONTINUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
initialize_modules (GnomeSettingsDaemon *daemon, GnomeSettingsModuleRunlevel runlevel)
|
|
|
|
{
|
|
|
|
GConfClient *client;
|
2007-08-17 19:02:13 +00:00
|
|
|
GSList *l;
|
2007-05-08 10:51:22 +00:00
|
|
|
|
|
|
|
client = gnome_settings_get_config_client ();
|
|
|
|
|
2007-08-17 19:02:13 +00:00
|
|
|
for (l = daemon->priv->loaded_modules; l != NULL; l = l->next) {
|
|
|
|
GnomeSettingsModule *module = (GnomeSettingsModule *) l->data;
|
|
|
|
|
|
|
|
if (gnome_settings_module_get_runlevel (module) == runlevel &&
|
|
|
|
!gnome_settings_module_initialize (module, client))
|
|
|
|
g_warning ("Module %s could not be initialized", G_OBJECT_TYPE_NAME (module));
|
2007-05-08 10:51:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
start_modules (GnomeSettingsDaemon *daemon, GnomeSettingsModuleRunlevel runlevel)
|
|
|
|
{
|
2007-08-17 19:02:13 +00:00
|
|
|
GSList *l;
|
|
|
|
|
|
|
|
for (l = daemon->priv->loaded_modules; l != NULL; l = l->next) {
|
|
|
|
GnomeSettingsModule *module = (GnomeSettingsModule *) l->data;
|
2007-05-08 10:51:22 +00:00
|
|
|
|
2007-08-17 19:02:13 +00:00
|
|
|
if (gnome_settings_module_get_runlevel (module) == runlevel &&
|
|
|
|
!gnome_settings_module_start (module))
|
|
|
|
g_warning ("Module %s could not be started", G_OBJECT_TYPE_NAME (module));
|
2007-06-20 11:07:32 +00:00
|
|
|
}
|
2007-05-08 10:51:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
stop_modules (GnomeSettingsDaemon *daemon, GnomeSettingsModuleRunlevel runlevel)
|
|
|
|
{
|
2007-08-17 19:02:13 +00:00
|
|
|
GSList *l;
|
2007-05-08 10:51:22 +00:00
|
|
|
|
2007-08-17 19:02:13 +00:00
|
|
|
for (l = daemon->priv->loaded_modules; l != NULL; l = l->next) {
|
|
|
|
GnomeSettingsModule *module = (GnomeSettingsModule *) l->data;
|
|
|
|
|
|
|
|
if (gnome_settings_module_get_runlevel (module) == runlevel)
|
|
|
|
gnome_settings_module_stop (module);
|
|
|
|
}
|
2001-12-09 18:50:32 +00:00
|
|
|
}
|
|
|
|
|
2002-03-11 01:44:03 +00:00
|
|
|
static void
|
|
|
|
finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GnomeSettingsDaemon *daemon;
|
2007-05-08 10:51:22 +00:00
|
|
|
int i;
|
2002-03-11 01:44:03 +00:00
|
|
|
|
|
|
|
daemon = GNOME_SETTINGS_DAEMON (object);
|
2007-05-08 10:51:22 +00:00
|
|
|
if (daemon->priv == NULL)
|
|
|
|
return;
|
2002-03-11 01:44:03 +00:00
|
|
|
|
2002-11-08 03:26:33 +00:00
|
|
|
for (i = 0; managers && managers [i]; i++)
|
|
|
|
xsettings_manager_destroy (managers [i]);
|
2002-03-11 01:44:03 +00:00
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
if (daemon->priv->loaded_modules) {
|
|
|
|
/* call _stop method on modules, in runlevel-descending order */
|
|
|
|
stop_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_SERVICES);
|
|
|
|
stop_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_CORE_SERVICES);
|
|
|
|
stop_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_GNOME_SETTINGS);
|
|
|
|
stop_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_XSETTINGS);
|
|
|
|
|
2007-08-17 19:02:13 +00:00
|
|
|
g_slist_foreach (daemon->priv->loaded_modules, (GFunc) g_object_unref, NULL);
|
|
|
|
g_slist_free (daemon->priv->loaded_modules);
|
2007-05-08 10:51:22 +00:00
|
|
|
daemon->priv->loaded_modules = NULL;
|
|
|
|
}
|
|
|
|
|
2007-06-22 11:48:14 +00:00
|
|
|
g_object_unref (daemon->priv->dbus_service);
|
2007-05-08 10:51:22 +00:00
|
|
|
g_free (daemon->priv);
|
|
|
|
daemon->priv = NULL;
|
2002-03-11 01:44:03 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gnome_settings_daemon_class_init (GnomeSettingsDaemonClass *klass)
|
|
|
|
{
|
2007-05-08 10:51:22 +00:00
|
|
|
GObjectClass *object_class;
|
2002-03-11 01:44:03 +00:00
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
object_class = G_OBJECT_CLASS (klass);
|
2002-03-11 01:44:03 +00:00
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
object_class->finalize = finalize;
|
2002-03-11 01:44:03 +00:00
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2002-03-11 01:44:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gnome_settings_daemon_init (GnomeSettingsDaemon *settings)
|
|
|
|
{
|
2007-05-08 10:51:22 +00:00
|
|
|
GType *module_types;
|
|
|
|
guint n_children;
|
|
|
|
|
2007-08-17 19:02:13 +00:00
|
|
|
settings->priv = g_new0 (GnomeSettingsDaemonPrivate, 1);
|
2007-05-08 10:51:22 +00:00
|
|
|
|
|
|
|
/* register all internal modules types */
|
2007-06-21 12:19:06 +00:00
|
|
|
if (!gnome_settings_module_accessibility_keyboard_get_type ()
|
|
|
|
|| !gnome_settings_module_background_get_type ()
|
2007-05-09 15:51:40 +00:00
|
|
|
|| !gnome_settings_module_clipboard_get_type ()
|
2007-06-06 11:51:40 +00:00
|
|
|
|| !gnome_settings_module_default_editor_get_type ()
|
2007-06-05 15:45:16 +00:00
|
|
|
|| !gnome_settings_module_font_get_type ()
|
2007-06-06 11:51:40 +00:00
|
|
|
|| !gnome_settings_module_gtk1_get_type ()
|
2007-06-21 12:19:06 +00:00
|
|
|
|| !gnome_settings_module_keybindings_get_type ()
|
|
|
|
|| !gnome_settings_module_keyboard_get_type ()
|
2007-06-06 11:51:40 +00:00
|
|
|
|| !gnome_settings_module_mouse_get_type ()
|
2007-06-21 12:19:06 +00:00
|
|
|
|| !gnome_settings_module_multimedia_keys_get_type ()
|
2007-06-06 11:51:40 +00:00
|
|
|
|| !gnome_settings_module_screensaver_get_type ()
|
|
|
|
|| !gnome_settings_module_sound_get_type ()
|
2007-06-18 20:50:39 +00:00
|
|
|
|| !gnome_settings_module_typing_break_get_type ()
|
2007-06-21 12:19:06 +00:00
|
|
|
|| !gnome_settings_module_xrdb_get_type ()
|
2007-06-06 11:51:40 +00:00
|
|
|
|| !gnome_settings_module_xsettings_get_type ())
|
2007-05-08 10:51:22 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
module_types = g_type_children (GNOME_SETTINGS_TYPE_MODULE, &n_children);
|
|
|
|
if (module_types) {
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
for (i = 0; i < n_children; i++) {
|
|
|
|
GObject *module;
|
|
|
|
|
|
|
|
module = g_object_new (module_types[i], NULL);
|
|
|
|
if (!module)
|
|
|
|
continue;
|
|
|
|
|
2007-08-17 19:02:13 +00:00
|
|
|
settings->priv->loaded_modules =
|
|
|
|
g_slist_append (settings->priv->loaded_modules, module);
|
2007-05-08 10:51:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free (module_types);
|
|
|
|
}
|
2007-06-22 11:48:14 +00:00
|
|
|
|
|
|
|
/* create DBus server */
|
2007-08-17 19:02:13 +00:00
|
|
|
settings->priv->dbus_service = g_object_new (gnome_settings_server_get_type (), NULL);
|
2002-03-11 01:44:03 +00:00
|
|
|
}
|
|
|
|
|
2007-05-08 10:51:22 +00:00
|
|
|
G_DEFINE_TYPE (GnomeSettingsDaemon, gnome_settings_daemon, G_TYPE_OBJECT)
|
2002-03-11 01:44:03 +00:00
|
|
|
|
2007-06-22 11:48:14 +00:00
|
|
|
static gboolean
|
|
|
|
start_modules_idle_cb (gpointer user_data)
|
|
|
|
{
|
|
|
|
GnomeSettingsDaemon *daemon = user_data;
|
|
|
|
|
|
|
|
/* start all modules */
|
|
|
|
start_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_XSETTINGS);
|
|
|
|
start_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_GNOME_SETTINGS);
|
|
|
|
start_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_CORE_SERVICES);
|
|
|
|
start_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_SERVICES);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
init_modules_idle_cb (gpointer user_data)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int n_screens;
|
|
|
|
GdkDisplay *display;
|
|
|
|
GnomeSettingsDaemon *daemon = user_data;
|
|
|
|
|
|
|
|
display = gdk_display_get_default ();
|
|
|
|
n_screens = gdk_display_get_n_screens (display);
|
|
|
|
|
|
|
|
/* load all modules */
|
|
|
|
initialize_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_XSETTINGS);
|
|
|
|
initialize_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_GNOME_SETTINGS);
|
|
|
|
initialize_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_CORE_SERVICES);
|
|
|
|
initialize_modules (daemon, GNOME_SETTINGS_MODULE_RUNLEVEL_SERVICES);
|
|
|
|
|
|
|
|
for (i = 0; i < n_screens; i++) {
|
|
|
|
GdkScreen *screen;
|
|
|
|
|
|
|
|
screen = gdk_display_get_screen (display, i);
|
|
|
|
gdk_window_add_filter (
|
|
|
|
gdk_screen_get_root_window (screen),
|
|
|
|
manager_event_filter, GINT_TO_POINTER (i));
|
|
|
|
}
|
|
|
|
|
|
|
|
g_idle_add ((GSourceFunc) start_modules_idle_cb, daemon);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-03-11 01:44:03 +00:00
|
|
|
GObject *
|
|
|
|
gnome_settings_daemon_new (void)
|
2001-12-09 18:50:32 +00:00
|
|
|
{
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
gboolean terminated = FALSE;
|
|
|
|
GnomeSettingsDaemon *daemon;
|
|
|
|
GdkDisplay *display;
|
|
|
|
int i;
|
|
|
|
int n_screens;
|
2002-11-08 03:26:33 +00:00
|
|
|
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
display = gdk_display_get_default ();
|
|
|
|
n_screens = gdk_display_get_n_screens (display);
|
2002-03-06 18:17:33 +00:00
|
|
|
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
daemon = g_object_new (gnome_settings_daemon_get_type (), NULL);
|
2002-01-08 14:54:35 +00:00
|
|
|
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
if (xsettings_manager_check_running (
|
|
|
|
gdk_x11_display_get_xdisplay (display),
|
|
|
|
gdk_screen_get_number (gdk_screen_get_default ()))) {
|
2007-08-17 19:02:13 +00:00
|
|
|
g_error ("You can only run one xsettings manager at a time; exiting\n");
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2007-08-17 19:02:13 +00:00
|
|
|
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
if (!terminated) {
|
|
|
|
managers = g_new (XSettingsManager *, n_screens + 1);
|
2002-11-08 03:26:33 +00:00
|
|
|
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
for (i = 0; i < n_screens; i++) {
|
|
|
|
GdkScreen *screen;
|
2002-11-08 03:26:33 +00:00
|
|
|
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
screen = gdk_display_get_screen (display, i);
|
2002-11-08 03:26:33 +00:00
|
|
|
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
managers [i] = xsettings_manager_new (
|
2002-11-08 03:26:33 +00:00
|
|
|
gdk_x11_display_get_xdisplay (display),
|
|
|
|
gdk_screen_get_number (screen),
|
|
|
|
terminate_cb, &terminated);
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
if (!managers [i]) {
|
2007-08-17 19:02:13 +00:00
|
|
|
g_error ("Could not create xsettings manager for screen %d!\n", i);
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
managers [i] = NULL;
|
2003-02-06 21:47:00 +00:00
|
|
|
}
|
|
|
|
|
2007-06-22 11:48:14 +00:00
|
|
|
g_idle_add ((GSourceFunc) init_modules_idle_cb, daemon);
|
return NULL when there is an error, not exit(), so that we do proper
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
svn path=/trunk/; revision=7434
2007-04-02 15:27:35 +00:00
|
|
|
|
|
|
|
return G_OBJECT (daemon);
|
declare a global GConfClient. (main): unref the global GConfClient.
2005-10-16 Rodrigo Moya <rodrigo@novell.com>
* factory.c: declare a global GConfClient.
(main): unref the global GConfClient.
* gnome-settings-daemon.[ch] (gnome_settings_daemon_get_conf_client):
new function to use the same GConfClient everywhere.
(gnome_settings_daemon_new): use the global GConfClient.
* gnome-settings-accessibility-keyboard.c (set_server_from_gconf,
ax_response_callback, set_gconf_from_server):
* gnome-settings-gtk1theme.c (apply_settings):
* gnome-settings-keybindings.c (bindings_get_entry):
* gnome-settings-keyboard.c (numlock_get_gconf_state,
numlock_set_gconf_state, apply_settings):
* gnome-settings-keyboard-xkb.c (apply_xkb_settings,
gnome_settings_keyboard_xkb_sysconfig_changed_response,
gnome_settings_keyboard_xkb_analyze_sysconfig,
gnome_settings_chk_file_list):
* gnome-settings-screensaver.c (key_toggled_cb,
really_start_screensaver):
* gnome-settings-sound.c (apply_settings):
* gnome-settings-xmodmap.c (check_button_callback,
gnome_settings_load_modmap_files, remove_button_clicked_callback,
load_button_clicked_callback, gnome_settings_modmap_dialog_call):
* gnome-settings-xsettings.c (xft_callback):
use the global GConfClient.
* gnome-settings-keyboard-xkb.c (gnome_settings_keyboard_xkb_load):
don't get another GConfClient when we're getting one passed!
2005-10-17 14:53:19 +00:00
|
|
|
}
|