Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a3fcd560
Commit
a3fcd560
authored
Oct 23, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Take multiple monitors into account when placing a popup menu.
parent
8a890351
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
menu.c
dlls/user/menu.c
+17
-8
No files found.
dlls/user/menu.c
View file @
a3fcd560
...
...
@@ -1772,6 +1772,9 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
{
POPUPMENU
*
menu
;
UINT
width
,
height
;
POINT
pt
;
HMONITOR
monitor
;
MONITORINFO
info
;
TRACE
(
"owner=%p hmenu=%p id=0x%04x x=0x%04x y=0x%04x xa=0x%04x ya=0x%04x
\n
"
,
hwndOwner
,
hmenu
,
id
,
x
,
y
,
xanchor
,
yanchor
);
...
...
@@ -1794,25 +1797,31 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
width
=
menu
->
Width
+
GetSystemMetrics
(
SM_CXBORDER
);
height
=
menu
->
Height
+
GetSystemMetrics
(
SM_CYBORDER
);
if
(
x
+
width
>
GetSystemMetrics
(
SM_CXSCREEN
))
/* FIXME: should use item rect */
pt
.
x
=
x
;
pt
.
y
=
y
;
monitor
=
MonitorFromPoint
(
pt
,
MONITOR_DEFAULTTONEAREST
);
info
.
cbSize
=
sizeof
(
info
);
GetMonitorInfoW
(
monitor
,
&
info
);
if
(
x
+
width
>
info
.
rcWork
.
right
)
{
if
(
xanchor
&&
x
>=
width
-
xanchor
)
x
-=
width
-
xanchor
;
if
(
x
+
width
>
GetSystemMetrics
(
SM_CXSCREEN
)
)
x
=
GetSystemMetrics
(
SM_CXSCREEN
)
-
width
;
if
(
x
+
width
>
info
.
rcWork
.
right
)
x
=
info
.
rcWork
.
right
-
width
;
}
if
(
x
<
0
)
x
=
0
;
if
(
x
<
info
.
rcWork
.
left
)
x
=
info
.
rcWork
.
left
;
if
(
y
+
height
>
GetSystemMetrics
(
SM_CYSCREEN
)
)
if
(
y
+
height
>
info
.
rcWork
.
bottom
)
{
if
(
yanchor
&&
y
>=
height
+
yanchor
)
y
-=
height
+
yanchor
;
if
(
y
+
height
>
GetSystemMetrics
(
SM_CYSCREEN
)
)
y
=
GetSystemMetrics
(
SM_CYSCREEN
)
-
height
;
if
(
y
+
height
>
info
.
rcWork
.
bottom
)
y
=
info
.
rcWork
.
bottom
-
height
;
}
if
(
y
<
0
)
y
=
0
;
if
(
y
<
info
.
rcWork
.
top
)
y
=
info
.
rcWork
.
top
;
/* NOTE: In Windows, top menu popup is not owned. */
menu
->
hWnd
=
CreateWindowExW
(
0
,
POPUPMENU_CLASS_ATOMW
,
NULL
,
...
...
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