From 41fa47d4315a998ea1116f0d9f898eeaaad51c0b Mon Sep 17 00:00:00 2001 From: Jared Finder Date: Wed, 2 Dec 2020 00:05:59 -0800 Subject: [PATCH] Remove incorrect usage of HAVE_GPM. * src/frame.c (Fset_mouse_position, Fset_mouse_pixel_position): Call Fselect_frame in all terminals, independent of defines. * src/term.c (init_tty): Initialize mouse_face_window for all terminals. * src/xdisp.c (try_window_id): Call gui_clear_window_mouse_face in all cases. --- src/frame.c | 36 ++++++++++++++++++++++++------------ src/term.c | 2 +- src/xdisp.c | 3 +-- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/frame.c b/src/frame.c index 17ec455d2d..4bbcb74667 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2574,22 +2574,28 @@ DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (XFRAME (frame))) - /* Warping the mouse will cause enternotify and focus events. */ - frame_set_mouse_position (XFRAME (frame), xval, yval); -#elif defined MSDOS + { + /* Warping the mouse will cause enternotify and focus events. */ + frame_set_mouse_position (XFRAME (frame), xval, yval); + return Qnil; + } +#endif /* HAVE_WINDOW_SYSTEM */ +#ifdef MSDOS if (FRAME_MSDOS_P (XFRAME (frame))) { Fselect_frame (frame, Qnil); mouse_moveto (xval, yval); + return Qnil; } -#elif defined HAVE_GPM +#endif /* MSDOS */ + Fselect_frame (frame, Qnil); +#if defined (HAVE_GPM) && ! defined (HAVE_WINDOW_SYSTEM) term_mouse_moveto (xval, yval); #else (void) xval; (void) yval; -#endif - +#endif /* HAVE_GPM && ! HAVE_WINDOW_SYSTEM */ return Qnil; } @@ -2612,22 +2618,28 @@ DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (XFRAME (frame))) - /* Warping the mouse will cause enternotify and focus events. */ - frame_set_mouse_pixel_position (XFRAME (frame), xval, yval); -#elif defined MSDOS + { + /* Warping the mouse will cause enternotify and focus events. */ + frame_set_mouse_pixel_position (XFRAME (frame), xval, yval); + return Qnil; + } +#endif /* HAVE_WINDOW_SYSTEM */ +#ifdef MSDOS if (FRAME_MSDOS_P (XFRAME (frame))) { Fselect_frame (frame, Qnil); mouse_moveto (xval, yval); + return Qnil; } -#elif defined HAVE_GPM +#endif /* MSDOS */ + Fselect_frame (frame, Qnil); +#if defined (HAVE_GPM) && ! defined (HAVE_WINDOW_SYSTEM) term_mouse_moveto (xval, yval); #else (void) xval; (void) yval; -#endif - +#endif /* HAVE_GPM && ! HAVE_WINDOW_SYSTEM */ return Qnil; } diff --git a/src/term.c b/src/term.c index fee3b55575..dfdc3bce7e 100644 --- a/src/term.c +++ b/src/term.c @@ -4246,8 +4246,8 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed) #ifdef HAVE_GPM terminal->mouse_position_hook = term_mouse_position; - tty->mouse_highlight.mouse_face_window = Qnil; #endif + tty->mouse_highlight.mouse_face_window = Qnil; terminal->kboard = allocate_kboard (Qnil); terminal->kboard->reference_count++; diff --git a/src/xdisp.c b/src/xdisp.c index 76ef420a36..498e6f1065 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20779,9 +20779,8 @@ #define GIVE_UP(X) return 0 + window_wants_header_line (w) + window_internal_height (w)); -#if defined (HAVE_GPM) || defined (MSDOS) gui_clear_window_mouse_face (w); -#endif + /* Perform the operation on the screen. */ if (dvpos > 0) { -- 2.20.1