comparison src/macterm.c @ 66181:dc3ff6945eb2

(note_mouse_movement): Use PtInRect. (XTread_socket): Also ignore mouse motion just before a button release event. Don't process button release event when mouse is not grabbed.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Tue, 18 Oct 2005 08:07:06 +0000
parents 479c8c41d179
children 8ee33d677ac7 db4e74787e6f 0ca0d9181b5e
comparison
equal deleted inserted replaced
66180:c80a3a047c83 66181:dc3ff6945eb2
3908 frame->output_data.mac->nontext_cursor); 3908 frame->output_data.mac->nontext_cursor);
3909 } 3909 }
3910 return 1; 3910 return 1;
3911 } 3911 }
3912 /* Has the mouse moved off the glyph it was on at the last sighting? */ 3912 /* Has the mouse moved off the glyph it was on at the last sighting? */
3913 if (pos->h < last_mouse_glyph.left 3913 if (!PtInRect (*pos, &last_mouse_glyph))
3914 || pos->h >= last_mouse_glyph.right
3915 || pos->v < last_mouse_glyph.top
3916 || pos->v >= last_mouse_glyph.bottom)
3917 { 3914 {
3918 frame->mouse_moved = 1; 3915 frame->mouse_moved = 1;
3919 last_mouse_scroll_bar = Qnil; 3916 last_mouse_scroll_bar = Qnil;
3920 note_mouse_highlight (frame, pos->h, pos->v); 3917 note_mouse_highlight (frame, pos->h, pos->v);
3921 /* Remember which glyph we're now on. */ 3918 /* Remember which glyph we're now on. */
9519 HideWindow (tip_window); 9516 HideWindow (tip_window);
9520 part_code = FindWindow (er.where, &window_ptr); 9517 part_code = FindWindow (er.where, &window_ptr);
9521 } 9518 }
9522 } 9519 }
9523 9520
9524 if (er.what != mouseDown && part_code != inContent) 9521 if (er.what != mouseDown &&
9522 (part_code != inContent || dpyinfo->grabbed == 0))
9525 break; 9523 break;
9526 9524
9527 switch (part_code) 9525 switch (part_code)
9528 { 9526 {
9529 case inMenuBar: 9527 case inMenuBar:
9642 9640
9643 if (er.what == mouseDown) 9641 if (er.what == mouseDown)
9644 { 9642 {
9645 dpyinfo->grabbed |= (1 << inev.code); 9643 dpyinfo->grabbed |= (1 << inev.code);
9646 last_mouse_frame = f; 9644 last_mouse_frame = f;
9647 /* Ignore any mouse motion that happened
9648 before this event; any subsequent
9649 mouse-movement Emacs events should reflect
9650 only motion after the ButtonPress. */
9651 if (f != 0)
9652 f->mouse_moved = 0;
9653 9645
9654 if (!tool_bar_p) 9646 if (!tool_bar_p)
9655 last_tool_bar_item = -1; 9647 last_tool_bar_item = -1;
9656 } 9648 }
9657 else 9649 else
9662 of multi-button emulation. */ 9654 of multi-button emulation. */
9663 dpyinfo->grabbed = 0; 9655 dpyinfo->grabbed = 0;
9664 else 9656 else
9665 dpyinfo->grabbed &= ~(1 << inev.code); 9657 dpyinfo->grabbed &= ~(1 << inev.code);
9666 } 9658 }
9659
9660 /* Ignore any mouse motion that happened before
9661 this event; any subsequent mouse-movement Emacs
9662 events should reflect only motion after the
9663 ButtonPress. */
9664 if (f != 0)
9665 f->mouse_moved = 0;
9667 9666
9668 #ifdef USE_TOOLKIT_SCROLL_BARS 9667 #ifdef USE_TOOLKIT_SCROLL_BARS
9669 if (inev.kind == MOUSE_CLICK_EVENT) 9668 if (inev.kind == MOUSE_CLICK_EVENT)
9670 #endif 9669 #endif
9671 switch (er.what) 9670 switch (er.what)