Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
7a18115b
Commit
7a18115b
authored
Jul 01, 2010
by
Jan D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* nsfns.m (compute_tip_xy): Do not convert coordinates from frame parameters.
parent
581a8100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
src/ChangeLog
src/ChangeLog
+3
-0
src/nsfns.m
src/nsfns.m
+21
-14
No files found.
src/ChangeLog
View file @
7a18115b
2010-07-01 Jan Djärv <jan.h.d@swipnet.se>
* nsfns.m (compute_tip_xy): Do not convert coordinates from frame
parameters, they are already absolute.
* nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed
FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT.
...
...
src/nsfns.m
View file @
7a18115b
...
...
@@ -2412,22 +2412,27 @@ The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which
/* Start with user-specified or mouse position. */
left
=
Fcdr
(
Fassq
(
Qleft
,
parms
));
if
(
INTEGERP
(
left
))
pt
.
x
=
XINT
(
left
);
else
pt
.
x
=
last_mouse_motion_position
.
x
;
top
=
Fcdr
(
Fassq
(
Qtop
,
parms
));
if
(
INTEGERP
(
top
))
pt
.
y
=
XINT
(
top
);
else
pt
.
y
=
last_mouse_motion_position
.
y
;
/* Convert to screen coordinates */
pt
=
[
view
convertPoint
:
pt
toView
:
nil
];
pt
=
[[
view
window
]
convertBaseToScreen
:
pt
];
if
(
!
INTEGERP
(
left
)
||
!
INTEGERP
(
top
))
{
pt
=
last_mouse_motion_position
;
/* Convert to screen coordinates */
pt
=
[
view
convertPoint
:
pt
toView
:
nil
];
pt
=
[[
view
window
]
convertBaseToScreen
:
pt
];
}
else
{
/* Absolute coordinates. */
pt
.
x
=
XINT
(
left
);
pt
.
y
=
x_display_pixel_height
(
FRAME_NS_DISPLAY_INFO
(
f
))
-
XINT
(
top
)
-
height
;
}
/* Ensure in bounds. (Note, screen origin = lower left.) */
if
(
pt
.
x
+
XINT
(
dx
)
<=
0
)
if
(
INTEGERP
(
left
))
*
root_x
=
pt
.
x
;
else
if
(
pt
.
x
+
XINT
(
dx
)
<=
0
)
*
root_x
=
0
;
/* Can happen for negative dx */
else
if
(
pt
.
x
+
XINT
(
dx
)
+
width
<=
x_display_pixel_width
(
FRAME_NS_DISPLAY_INFO
(
f
)))
...
...
@@ -2440,7 +2445,9 @@ The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which
/* Put it left justified on the screen -- it ought to fit that way. */
*
root_x
=
0
;
if
(
pt
.
y
-
XINT
(
dy
)
-
height
>=
0
)
if
(
INTEGERP
(
top
))
*
root_y
=
pt
.
y
;
else
if
(
pt
.
y
-
XINT
(
dy
)
-
height
>=
0
)
/* It fits below the pointer. */
*
root_y
=
pt
.
y
-
height
-
XINT
(
dy
);
else
if
(
pt
.
y
+
XINT
(
dy
)
+
height
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment