patch to fix "broken" mouse after exit

Oskar Liljeblad oskar at osk.mine.nu
Sun Sep 8 11:27:16 UTC 2002


Oops, I forgot to attach the patch :)

Oskar Liljeblad (oskar at osk.mine.nu)
-------------- next part --------------
diff -ruN mc-4.6.0-pre1a/src/key.c mc-4.6.0-pre1a-oskar2/src/key.c
--- mc-4.6.0-pre1a/src/key.c	2002-09-04 05:16:27.000000000 +0200
+++ mc-4.6.0-pre1a-oskar2/src/key.c	2002-09-08 13:16:01.000000000 +0200
@@ -714,13 +714,13 @@
 	maxfdp = max (add_selects (&select_set), input_fd);
 
 #ifdef HAVE_LIBGPM
-	if (gpm_fd == -1) {
-	    /* Connection to gpm broken, possibly gpm has died */
-	    mouse_enabled = 0;
-	    use_mouse_p = MOUSE_NONE;
-	    break;
-	}
 	if (use_mouse_p == MOUSE_GPM) {
+	    if (gpm_fd == -1) {
+		/* Connection to gpm broken, possibly gpm has died */
+		mouse_enabled = 0;
+		use_mouse_p = MOUSE_NONE;
+		break;
+	    }
 	    FD_SET (gpm_fd, &select_set);
 	    maxfdp = max (maxfdp, gpm_fd);
 	}
diff -ruN mc-4.6.0-pre1a/src/layout.c mc-4.6.0-pre1a-oskar2/src/layout.c
--- mc-4.6.0-pre1a/src/layout.c	2002-09-03 09:45:31.000000000 +0200
+++ mc-4.6.0-pre1a-oskar2/src/layout.c	2002-09-08 13:19:55.000000000 +0200
@@ -615,7 +615,6 @@
 	clr_scr ();                                                             
     reset_shell_mode ();                                                        
     mc_noraw_mode ();                                                           
-    disable_mouse ();                                                          
     keypad (stdscr, FALSE);                                                     
 }                                                                               
 
diff -ruN mc-4.6.0-pre1a/src/main.c mc-4.6.0-pre1a-oskar2/src/main.c
--- mc-4.6.0-pre1a/src/main.c	2002-09-05 08:59:17.000000000 +0200
+++ mc-4.6.0-pre1a-oskar2/src/main.c	2002-09-08 13:20:14.000000000 +0200
@@ -1621,6 +1621,8 @@
 
 static void done_mc (void)
 {
+    disable_mouse ();
+
     done_menu ();
     
     /* Setup shutdown


More information about the mc-devel mailing list