diff options
| author | Steven Tamm | 2004-06-29 06:39:03 +0000 |
|---|---|---|
| committer | Steven Tamm | 2004-06-29 06:39:03 +0000 |
| commit | 59feca74b22b2610582b2bcefd97c9c700d49ce4 (patch) | |
| tree | f52bb3394ae71985f2378fee06eb58f691a5eb63 /src/macterm.c | |
| parent | c61278bbde089da22d4a774fe348536c172c20da (diff) | |
| download | emacs-59feca74b22b2610582b2bcefd97c9c700d49ce4.tar.gz emacs-59feca74b22b2610582b2bcefd97c9c700d49ce4.zip | |
macterm.c (do_window_activate, do_window_deactivate): Remove.
(XTread_socket): Fix activation/focus problems by only handling
emacs windows and passing mouse events to the event chain regardless.
Diffstat (limited to 'src/macterm.c')
| -rw-r--r-- | src/macterm.c | 73 |
1 files changed, 27 insertions, 46 deletions
diff --git a/src/macterm.c b/src/macterm.c index b9584be50bc..a5146dc8ec4 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -7237,40 +7237,6 @@ is_emacs_window (WindowPtr win) | |||
| 7237 | } | 7237 | } |
| 7238 | 7238 | ||
| 7239 | static void | 7239 | static void |
| 7240 | do_window_activate (WindowPtr win) | ||
| 7241 | { | ||
| 7242 | struct frame *f; | ||
| 7243 | |||
| 7244 | if (is_emacs_window (win)) | ||
| 7245 | { | ||
| 7246 | f = mac_window_to_frame (win); | ||
| 7247 | |||
| 7248 | if (f) | ||
| 7249 | { | ||
| 7250 | x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), f); | ||
| 7251 | activate_scroll_bars (f); | ||
| 7252 | } | ||
| 7253 | } | ||
| 7254 | } | ||
| 7255 | |||
| 7256 | static void | ||
| 7257 | do_window_deactivate (WindowPtr win) | ||
| 7258 | { | ||
| 7259 | struct frame *f; | ||
| 7260 | |||
| 7261 | if (is_emacs_window (win)) | ||
| 7262 | { | ||
| 7263 | f = mac_window_to_frame (win); | ||
| 7264 | |||
| 7265 | if (f == FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame) | ||
| 7266 | { | ||
| 7267 | x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), 0); | ||
| 7268 | deactivate_scroll_bars (f); | ||
| 7269 | } | ||
| 7270 | } | ||
| 7271 | } | ||
| 7272 | |||
| 7273 | static void | ||
| 7274 | do_app_resume () | 7240 | do_app_resume () |
| 7275 | { | 7241 | { |
| 7276 | WindowPtr wp; | 7242 | WindowPtr wp; |
| @@ -8154,6 +8120,14 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8154 | SInt16 part_code; | 8120 | SInt16 part_code; |
| 8155 | int tool_bar_p = 0; | 8121 | int tool_bar_p = 0; |
| 8156 | 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 | |||
| 8157 | if (dpyinfo->grabbed && last_mouse_frame | 8131 | if (dpyinfo->grabbed && last_mouse_frame |
| 8158 | && FRAME_LIVE_P (last_mouse_frame)) | 8132 | && FRAME_LIVE_P (last_mouse_frame)) |
| 8159 | { | 8133 | { |
| @@ -8169,16 +8143,9 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8169 | window_ptr = FrontWindow (); | 8143 | window_ptr = FrontWindow (); |
| 8170 | } | 8144 | } |
| 8171 | 8145 | ||
| 8172 | #if USE_CARBON_EVENTS | ||
| 8173 | /* This is needed to send mouse events like aqua | ||
| 8174 | window buttons to the correct handler. */ | ||
| 8175 | if (SendEventToEventTarget (eventRef, toolbox_dispatcher) | ||
| 8176 | != eventNotHandledErr) | ||
| 8177 | break; | ||
| 8178 | |||
| 8179 | if (!is_emacs_window (window_ptr)) | 8146 | if (!is_emacs_window (window_ptr)) |
| 8180 | break; | 8147 | break; |
| 8181 | #endif | 8148 | |
| 8182 | part_code = FindWindow (er.where, &window_ptr); | 8149 | part_code = FindWindow (er.where, &window_ptr); |
| 8183 | } | 8150 | } |
| 8184 | 8151 | ||
| @@ -8424,24 +8391,38 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8424 | break; | 8391 | break; |
| 8425 | } | 8392 | } |
| 8426 | 8393 | ||
| 8394 | if (!is_emacs_window (window_ptr)) | ||
| 8395 | break; | ||
| 8396 | |||
| 8397 | f = mac_window_to_frame (window_ptr); | ||
| 8398 | |||
| 8427 | if ((er.modifiers & activeFlag) != 0) | 8399 | if ((er.modifiers & activeFlag) != 0) |
| 8428 | { | 8400 | { |
| 8401 | /* A window has been activated */ | ||
| 8429 | Point mouse_loc = er.where; | 8402 | Point mouse_loc = er.where; |
| 8430 | 8403 | ||
| 8431 | do_window_activate (window_ptr); | 8404 | x_new_focus_frame (dpyinfo, f); |
| 8405 | activate_scroll_bars (f); | ||
| 8432 | 8406 | ||
| 8433 | SetPortWindowPort (window_ptr); | 8407 | SetPortWindowPort (window_ptr); |
| 8434 | GlobalToLocal (&mouse_loc); | 8408 | GlobalToLocal (&mouse_loc); |
| 8435 | /* activateEvt counts as mouse movement, | 8409 | /* Window-activated event counts as mouse movement, |
| 8436 | so update things that depend on mouse position. */ | 8410 | so update things that depend on mouse position. */ |
| 8437 | note_mouse_movement (mac_window_to_frame (window_ptr), | 8411 | note_mouse_movement (mac_window_to_frame (window_ptr), |
| 8438 | &mouse_loc); | 8412 | &mouse_loc); |
| 8439 | } | 8413 | } |
| 8440 | else | 8414 | else |
| 8441 | { | 8415 | { |
| 8442 | do_window_deactivate (window_ptr); | 8416 | /* 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 | |||
| 8443 | 8425 | ||
| 8444 | f = mac_window_to_frame (window_ptr); | ||
| 8445 | if (f == dpyinfo->mouse_face_mouse_frame) | 8426 | if (f == dpyinfo->mouse_face_mouse_frame) |
| 8446 | { | 8427 | { |
| 8447 | /* If we move outside the frame, then we're | 8428 | /* If we move outside the frame, then we're |