aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/nsterm.m33
2 files changed, 39 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e543c982ae1..7cae8e05f25 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12013-08-28 Davor Cubranic <cubranic@stat.ubc.ca> (tiny change)
2
3 * nsterm.m (last_window): New variable.
4 (EV_TRAILER2): New macro.
5 (EV_TRAILER): Call EV_TRAILER2.
6 (mouseMoved:): Add support for mouse-autoselect-window
7 on nextstep (Bug#6888).
8
12013-08-28 Andreas Schwab <schwab@suse.de> 92013-08-28 Andreas Schwab <schwab@suse.de>
2 10
3 * regex.c (CHAR_CHARSET, CHARSET_LEADING_CODE_BASE, CHAR_HEAD_P) 11 * regex.c (CHAR_CHARSET, CHARSET_LEADING_CODE_BASE, CHAR_HEAD_P)
diff --git a/src/nsterm.m b/src/nsterm.m
index 750d8b25b4d..1f4ebcfefd9 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -184,6 +184,9 @@ struct ns_display_info *x_display_list; /* Chain of existing displays */
184Lisp_Object ns_display_name_list; 184Lisp_Object ns_display_name_list;
185long context_menu_value = 0; 185long context_menu_value = 0;
186 186
187/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
188static Lisp_Object last_window;
189
187/* display update */ 190/* display update */
188NSPoint last_mouse_motion_position; 191NSPoint last_mouse_motion_position;
189static NSRect last_mouse_glyph; 192static NSRect last_mouse_glyph;
@@ -308,8 +311,13 @@ static CGPoint menu_mouse_point;
308/* This is a piece of code which is common to all the event handling 311/* This is a piece of code which is common to all the event handling
309 methods. Maybe it should even be a function. */ 312 methods. Maybe it should even be a function. */
310#define EV_TRAILER(e) \ 313#define EV_TRAILER(e) \
311 { \ 314 { \
312 XSETFRAME (emacs_event->frame_or_window, emacsframe); \ 315 XSETFRAME (emacs_event->frame_or_window, emacsframe); \
316 EV_TRAILER2 (e); \
317 }
318
319#define EV_TRAILER2(e) \
320 { \
313 if (e) emacs_event->timestamp = EV_TIMESTAMP (e); \ 321 if (e) emacs_event->timestamp = EV_TIMESTAMP (e); \
314 if (q_event_ptr) \ 322 if (q_event_ptr) \
315 { \ 323 { \
@@ -5465,6 +5473,27 @@ not_in_argv (NSString *arg)
5465 previous_help_echo_string = help_echo_string; 5473 previous_help_echo_string = help_echo_string;
5466 help_echo_string = Qnil; 5474 help_echo_string = Qnil;
5467 5475
5476 if (!NILP (Vmouse_autoselect_window))
5477 {
5478 NSTRACE (mouse_autoselect_window);
5479 Lisp_Object window;
5480 window = window_from_coordinates(emacsframe, last_mouse_motion_position.x,
5481 last_mouse_motion_position.y, 0, 0);
5482 if (WINDOWP (window)
5483 && !EQ (window, last_window)
5484 && !EQ (window, selected_window)
5485 && (focus_follows_mouse
5486 || (EQ (XWINDOW (window)->frame,
5487 XWINDOW (selected_window)->frame))))
5488 {
5489 NSTRACE (in_window);
5490 emacs_event->kind = SELECT_WINDOW_EVENT;
5491 emacs_event->frame_or_window = window;
5492 EV_TRAILER2 (e);
5493 }
5494 last_window = window;
5495 }
5496
5468 if (!note_mouse_movement (emacsframe, last_mouse_motion_position.x, 5497 if (!note_mouse_movement (emacsframe, last_mouse_motion_position.x,
5469 last_mouse_motion_position.y)) 5498 last_mouse_motion_position.y))
5470 help_echo_string = previous_help_echo_string; 5499 help_echo_string = previous_help_echo_string;