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
0da23418
Commit
0da23418
authored
Aug 24, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Switch to the window DPI awareness in ShowWindow().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3bf279e7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
winpos.c
dlls/user32/winpos.c
+14
-9
No files found.
dlls/user32/winpos.c
View file @
0da23418
...
...
@@ -1066,6 +1066,7 @@ static BOOL show_window( HWND hwnd, INT cmd )
{
WND
*
wndPtr
;
HWND
parent
;
DPI_AWARENESS_CONTEXT
context
;
LONG
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
BOOL
wasVisible
=
(
style
&
WS_VISIBLE
)
!=
0
;
BOOL
showFlag
=
TRUE
;
...
...
@@ -1074,10 +1075,12 @@ static BOOL show_window( HWND hwnd, INT cmd )
TRACE
(
"hwnd=%p, cmd=%d, wasVisible %d
\n
"
,
hwnd
,
cmd
,
wasVisible
);
context
=
SetThreadDpiAwarenessContext
(
GetWindowDpiAwarenessContext
(
hwnd
));
switch
(
cmd
)
{
case
SW_HIDE
:
if
(
!
wasVisible
)
return
FALSE
;
if
(
!
wasVisible
)
goto
done
;
showFlag
=
FALSE
;
swp
|=
SWP_HIDEWINDOW
|
SWP_NOSIZE
|
SWP_NOMOVE
;
if
(
style
&
WS_CHILD
)
swp
|=
SWP_NOACTIVATE
|
SWP_NOZORDER
;
...
...
@@ -1091,14 +1094,14 @@ static BOOL show_window( HWND hwnd, INT cmd )
case
SW_SHOWMINIMIZED
:
swp
|=
SWP_SHOWWINDOW
|
SWP_FRAMECHANGED
;
swp
|=
WINPOS_MinMaximize
(
hwnd
,
cmd
,
&
newPos
);
if
((
style
&
WS_MINIMIZE
)
&&
wasVisible
)
return
TRUE
;
if
((
style
&
WS_MINIMIZE
)
&&
wasVisible
)
goto
done
;
break
;
case
SW_SHOWMAXIMIZED
:
/* same as SW_MAXIMIZE */
if
(
!
wasVisible
)
swp
|=
SWP_SHOWWINDOW
;
swp
|=
SWP_FRAMECHANGED
;
swp
|=
WINPOS_MinMaximize
(
hwnd
,
SW_MAXIMIZE
,
&
newPos
);
if
((
style
&
WS_MAXIMIZE
)
&&
wasVisible
)
return
TRUE
;
if
((
style
&
WS_MAXIMIZE
)
&&
wasVisible
)
goto
done
;
break
;
case
SW_SHOWNA
:
...
...
@@ -1106,7 +1109,7 @@ static BOOL show_window( HWND hwnd, INT cmd )
if
(
style
&
WS_CHILD
)
swp
|=
SWP_NOZORDER
;
break
;
case
SW_SHOW
:
if
(
wasVisible
)
return
TRUE
;
if
(
wasVisible
)
goto
done
;
swp
|=
SWP_SHOWWINDOW
|
SWP_NOSIZE
|
SWP_NOMOVE
;
if
(
style
&
WS_CHILD
)
swp
|=
SWP_NOACTIVATE
|
SWP_NOZORDER
;
break
;
...
...
@@ -1126,19 +1129,19 @@ static BOOL show_window( HWND hwnd, INT cmd )
}
else
{
if
(
wasVisible
)
return
TRUE
;
if
(
wasVisible
)
goto
done
;
swp
|=
SWP_NOSIZE
|
SWP_NOMOVE
;
}
if
(
style
&
WS_CHILD
&&
!
(
swp
&
SWP_STATECHANGED
))
swp
|=
SWP_NOACTIVATE
|
SWP_NOZORDER
;
break
;
default:
return
wasVisibl
e
;
goto
don
e
;
}
if
((
showFlag
!=
wasVisible
||
cmd
==
SW_SHOWNA
)
&&
cmd
!=
SW_SHOWMAXIMIZED
&&
!
(
swp
&
SWP_STATECHANGED
))
{
SendMessageW
(
hwnd
,
WM_SHOWWINDOW
,
showFlag
,
0
);
if
(
!
IsWindow
(
hwnd
))
return
wasVisibl
e
;
if
(
!
IsWindow
(
hwnd
))
goto
don
e
;
}
swp
=
USER_Driver
->
pShowWindow
(
hwnd
,
cmd
,
&
newPos
,
swp
);
...
...
@@ -1176,12 +1179,12 @@ static BOOL show_window( HWND hwnd, INT cmd )
if
(
parent
==
GetDesktopWindow
())
parent
=
0
;
SetFocus
(
parent
);
}
return
wasVisibl
e
;
goto
don
e
;
}
if
(
IsIconic
(
hwnd
))
WINPOS_ShowIconTitle
(
hwnd
,
TRUE
);
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
))
||
wndPtr
==
WND_OTHER_PROCESS
)
return
wasVisibl
e
;
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
))
||
wndPtr
==
WND_OTHER_PROCESS
)
goto
don
e
;
if
(
wndPtr
->
flags
&
WIN_NEED_SIZE
)
{
...
...
@@ -1209,6 +1212,8 @@ static BOOL show_window( HWND hwnd, INT cmd )
/* if previous state was minimized Windows sets focus to the window */
if
(
style
&
WS_MINIMIZE
)
SetFocus
(
hwnd
);
done:
SetThreadDpiAwarenessContext
(
context
);
return
wasVisible
;
}
...
...
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