aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-05-26 12:56:31 +0300
committerEli Zaretskii2012-05-26 12:56:31 +0300
commit42e3a3615714b47d5ce96a79cf0d773d3266c825 (patch)
tree80f882b5f2aa96818aeee922d5c5e8b3e5f79bc5 /src
parenteb3f6f01890259b11fa72b21aee4bf900abd18a9 (diff)
downloademacs-42e3a3615714b47d5ce96a79cf0d773d3266c825.tar.gz
emacs-42e3a3615714b47d5ce96a79cf0d773d3266c825.zip
Refactor mouse highlight invocation for w32 console.
src/w32inevt.c: Include termchar.h. (mouse_moved_to): Move the call to note_mouse_highlight from here... (do_mouse_event): ...to here. Call clear_mouse_face if mouse_face_hidden is set in the mouse highlight info.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/w32inevt.c26
2 files changed, 27 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 173ed04da73..1a90acbb23b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,14 @@
12012-05-26 Eli Zaretskii <eliz@gnu.org> 12012-05-26 Eli Zaretskii <eliz@gnu.org>
2 2
3 Refactor mouse highlight invocation for w32 console.
4 * w32inevt.c: Include termchar.h.
5 (mouse_moved_to): Move the call to note_mouse_highlight from here...
6 (do_mouse_event): ...to here.
7 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8 highlight info.
9
102012-05-26 Eli Zaretskii <eliz@gnu.org>
11
3 Support mouse highlight on w32 text-mode frames. 12 Support mouse highlight on w32 text-mode frames.
4 * xdisp.c (draw_row_with_mouse_face): Call 13 * xdisp.c (draw_row_with_mouse_face): Call
5 tty_draw_row_with_mouse_face for WINDOWSNT as well. 14 tty_draw_row_with_mouse_face for WINDOWSNT as well.
diff --git a/src/w32inevt.c b/src/w32inevt.c
index cd4a8dd1d49..da8ec0eadb7 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -37,6 +37,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
37#include "dispextern.h" 37#include "dispextern.h"
38#include "blockinput.h" 38#include "blockinput.h"
39#include "termhooks.h" 39#include "termhooks.h"
40#include "termchar.h"
40#include "w32heap.h" 41#include "w32heap.h"
41#include "w32term.h" 42#include "w32term.h"
42 43
@@ -562,17 +563,14 @@ w32_console_mouse_position (FRAME_PTR *f,
562 UNBLOCK_INPUT; 563 UNBLOCK_INPUT;
563} 564}
564 565
565/* Remember mouse motion, notify emacs, and trigger mouse highlight. */ 566/* Remember mouse motion and notify emacs. */
566static void 567static void
567mouse_moved_to (int x, int y) 568mouse_moved_to (int x, int y)
568{ 569{
569 /* If we're in the same place, ignore it. */ 570 /* If we're in the same place, ignore it. */
570 if (x != movement_pos.X || y != movement_pos.Y) 571 if (x != movement_pos.X || y != movement_pos.Y)
571 { 572 {
572 FRAME_PTR f = SELECTED_FRAME (); 573 SELECTED_FRAME ()->mouse_moved = 1;
573
574 f->mouse_moved = 1;
575 note_mouse_highlight (f, x, y);
576 movement_pos.X = x; 574 movement_pos.X = x;
577 movement_pos.Y = y; 575 movement_pos.Y = y;
578 movement_time = GetTickCount (); 576 movement_time = GetTickCount ();
@@ -607,10 +605,22 @@ do_mouse_event (MOUSE_EVENT_RECORD *event,
607 605
608 if (event->dwEventFlags == MOUSE_MOVED) 606 if (event->dwEventFlags == MOUSE_MOVED)
609 { 607 {
610 /* For movement events we just note that the mouse has moved so 608 FRAME_PTR f = SELECTED_FRAME ();
611 that emacs will generate drag events and perhaps trigger 609 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
612 mouse highlighting. */ 610
613 mouse_moved_to (event->dwMousePosition.X, event->dwMousePosition.Y); 611 mouse_moved_to (event->dwMousePosition.X, event->dwMousePosition.Y);
612
613 if (f->mouse_moved)
614 {
615 if (hlinfo->mouse_face_hidden)
616 {
617 hlinfo->mouse_face_hidden = 0;
618 clear_mouse_face (hlinfo);
619 }
620
621 note_mouse_highlight (f, event->dwMousePosition.X,
622 event->dwMousePosition.Y);
623 }
614 return 0; 624 return 0;
615 } 625 }
616 626