mousetweaks r142 - in trunk: . src



Author: gerdk
Date: Thu Apr 17 15:01:16 2008
New Revision: 142
URL: http://svn.gnome.org/viewvc/mousetweaks?rev=142&view=rev

Log:
2008-04-17 Gerd Kohlberger <gerdk svn gnome org>

	* src/mt-main.c:
	* src/mt-cusor-manager.c:
	Handle cursor theme changes correctly.



Modified:
   trunk/ChangeLog
   trunk/src/mt-cursor-manager.c
   trunk/src/mt-main.c

Modified: trunk/src/mt-cursor-manager.c
==============================================================================
--- trunk/src/mt-cursor-manager.c	(original)
+++ trunk/src/mt-cursor-manager.c	Thu Apr 17 15:01:16 2008
@@ -39,6 +39,7 @@
 
 enum {
     CURSOR_CHANGED,
+    CACHE_CLEARED,
     LAST_SIGNAL
 };
 
@@ -65,6 +66,14 @@
 		      g_cclosure_marshal_VOID__STRING,
 		      G_TYPE_NONE, 1, G_TYPE_STRING);
 
+    signals[CACHE_CLEARED] =
+	g_signal_new (g_intern_static_string ("cache_cleared"),
+		      G_OBJECT_CLASS_TYPE (klass),
+		      G_SIGNAL_RUN_LAST,
+		      0, NULL, NULL,
+		      g_cclosure_marshal_VOID__VOID,
+		      G_TYPE_NONE, 0);
+
     g_type_class_add_private (klass, sizeof (MtCursorManagerPrivate));
 }
 
@@ -189,11 +198,13 @@
     return GDK_FILTER_CONTINUE;
 }
 
+static void
 _clear_cursor_cache (GObject    *settings,
 		     GParamSpec *pspec,
 		     gpointer    data)
 {
     mt_cursor_manager_clear_cache (data);
+    g_signal_emit (data, signals[CACHE_CLEARED], 0);
 }
 
 static MtCursorManager *
@@ -249,7 +260,6 @@
 MtCursor *
 mt_cursor_manager_current_cursor (MtCursorManager *manager)
 {
-    MtCursorManagerPrivate *priv;
     XFixesCursorImage *image;
     MtCursor *cursor;
 

Modified: trunk/src/mt-main.c
==============================================================================
--- trunk/src/mt-main.c	(original)
+++ trunk/src/mt-main.c	Thu Apr 17 15:01:16 2008
@@ -355,13 +355,20 @@
 {
     MTClosure *mt = (MTClosure *) data;
 
-    if (mt->animate_cursor &&
-	mt->cursor != NULL &&
-	mt->dwell_mode == DWELL_MODE_CTW)
+    if (mt->animate_cursor && mt->cursor != NULL)
 	mt_update_cursor (mt->cursor, timer, time);
 }
 
 static void
+cursor_cache_cleared (MtCursorManager *manager,
+		      gpointer         data)
+{
+    MTClosure *mt = (MTClosure *) data;
+
+    mt->cursor = mt_cursor_manager_current_cursor (manager);
+}
+
+static void
 cursor_changed (MtCursorManager *manager,
 		const gchar     *name,
 		gpointer         data)
@@ -635,6 +642,8 @@
 	manager = mt_cursor_manager_get_default ();
 	g_signal_connect (manager, "cursor_changed",
 			  G_CALLBACK (cursor_changed), mt);
+	g_signal_connect (manager, "cache_cleared",
+			  G_CALLBACK (cursor_cache_cleared), mt);
 
 	mt->cursor = mt_cursor_manager_current_cursor (manager);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]