gnome-settings-daemon r580 - in trunk: . plugins/clipboard plugins/mouse plugins/xsettings
- From: behdad svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-settings-daemon r580 - in trunk: . plugins/clipboard plugins/mouse plugins/xsettings
- Date: Mon, 3 Nov 2008 21:34:15 +0000 (UTC)
Author: behdad
Date: Mon Nov 3 21:34:15 2008
New Revision: 580
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=580&view=rev
Log:
2008-11-03 Behdad Esfahbod <behdad gnome org>
* plugins/clipboard/gsd-clipboard-manager.c
(start_clipboard_idle_cb), (gsd_clipboard_manager_start):
Start manager in idle callback (bug #559166)
* plugins/mouse/gsd-mouse-manager.c (gsd_mouse_manager_idle_cb),
(gsd_mouse_manager_start):
Start manager in idle callback (bug #559166)
* plugins/xsettings/fontconfig-monitor.c (fontconfig_cache_update),
(update):
* plugins/xsettings/fontconfig-monitor.h:
* plugins/xsettings/gsd-xsettings-manager.c
(start_fontconfig_monitor_idle_cb), (start_fontconfig_monitor),
(stop_fontconfig_monitor):
Start fontconfig monitors in idle callback. However, make sure
fontconfig caches are up to date during initialization (bug #559166)
Modified:
trunk/ChangeLog
trunk/plugins/clipboard/gsd-clipboard-manager.c
trunk/plugins/mouse/gsd-mouse-manager.c
trunk/plugins/xsettings/fontconfig-monitor.c
trunk/plugins/xsettings/fontconfig-monitor.h
trunk/plugins/xsettings/gsd-xsettings-manager.c
Modified: trunk/plugins/clipboard/gsd-clipboard-manager.c
==============================================================================
--- trunk/plugins/clipboard/gsd-clipboard-manager.c (original)
+++ trunk/plugins/clipboard/gsd-clipboard-manager.c Mon Nov 3 21:34:15 2008
@@ -82,13 +82,6 @@
int offset;
} IncrConversion;
-#define GSD_CLIPBOARD_ERROR gsd_clipboard_error_quark ()
-
-enum {
- GSD_CLIPBOARD_ERROR_RUNNING,
- GSD_CLIPBOARD_ERROR_FAILED
-};
-
static void gsd_clipboard_manager_class_init (GsdClipboardManagerClass *klass);
static void gsd_clipboard_manager_init (GsdClipboardManager *clipboard_manager);
static void gsd_clipboard_manager_finalize (GObject *object);
@@ -103,12 +96,6 @@
static gpointer manager_object = NULL;
-static GQuark
-gsd_clipboard_error_quark (void)
-{
- return g_quark_from_static_string ("gsd-clipboard-error-quark");
-}
-
/* We need to use reference counting for the target data, since we may
* need to keep the data around after loosing the CLIPBOARD ownership
* to complete incremental transfers.
@@ -858,22 +845,19 @@
}
}
-gboolean
-gsd_clipboard_manager_start (GsdClipboardManager *manager,
- GError **error)
+static gboolean
+start_clipboard_idle_cb (GsdClipboardManager *manager)
{
XClientMessageEvent xev;
- g_debug ("Starting clipboard manager");
+
gnome_settings_profile_start (NULL);
init_atoms (manager->priv->display);
/* check if there is a clipboard manager running */
if (XGetSelectionOwner (manager->priv->display, XA_CLIPBOARD_MANAGER)) {
- g_set_error (error, GSD_CLIPBOARD_ERROR,
- GSD_CLIPBOARD_ERROR_RUNNING,
- "Clipboard manager is already running.");
+ g_warning ("Clipboard manager is already running.");
return FALSE;
}
@@ -929,15 +913,23 @@
0,
NULL);
/* FIXME: manager->priv->terminate (manager->priv->cb_data); */
-
- g_set_error (error, GSD_CLIPBOARD_ERROR,
- GSD_CLIPBOARD_ERROR_FAILED,
- "Failed to claim selection.");
- return FALSE;
}
gnome_settings_profile_end (NULL);
+ return FALSE;
+}
+
+gboolean
+gsd_clipboard_manager_start (GsdClipboardManager *manager,
+ GError **error)
+{
+ gnome_settings_profile_start (NULL);
+
+ g_idle_add ((GSourceFunc) start_clipboard_idle_cb, manager);
+
+ gnome_settings_profile_end (NULL);
+
return TRUE;
}
Modified: trunk/plugins/mouse/gsd-mouse-manager.c
==============================================================================
--- trunk/plugins/mouse/gsd-mouse-manager.c (original)
+++ trunk/plugins/mouse/gsd-mouse-manager.c Mon Nov 3 21:34:15 2008
@@ -694,13 +694,11 @@
manager->priv = GSD_MOUSE_MANAGER_GET_PRIVATE (manager);
}
-gboolean
-gsd_mouse_manager_start (GsdMouseManager *manager,
- GError **error)
+static gboolean
+gsd_mouse_manager_idle_cb (GsdMouseManager *manager)
{
GConfClient *client;
- g_debug ("Starting mouse manager");
gnome_settings_profile_start (NULL);
client = gconf_client_get_default ();
@@ -729,6 +727,19 @@
gnome_settings_profile_end (NULL);
+ return FALSE;
+}
+
+gboolean
+gsd_mouse_manager_start (GsdMouseManager *manager,
+ GError **error)
+{
+ gnome_settings_profile_start (NULL);
+
+ g_idle_add ((GSourceFunc) gsd_mouse_manager_idle_cb, manager);
+
+ gnome_settings_profile_end (NULL);
+
return TRUE;
}
Modified: trunk/plugins/xsettings/fontconfig-monitor.c
==============================================================================
--- trunk/plugins/xsettings/fontconfig-monitor.c (original)
+++ trunk/plugins/xsettings/fontconfig-monitor.c Mon Nov 3 21:34:15 2008
@@ -33,6 +33,12 @@
GFileMonitorEvent event_type,
gpointer handle);
+gboolean
+fontconfig_cache_update (void)
+{
+ return !FcConfigUptoDate (NULL) && FcInitReinitialize ();
+}
+
static void
monitor_files (GPtrArray *monitors,
FcStrList *list,
@@ -100,7 +106,7 @@
handle->timeout = 0;
- if (!FcConfigUptoDate (NULL) && FcInitReinitialize ()) {
+ if (fontconfig_cache_update ()) {
notify = TRUE;
monitors_free (handle->monitors);
handle->monitors = monitors_create (data);
Modified: trunk/plugins/xsettings/fontconfig-monitor.h
==============================================================================
--- trunk/plugins/xsettings/fontconfig-monitor.h (original)
+++ trunk/plugins/xsettings/fontconfig-monitor.h Mon Nov 3 21:34:15 2008
@@ -25,6 +25,8 @@
G_BEGIN_DECLS
+gboolean fontconfig_cache_update (void);
+
typedef struct _fontconfig_monitor_handle fontconfig_monitor_handle_t;
fontconfig_monitor_handle_t *
Modified: trunk/plugins/xsettings/gsd-xsettings-manager.c
==============================================================================
--- trunk/plugins/xsettings/gsd-xsettings-manager.c (original)
+++ trunk/plugins/xsettings/gsd-xsettings-manager.c Mon Nov 3 21:34:15 2008
@@ -566,12 +566,26 @@
gnome_settings_profile_end (NULL);
}
+static gboolean
+start_fontconfig_monitor_idle_cb (GnomeXSettingsManager *manager)
+{
+ gnome_settings_profile_start (NULL);
+
+ manager->priv->fontconfig_handle = fontconfig_monitor_start ((GFunc) fontconfig_callback, manager);
+
+ gnome_settings_profile_end (NULL);
+
+ return FALSE;
+}
+
static void
start_fontconfig_monitor (GnomeXSettingsManager *manager)
{
gnome_settings_profile_start (NULL);
- manager->priv->fontconfig_handle = fontconfig_monitor_start ((GFunc) fontconfig_callback, manager);
+ fontconfig_cache_update ();
+
+ g_idle_add ((GSourceFunc) start_fontconfig_monitor_idle_cb, manager);
gnome_settings_profile_end (NULL);
}
@@ -579,8 +593,10 @@
static void
stop_fontconfig_monitor (GnomeXSettingsManager *manager)
{
- fontconfig_monitor_stop (manager->priv->fontconfig_handle);
- manager->priv->fontconfig_handle = NULL;
+ if (manager->priv->fontconfig_handle) {
+ fontconfig_monitor_stop (manager->priv->fontconfig_handle);
+ manager->priv->fontconfig_handle = NULL;
+ }
}
#endif /* HAVE_FONTCONFIG */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]