diff options
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/term.c b/src/term.c index 367040288ef..19382f9667c 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -3128,6 +3128,15 @@ Gpm-mouse can only be activated for one tty at a time. */) | |||
| 3128 | } | 3128 | } |
| 3129 | } | 3129 | } |
| 3130 | 3130 | ||
| 3131 | void | ||
| 3132 | close_gpm () | ||
| 3133 | { | ||
| 3134 | if (gpm_fd >= 0) | ||
| 3135 | delete_gpm_wait_descriptor (gpm_fd); | ||
| 3136 | while (Gpm_Close()); /* close all the stack */ | ||
| 3137 | gpm_tty = NULL; | ||
| 3138 | } | ||
| 3139 | |||
| 3131 | DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop, | 3140 | DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop, |
| 3132 | 0, 0, 0, | 3141 | 0, 0, 0, |
| 3133 | doc: /* Close a connection to Gpm. */) | 3142 | doc: /* Close a connection to Gpm. */) |
| @@ -3141,10 +3150,7 @@ DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop, | |||
| 3141 | if (!tty || gpm_tty != tty) | 3150 | if (!tty || gpm_tty != tty) |
| 3142 | return Qnil; /* Not activated on this terminal, nothing to do. */ | 3151 | return Qnil; /* Not activated on this terminal, nothing to do. */ |
| 3143 | 3152 | ||
| 3144 | if (gpm_fd >= 0) | 3153 | close_gpm (); |
| 3145 | delete_gpm_wait_descriptor (gpm_fd); | ||
| 3146 | while (Gpm_Close()); /* close all the stack */ | ||
| 3147 | gpm_tty = NULL; | ||
| 3148 | return Qnil; | 3154 | return Qnil; |
| 3149 | } | 3155 | } |
| 3150 | #endif /* HAVE_GPM */ | 3156 | #endif /* HAVE_GPM */ |