mousetweaks r55 - in trunk: . src



Author: gerdk
Date: Mon Feb  4 18:45:53 2008
New Revision: 55
URL: http://svn.gnome.org/viewvc/mousetweaks?rev=55&view=rev

Log:
2008-02-04 Gerd Kohlberger <gerdk svn gnome org>
	* src/mt-main.c: Improve --shutdown handling.



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

Modified: trunk/src/mt-main.c
==============================================================================
--- trunk/src/mt-main.c	(original)
+++ trunk/src/mt-main.c	Mon Feb  4 18:45:53 2008
@@ -42,8 +42,6 @@
 
 static int fixes_event_base = 0;
 
-static volatile gboolean shutdown = FALSE;
-
 static void
 mt_cursor_set (GdkCursorType type)
 {
@@ -232,9 +230,6 @@
 {
     MTClosure *mt = (MTClosure *) data;
 
-    if (shutdown)
-	spi_shutdown ();
-
     if (mt->dwell_enabled)
 	if (!within_tolerance (mt, event->detail1, event->detail2))
 	    if (!mt->dwell_gesture_started) {
@@ -299,19 +294,13 @@
 void
 spi_shutdown (void)
 {
-    SPI_deregisterGlobalEventListener (motion_listener, "mouse:abs");
-    AccessibleEventListener_unref (motion_listener);
-
-    SPI_deregisterDeviceEventListener (button_listener, NULL);
-    AccessibleDeviceListener_unref (button_listener);
-
     SPI_event_quit ();
 }
 
 static void
 signal_handler (int sig)
 {
-    shutdown = TRUE;
+    spi_shutdown ();
 }
 
 static void
@@ -506,10 +495,6 @@
 	    goto FINISH;
 	}
 
-	mt->conn = mt_dbus_init (mt);
-	if (!mt->conn)
-	    goto CLEANUP;
-
 	mt_session_init ();
 
 	/* listen for cursor changes */
@@ -536,6 +521,10 @@
 					 SPI_BUTTON_RELEASED,
 					 NULL);
 
+	mt->conn = mt_dbus_init (mt);
+	if (!mt->conn)
+	    goto CLEANUP;
+
 	/* command-line options */
 	if (enable) {
 	    if (g_str_equal (enable, "dwell")) {
@@ -582,6 +571,8 @@
     }
 
 CLEANUP:
+    AccessibleEventListener_unref (motion_listener);
+    AccessibleDeviceListener_unref (button_listener);
     SPI_exit ();
     mt_closure_free (mt);
     g_object_unref (program);



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