emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/term.c,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/term.c,v
Date: Fri, 28 Sep 2007 20:07:55 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/09/28 20:07:55

Index: term.c
===================================================================
RCS file: /sources/emacs/emacs/src/term.c,v
retrieving revision 1.205
retrieving revision 1.206
diff -u -b -r1.205 -r1.206
--- term.c      28 Sep 2007 19:47:01 -0000      1.205
+++ term.c      28 Sep 2007 20:07:54 -0000      1.206
@@ -2952,10 +2952,12 @@
        ? (f)->terminal->display_info.tty : NULL);
   Gpm_Connect connection;
 
-  if (gpm_tty)
-    error ("Gpm-mouse can only be activated for one tty at a time");
   if (!tty)
     error ("Gpm-mouse only works in the GNU/Linux console");
+  if (gpm_tty == tty)
+    return Qnil;               /* Already activated, nothing to do.  */
+  if (gpm_tty)
+    error ("Gpm-mouse can only be activated for one tty at a time");
 
   connection.eventMask = ~0;
   connection.defaultMask = ~GPM_HARD;
@@ -2983,6 +2985,14 @@
        doc: /* Close a connection to Gpm.  */)
      ()
 {
+  struct frame *f = SELECTED_FRAME ();
+  struct tty_display_info *tty
+    = ((f)->output_method == output_termcap
+       ? (f)->terminal->display_info.tty : NULL);
+
+  if (!tty || gpm_tty != tty)
+    return Qnil;       /* Not activated on this terminal, nothing to do.  */
+  
   if (gpm_fd >= 0)
     delete_gpm_wait_descriptor (gpm_fd);
   while (Gpm_Close()); /* close all the stack */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]