diff options
Diffstat (limited to 'src/macterm.c')
| -rw-r--r-- | src/macterm.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/macterm.c b/src/macterm.c index 1a281d808a0..9351fd5e36f 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -1210,7 +1210,7 @@ x_flush (f) | |||
| 1210 | FOR_EACH_FRAME (rest, frame) | 1210 | FOR_EACH_FRAME (rest, frame) |
| 1211 | x_flush (XFRAME (frame)); | 1211 | x_flush (XFRAME (frame)); |
| 1212 | } | 1212 | } |
| 1213 | else if (FRAME_X_P (f)) | 1213 | else if (FRAME_MAC_P (f)) |
| 1214 | XFlush (FRAME_MAC_DISPLAY (f)); | 1214 | XFlush (FRAME_MAC_DISPLAY (f)); |
| 1215 | UNBLOCK_INPUT; | 1215 | UNBLOCK_INPUT; |
| 1216 | #endif /* TARGET_API_MAC_CARBON */ | 1216 | #endif /* TARGET_API_MAC_CARBON */ |
| @@ -1410,7 +1410,7 @@ static void | |||
| 1410 | XTframe_up_to_date (f) | 1410 | XTframe_up_to_date (f) |
| 1411 | struct frame *f; | 1411 | struct frame *f; |
| 1412 | { | 1412 | { |
| 1413 | if (FRAME_X_P (f)) | 1413 | if (FRAME_MAC_P (f)) |
| 1414 | { | 1414 | { |
| 1415 | struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); | 1415 | struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); |
| 1416 | 1416 | ||
| @@ -7033,8 +7033,8 @@ static int | |||
| 7033 | mac_get_emulated_btn ( UInt32 modifiers ) | 7033 | mac_get_emulated_btn ( UInt32 modifiers ) |
| 7034 | { | 7034 | { |
| 7035 | int result = 0; | 7035 | int result = 0; |
| 7036 | if (Vmac_emulate_three_button_mouse != Qnil) { | 7036 | if (!NILP (Vmac_emulate_three_button_mouse)) { |
| 7037 | int cmdIs3 = (Vmac_emulate_three_button_mouse != Qreverse); | 7037 | int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse); |
| 7038 | if (modifiers & controlKey) | 7038 | if (modifiers & controlKey) |
| 7039 | result = cmdIs3 ? 2 : 1; | 7039 | result = cmdIs3 ? 2 : 1; |
| 7040 | else if (modifiers & optionKey) | 7040 | else if (modifiers & optionKey) |
| @@ -7052,7 +7052,7 @@ mac_event_to_emacs_modifiers (EventRef eventRef) | |||
| 7052 | UInt32 mods = 0; | 7052 | UInt32 mods = 0; |
| 7053 | GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, | 7053 | GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, |
| 7054 | sizeof (UInt32), NULL, &mods); | 7054 | sizeof (UInt32), NULL, &mods); |
| 7055 | if (Vmac_emulate_three_button_mouse != Qnil && | 7055 | if (!NILP (Vmac_emulate_three_button_mouse) && |
| 7056 | GetEventClass(eventRef) == kEventClassMouse) | 7056 | GetEventClass(eventRef) == kEventClassMouse) |
| 7057 | { | 7057 | { |
| 7058 | mods &= ~(optionKey & cmdKey); | 7058 | mods &= ~(optionKey & cmdKey); |
| @@ -7071,7 +7071,7 @@ mac_get_mouse_btn (EventRef ref) | |||
| 7071 | switch (result) | 7071 | switch (result) |
| 7072 | { | 7072 | { |
| 7073 | case kEventMouseButtonPrimary: | 7073 | case kEventMouseButtonPrimary: |
| 7074 | if (Vmac_emulate_three_button_mouse == Qnil) | 7074 | if (NILP (Vmac_emulate_three_button_mouse)) |
| 7075 | return 0; | 7075 | return 0; |
| 7076 | else { | 7076 | else { |
| 7077 | UInt32 mods = 0; | 7077 | UInt32 mods = 0; |
| @@ -8227,7 +8227,7 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit) | |||
| 8227 | inev.timestamp = er.when * (1000 / 60); | 8227 | inev.timestamp = er.when * (1000 / 60); |
| 8228 | /* ticks to milliseconds */ | 8228 | /* ticks to milliseconds */ |
| 8229 | 8229 | ||
| 8230 | XSETINT (inev.x, tracked_scroll_bar->left + 2); | 8230 | XSETINT (inev.x, XFASTINT (tracked_scroll_bar->left) + 2); |
| 8231 | XSETINT (inev.y, mouse_loc.v - 24); | 8231 | XSETINT (inev.y, mouse_loc.v - 24); |
| 8232 | tracked_scroll_bar->dragging = Qnil; | 8232 | tracked_scroll_bar->dragging = Qnil; |
| 8233 | mouse_tracking_in_progress = mouse_tracking_none; | 8233 | mouse_tracking_in_progress = mouse_tracking_none; |
| @@ -8312,6 +8312,8 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit) | |||
| 8312 | else | 8312 | else |
| 8313 | { | 8313 | { |
| 8314 | Lisp_Object window; | 8314 | Lisp_Object window; |
| 8315 | int x = mouse_loc.h; | ||
| 8316 | int y = mouse_loc.v; | ||
| 8315 | 8317 | ||
| 8316 | XSETFRAME (inev.frame_or_window, mwp->mFP); | 8318 | XSETFRAME (inev.frame_or_window, mwp->mFP); |
| 8317 | if (er.what == mouseDown) | 8319 | if (er.what == mouseDown) |
| @@ -8319,14 +8321,14 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit) | |||
| 8319 | = mouse_tracking_mouse_movement; | 8321 | = mouse_tracking_mouse_movement; |
| 8320 | else | 8322 | else |
| 8321 | mouse_tracking_in_progress = mouse_tracking_none; | 8323 | mouse_tracking_in_progress = mouse_tracking_none; |
| 8322 | window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1); | 8324 | window = window_from_coordinates (mwp->mFP, x, y, 0, 0, 0, 1); |
| 8323 | 8325 | ||
| 8324 | if (EQ (window, mwp->mFP->tool_bar_window)) | 8326 | if (EQ (window, mwp->mFP->tool_bar_window)) |
| 8325 | { | 8327 | { |
| 8326 | if (er.what == mouseDown) | 8328 | if (er.what == mouseDown) |
| 8327 | handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 1, 0); | 8329 | handle_tool_bar_click (mwp->mFP, x, y, 1, 0); |
| 8328 | else | 8330 | else |
| 8329 | handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 0, | 8331 | handle_tool_bar_click (mwp->mFP, x, y, 0, |
| 8330 | #if USE_CARBON_EVENTS | 8332 | #if USE_CARBON_EVENTS |
| 8331 | mac_event_to_emacs_modifiers (eventRef) | 8333 | mac_event_to_emacs_modifiers (eventRef) |
| 8332 | #else | 8334 | #else |
| @@ -9024,7 +9026,7 @@ mac_check_for_quit_char () | |||
| 9024 | EVENT_INIT (e); | 9026 | EVENT_INIT (e); |
| 9025 | e.kind = ASCII_KEYSTROKE_EVENT; | 9027 | e.kind = ASCII_KEYSTROKE_EVENT; |
| 9026 | e.code = quit_char; | 9028 | e.code = quit_char; |
| 9027 | e.arg = NULL; | 9029 | e.arg = Qnil; |
| 9028 | e.modifiers = NULL; | 9030 | e.modifiers = NULL; |
| 9029 | e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60); | 9031 | e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60); |
| 9030 | XSETFRAME (e.frame_or_window, mwp->mFP); | 9032 | XSETFRAME (e.frame_or_window, mwp->mFP); |