diff options
| author | Jan D | 2010-07-01 14:20:14 +0200 |
|---|---|---|
| committer | Jan D | 2010-07-01 14:20:14 +0200 |
| commit | 7a18115b47a70b38ead24ee29ec308c4f2da007f (patch) | |
| tree | 81a96f6bbaa840d2a55ebe66971e2fd093f6f951 /src | |
| parent | 581a81003c3fde96eacdf66d4efa144842276073 (diff) | |
| download | emacs-7a18115b47a70b38ead24ee29ec308c4f2da007f.tar.gz emacs-7a18115b47a70b38ead24ee29ec308c4f2da007f.zip | |
* nsfns.m (compute_tip_xy): Do not convert coordinates from frame parameters.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/nsfns.m | 35 |
2 files changed, 24 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bd975446b3d..8a49d47b266 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2010-07-01 Jan Djärv <jan.h.d@swipnet.se> | 1 | 2010-07-01 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * nsfns.m (compute_tip_xy): Do not convert coordinates from frame | ||
| 4 | parameters, they are already absolute. | ||
| 5 | |||
| 3 | * nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed | 6 | * nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed |
| 4 | FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT. | 7 | FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT. |
| 5 | 8 | ||
diff --git a/src/nsfns.m b/src/nsfns.m index b52f839a078..01ef46a3ca1 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -2412,22 +2412,27 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) | |||
| 2412 | 2412 | ||
| 2413 | /* Start with user-specified or mouse position. */ | 2413 | /* Start with user-specified or mouse position. */ |
| 2414 | left = Fcdr (Fassq (Qleft, parms)); | 2414 | left = Fcdr (Fassq (Qleft, parms)); |
| 2415 | if (INTEGERP (left)) | ||
| 2416 | pt.x = XINT (left); | ||
| 2417 | else | ||
| 2418 | pt.x = last_mouse_motion_position.x; | ||
| 2419 | top = Fcdr (Fassq (Qtop, parms)); | 2415 | top = Fcdr (Fassq (Qtop, parms)); |
| 2420 | if (INTEGERP (top)) | ||
| 2421 | pt.y = XINT (top); | ||
| 2422 | else | ||
| 2423 | pt.y = last_mouse_motion_position.y; | ||
| 2424 | |||
| 2425 | /* Convert to screen coordinates */ | ||
| 2426 | pt = [view convertPoint: pt toView: nil]; | ||
| 2427 | pt = [[view window] convertBaseToScreen: pt]; | ||
| 2428 | 2416 | ||
| 2417 | if (!INTEGERP (left) || !INTEGERP (top)) | ||
| 2418 | { | ||
| 2419 | pt = last_mouse_motion_position; | ||
| 2420 | /* Convert to screen coordinates */ | ||
| 2421 | pt = [view convertPoint: pt toView: nil]; | ||
| 2422 | pt = [[view window] convertBaseToScreen: pt]; | ||
| 2423 | } | ||
| 2424 | else | ||
| 2425 | { | ||
| 2426 | /* Absolute coordinates. */ | ||
| 2427 | pt.x = XINT (left); | ||
| 2428 | pt.y = x_display_pixel_height (FRAME_NS_DISPLAY_INFO (f)) - XINT (top) | ||
| 2429 | - height; | ||
| 2430 | } | ||
| 2431 | |||
| 2429 | /* Ensure in bounds. (Note, screen origin = lower left.) */ | 2432 | /* Ensure in bounds. (Note, screen origin = lower left.) */ |
| 2430 | if (pt.x + XINT (dx) <= 0) | 2433 | if (INTEGERP (left)) |
| 2434 | *root_x = pt.x; | ||
| 2435 | else if (pt.x + XINT (dx) <= 0) | ||
| 2431 | *root_x = 0; /* Can happen for negative dx */ | 2436 | *root_x = 0; /* Can happen for negative dx */ |
| 2432 | else if (pt.x + XINT (dx) + width | 2437 | else if (pt.x + XINT (dx) + width |
| 2433 | <= x_display_pixel_width (FRAME_NS_DISPLAY_INFO (f))) | 2438 | <= x_display_pixel_width (FRAME_NS_DISPLAY_INFO (f))) |
| @@ -2440,7 +2445,9 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) | |||
| 2440 | /* Put it left justified on the screen -- it ought to fit that way. */ | 2445 | /* Put it left justified on the screen -- it ought to fit that way. */ |
| 2441 | *root_x = 0; | 2446 | *root_x = 0; |
| 2442 | 2447 | ||
| 2443 | if (pt.y - XINT (dy) - height >= 0) | 2448 | if (INTEGERP (top)) |
| 2449 | *root_y = pt.y; | ||
| 2450 | else if (pt.y - XINT (dy) - height >= 0) | ||
| 2444 | /* It fits below the pointer. */ | 2451 | /* It fits below the pointer. */ |
| 2445 | *root_y = pt.y - height - XINT (dy); | 2452 | *root_y = pt.y - height - XINT (dy); |
| 2446 | else if (pt.y + XINT (dy) + height | 2453 | else if (pt.y + XINT (dy) + height |