aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-18 13:23:10 +0400
committerDmitry Antipov2013-09-18 13:23:10 +0400
commit18da0d8ad4e5036185acbad3238cbfe2aaf3ca66 (patch)
tree7dc7f25186e10dd1c767d1dbf26268b8c70e1a51 /src/w32term.c
parent7a0c745ad134aff0bb8f4258ea607137a819b58d (diff)
downloademacs-18da0d8ad4e5036185acbad3238cbfe2aaf3ca66.tar.gz
emacs-18da0d8ad4e5036185acbad3238cbfe2aaf3ca66.zip
* frame.c (x_redo_mouse_highlight): New function
to factor out common code used in W32 and X ports. * dispextern.h (x_redo_mouse_highlight): Add prototype. * xterm.h (struct x_display_info): * w32term.h (struct w32_display_info): * nsterm.h (struct ns_display_info): New members last_mouse_motion_frame, last_mouse_motion_x and last_mouse_motion_y, going to replace static variables below. * xterm.c (last_mouse_motion_event, last_mouse_motion_frame) (redo_mouse_highlight): Remove. (note_mouse_movement, syms_of_xterm): Adjust user. (handle_one_xevent): Likewise. Use x_redo_mouse_highlight. * w32term.c (last_mouse_motion_event, last_mouse_motion_frame) (redo_mouse_highlight): Remove. (note_mouse_movement, syms_of_w32term): Adjust user. (w32_read_socket): Likewise. Use x_redo_mouse_highlight. * nsterm.m (last_mouse_motion_position, last_mouse_motion_frame): Remove. (note_mouse_movement, mouseMoved, syms_of_nsterm): * nsfns.m (compute_tip_xy): Adjust user.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 97dda0e8c55..7c0a3987d1e 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3304,22 +3304,22 @@ queue_notifications (struct input_event *event, W32Msg *msg, struct frame *f,
3304 the mainstream emacs code by setting mouse_moved. If not, ask for 3304 the mainstream emacs code by setting mouse_moved. If not, ask for
3305 another motion event, so we can check again the next time it moves. */ 3305 another motion event, so we can check again the next time it moves. */
3306 3306
3307static MSG last_mouse_motion_event;
3308static Lisp_Object last_mouse_motion_frame;
3309
3310static int 3307static int
3311note_mouse_movement (struct frame *frame, MSG *msg) 3308note_mouse_movement (struct frame *frame, MSG *msg)
3312{ 3309{
3310 struct w32_display_info *dpyinfo;
3313 int mouse_x = LOWORD (msg->lParam); 3311 int mouse_x = LOWORD (msg->lParam);
3314 int mouse_y = HIWORD (msg->lParam); 3312 int mouse_y = HIWORD (msg->lParam);
3315 3313
3316 last_mouse_movement_time = msg->time; 3314 if (!FRAME_W32_OUTPUT (frame))
3317 memcpy (&last_mouse_motion_event, msg, sizeof (last_mouse_motion_event));
3318 XSETFRAME (last_mouse_motion_frame, frame);
3319
3320 if (!FRAME_X_OUTPUT (frame))
3321 return 0; 3315 return 0;
3322 3316
3317 dpyinfo = FRAME_DISPLAY_INFO (frame);
3318 last_mouse_movement_time = msg->time;
3319 dpyinfo->last_mouse_motion_frame = frame;
3320 dpyinfo->last_mouse_motion_x = mouse_x;
3321 dpyinfo->last_mouse_motion_y = mouse_y;
3322
3323 if (msg->hwnd != FRAME_W32_WINDOW (frame)) 3323 if (msg->hwnd != FRAME_W32_WINDOW (frame))
3324 { 3324 {
3325 frame->mouse_moved = 1; 3325 frame->mouse_moved = 1;
@@ -3364,16 +3364,6 @@ static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *,
3364static void x_check_fullscreen (struct frame *); 3364static void x_check_fullscreen (struct frame *);
3365 3365
3366static void 3366static void
3367redo_mouse_highlight (void)
3368{
3369 if (!NILP (last_mouse_motion_frame)
3370 && FRAME_LIVE_P (XFRAME (last_mouse_motion_frame)))
3371 note_mouse_highlight (XFRAME (last_mouse_motion_frame),
3372 LOWORD (last_mouse_motion_event.lParam),
3373 HIWORD (last_mouse_motion_event.lParam));
3374}
3375
3376static void
3377w32_define_cursor (Window window, Cursor cursor) 3367w32_define_cursor (Window window, Cursor cursor)
3378{ 3368{
3379 PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0); 3369 PostMessage (window, WM_EMACS_SETCURSOR, (WPARAM) cursor, 0);
@@ -4683,7 +4673,7 @@ w32_read_socket (struct terminal *terminal,
4683 if (!msg.msg.wParam && msg.msg.hwnd == tip_window) 4673 if (!msg.msg.wParam && msg.msg.hwnd == tip_window)
4684 { 4674 {
4685 tip_window = NULL; 4675 tip_window = NULL;
4686 redo_mouse_highlight (); 4676 x_redo_mouse_highlight (dpyinfo);
4687 } 4677 }
4688 4678
4689 /* If window has been obscured or exposed by another window 4679 /* If window has been obscured or exposed by another window
@@ -6649,9 +6639,6 @@ X toolkit. Possible values are: gtk, motif, xaw, or xaw3d.
6649With MS Windows or Nextstep, the value is t. */); 6639With MS Windows or Nextstep, the value is t. */);
6650 Vx_toolkit_scroll_bars = Qt; 6640 Vx_toolkit_scroll_bars = Qt;
6651 6641
6652 staticpro (&last_mouse_motion_frame);
6653 last_mouse_motion_frame = Qnil;
6654
6655 /* Tell Emacs about this window system. */ 6642 /* Tell Emacs about this window system. */
6656 Fprovide (Qw32, Qnil); 6643 Fprovide (Qw32, Qnil);
6657} 6644}