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
6eea257f
Commit
6eea257f
authored
Oct 09, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add a helper function to update the window visible state.
parent
b9c847a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
26 deletions
+23
-26
win.c
dlls/user32/win.c
+23
-26
No files found.
dlls/user32/win.c
View file @
6eea257f
...
...
@@ -431,6 +431,21 @@ static void send_parent_notify( HWND hwnd, UINT msg )
/*******************************************************************
* update_window_state
*
* Trigger an update of the window's driver state and surface.
*/
static
void
update_window_state
(
HWND
hwnd
)
{
RECT
window_rect
,
client_rect
;
WIN_GetRectangles
(
hwnd
,
COORDS_PARENT
,
&
window_rect
,
&
client_rect
);
set_window_pos
(
hwnd
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOCLIENTSIZE
|
SWP_NOCLIENTMOVE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_NOREDRAW
,
&
window_rect
,
&
client_rect
,
NULL
);
}
/*******************************************************************
* get_server_window_text
*
* Retrieve the window text from the server.
...
...
@@ -718,7 +733,7 @@ HWND WIN_SetOwner( HWND hwnd, HWND owner )
*/
ULONG
WIN_SetStyle
(
HWND
hwnd
,
ULONG
set_bits
,
ULONG
clear_bits
)
{
BOOL
ok
,
needs_show
=
FALSE
;
BOOL
ok
,
made_visible
=
FALSE
;
STYLESTRUCT
style
;
WND
*
win
=
WIN_GetPtr
(
hwnd
);
...
...
@@ -756,7 +771,7 @@ ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits )
/* Some apps try to make their window visible through WM_SETREDRAW.
* Only do that if the window was never explicitly hidden,
* because Steam messes with WM_SETREDRAW after hiding its windows. */
needs_show
=
!
(
win
->
flags
&
WIN_HIDDEN
)
&&
(
style
.
styleNew
&
WS_VISIBLE
);
made_visible
=
!
(
win
->
flags
&
WIN_HIDDEN
)
&&
(
style
.
styleNew
&
WS_VISIBLE
);
invalidate_dce
(
win
,
NULL
);
}
WIN_ReleasePtr
(
win
);
...
...
@@ -764,14 +779,7 @@ ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits )
if
(
!
ok
)
return
0
;
USER_Driver
->
pSetWindowStyle
(
hwnd
,
GWL_STYLE
,
&
style
);
if
(
needs_show
)
{
RECT
window_rect
,
client_rect
;
WIN_GetRectangles
(
hwnd
,
COORDS_PARENT
,
&
window_rect
,
&
client_rect
);
set_window_pos
(
hwnd
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOCLIENTSIZE
|
SWP_NOCLIENTMOVE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_NOREDRAW
,
&
window_rect
,
&
client_rect
,
NULL
);
}
if
(
made_visible
)
update_window_state
(
hwnd
);
return
style
.
styleOld
;
}
...
...
@@ -2272,7 +2280,7 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, UINT size, BOOL unicod
LONG_PTR
WIN_SetWindowLong
(
HWND
hwnd
,
INT
offset
,
UINT
size
,
LONG_PTR
newval
,
BOOL
unicode
)
{
STYLESTRUCT
style
;
BOOL
ok
,
needs_show
=
FALSE
;
BOOL
ok
,
made_visible
=
FALSE
;
LONG_PTR
retval
=
0
;
WND
*
wndPtr
;
...
...
@@ -2475,7 +2483,7 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
if
((
offset
==
GWL_STYLE
&&
((
style
.
styleOld
^
style
.
styleNew
)
&
WS_VISIBLE
))
||
(
offset
==
GWL_EXSTYLE
&&
((
style
.
styleOld
^
style
.
styleNew
)
&
WS_EX_LAYERED
)))
{
needs_show
=
!
(
wndPtr
->
flags
&
WIN_HIDDEN
)
&&
(
wndPtr
->
dwStyle
&
WS_VISIBLE
);
made_visible
=
!
(
wndPtr
->
flags
&
WIN_HIDDEN
)
&&
(
wndPtr
->
dwStyle
&
WS_VISIBLE
);
invalidate_dce
(
wndPtr
,
NULL
);
}
WIN_ReleasePtr
(
wndPtr
);
...
...
@@ -2487,14 +2495,7 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
style
.
styleOld
=
retval
;
style
.
styleNew
=
newval
;
USER_Driver
->
pSetWindowStyle
(
hwnd
,
offset
,
&
style
);
if
(
needs_show
)
{
RECT
window_rect
,
client_rect
;
WIN_GetRectangles
(
hwnd
,
COORDS_PARENT
,
&
window_rect
,
&
client_rect
);
set_window_pos
(
hwnd
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOCLIENTSIZE
|
SWP_NOCLIENTMOVE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_NOREDRAW
,
&
window_rect
,
&
client_rect
,
NULL
);
}
if
(
made_visible
)
update_window_state
(
hwnd
);
SendMessageW
(
hwnd
,
WM_STYLECHANGED
,
offset
,
(
LPARAM
)
&
style
);
}
...
...
@@ -3598,12 +3599,8 @@ BOOL WINAPI SwitchDesktop( HDESK hDesktop)
*/
BOOL
CDECL
__wine_set_pixel_format
(
HWND
hwnd
,
int
format
)
{
RECT
window_rect
,
client_rect
;
WIN_GetRectangles
(
hwnd
,
COORDS_PARENT
,
&
window_rect
,
&
client_rect
);
return
set_window_pos
(
hwnd
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
|
SWP_NOCLIENTSIZE
|
SWP_NOCLIENTMOVE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_NOREDRAW
,
&
window_rect
,
&
client_rect
,
NULL
);
update_window_state
(
hwnd
);
return
TRUE
;
}
...
...
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