7237 |
} |
} |
7238 |
|
|
7239 |
static void |
static void |
|
do_window_activate (WindowPtr win) |
|
|
{ |
|
|
struct frame *f; |
|
|
|
|
|
if (is_emacs_window (win)) |
|
|
{ |
|
|
f = mac_window_to_frame (win); |
|
|
|
|
|
if (f) |
|
|
{ |
|
|
x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), f); |
|
|
activate_scroll_bars (f); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
static void |
|
|
do_window_deactivate (WindowPtr win) |
|
|
{ |
|
|
struct frame *f; |
|
|
|
|
|
if (is_emacs_window (win)) |
|
|
{ |
|
|
f = mac_window_to_frame (win); |
|
|
|
|
|
if (f == FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame) |
|
|
{ |
|
|
x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), 0); |
|
|
deactivate_scroll_bars (f); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
static void |
|
7240 |
do_app_resume () |
do_app_resume () |
7241 |
{ |
{ |
7242 |
WindowPtr wp; |
WindowPtr wp; |
8120 |
SInt16 part_code; |
SInt16 part_code; |
8121 |
int tool_bar_p = 0; |
int tool_bar_p = 0; |
8122 |
|
|
8123 |
|
#if USE_CARBON_EVENTS |
8124 |
|
/* This is needed to send mouse events like aqua window |
8125 |
|
buttons to the correct handler. */ |
8126 |
|
if (SendEventToEventTarget (eventRef, toolbox_dispatcher) |
8127 |
|
!= eventNotHandledErr) |
8128 |
|
break; |
8129 |
|
#endif |
8130 |
|
|
8131 |
if (dpyinfo->grabbed && last_mouse_frame |
if (dpyinfo->grabbed && last_mouse_frame |
8132 |
&& FRAME_LIVE_P (last_mouse_frame)) |
&& FRAME_LIVE_P (last_mouse_frame)) |
8133 |
{ |
{ |
8143 |
window_ptr = FrontWindow (); |
window_ptr = FrontWindow (); |
8144 |
} |
} |
8145 |
|
|
|
#if USE_CARBON_EVENTS |
|
|
/* This is needed to send mouse events like aqua |
|
|
window buttons to the correct handler. */ |
|
|
if (SendEventToEventTarget (eventRef, toolbox_dispatcher) |
|
|
!= eventNotHandledErr) |
|
|
break; |
|
|
|
|
8146 |
if (!is_emacs_window (window_ptr)) |
if (!is_emacs_window (window_ptr)) |
8147 |
break; |
break; |
8148 |
#endif |
|
8149 |
part_code = FindWindow (er.where, &window_ptr); |
part_code = FindWindow (er.where, &window_ptr); |
8150 |
} |
} |
8151 |
|
|
8391 |
break; |
break; |
8392 |
} |
} |
8393 |
|
|
8394 |
|
if (!is_emacs_window (window_ptr)) |
8395 |
|
break; |
8396 |
|
|
8397 |
|
f = mac_window_to_frame (window_ptr); |
8398 |
|
|
8399 |
if ((er.modifiers & activeFlag) != 0) |
if ((er.modifiers & activeFlag) != 0) |
8400 |
{ |
{ |
8401 |
|
/* A window has been activated */ |
8402 |
Point mouse_loc = er.where; |
Point mouse_loc = er.where; |
8403 |
|
|
8404 |
do_window_activate (window_ptr); |
x_new_focus_frame (dpyinfo, f); |
8405 |
|
activate_scroll_bars (f); |
8406 |
|
|
8407 |
SetPortWindowPort (window_ptr); |
SetPortWindowPort (window_ptr); |
8408 |
GlobalToLocal (&mouse_loc); |
GlobalToLocal (&mouse_loc); |
8409 |
/* activateEvt counts as mouse movement, |
/* Window-activated event counts as mouse movement, |
8410 |
so update things that depend on mouse position. */ |
so update things that depend on mouse position. */ |
8411 |
note_mouse_movement (mac_window_to_frame (window_ptr), |
note_mouse_movement (mac_window_to_frame (window_ptr), |
8412 |
&mouse_loc); |
&mouse_loc); |
8413 |
} |
} |
8414 |
else |
else |
8415 |
{ |
{ |
8416 |
do_window_deactivate (window_ptr); |
/* A window has been deactivated */ |
8417 |
|
dpyinfo->grabbed = 0; |
8418 |
|
|
8419 |
|
if (f == dpyinfo->x_focus_frame) |
8420 |
|
{ |
8421 |
|
x_new_focus_frame (dpyinfo, 0); |
8422 |
|
deactivate_scroll_bars (f); |
8423 |
|
} |
8424 |
|
|
8425 |
|
|
|
f = mac_window_to_frame (window_ptr); |
|
8426 |
if (f == dpyinfo->mouse_face_mouse_frame) |
if (f == dpyinfo->mouse_face_mouse_frame) |
8427 |
{ |
{ |
8428 |
/* If we move outside the frame, then we're |
/* If we move outside the frame, then we're |