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
5df4e623
Commit
5df4e623
authored
Jan 22, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Abstract the server part of SetWindowPos into a separate function.
parent
2921f5c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
52 deletions
+57
-52
winpos.c
dlls/winex11.drv/winpos.c
+57
-52
No files found.
dlls/winex11.drv/winpos.c
View file @
5df4e623
...
...
@@ -234,6 +234,55 @@ static void update_wm_states( Display *display, struct x11drv_win_data *data, BO
/***********************************************************************
* set_server_window_pos
*
* Set the window pos on the server side only. Helper for SetWindowPos.
*/
static
BOOL
set_server_window_pos
(
HWND
hwnd
,
HWND
insert_after
,
const
RECT
*
rectWindow
,
const
RECT
*
rectClient
,
UINT
swp_flags
,
const
RECT
*
valid_rects
,
RECT
*
visible_rect
)
{
WND
*
win
;
BOOL
ret
;
if
(
!
(
win
=
WIN_GetPtr
(
hwnd
)))
return
FALSE
;
if
(
win
==
WND_DESKTOP
||
win
==
WND_OTHER_PROCESS
)
return
FALSE
;
SERVER_START_REQ
(
set_window_pos
)
{
req
->
handle
=
hwnd
;
req
->
previous
=
insert_after
;
req
->
flags
=
swp_flags
;
req
->
window
.
left
=
rectWindow
->
left
;
req
->
window
.
top
=
rectWindow
->
top
;
req
->
window
.
right
=
rectWindow
->
right
;
req
->
window
.
bottom
=
rectWindow
->
bottom
;
req
->
client
.
left
=
rectClient
->
left
;
req
->
client
.
top
=
rectClient
->
top
;
req
->
client
.
right
=
rectClient
->
right
;
req
->
client
.
bottom
=
rectClient
->
bottom
;
if
(
!
IsRectEmpty
(
&
valid_rects
[
0
]
))
wine_server_add_data
(
req
,
valid_rects
,
2
*
sizeof
(
*
valid_rects
)
);
if
((
ret
=
!
wine_server_call
(
req
)))
{
win
->
dwStyle
=
reply
->
new_style
;
win
->
dwExStyle
=
reply
->
new_ex_style
;
win
->
rectWindow
=
*
rectWindow
;
win
->
rectClient
=
*
rectClient
;
visible_rect
->
left
=
reply
->
visible
.
left
;
visible_rect
->
top
=
reply
->
visible
.
top
;
visible_rect
->
right
=
reply
->
visible
.
right
;
visible_rect
->
bottom
=
reply
->
visible
.
bottom
;
}
}
SERVER_END_REQ
;
WIN_ReleasePtr
(
win
);
return
ret
;
}
/***********************************************************************
* SetWindowPos (X11DRV.@)
*/
BOOL
X11DRV_SetWindowPos
(
HWND
hwnd
,
HWND
insert_after
,
const
RECT
*
rectWindow
,
...
...
@@ -241,9 +290,8 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
{
Display
*
display
=
thread_display
();
struct
x11drv_win_data
*
data
;
RECT
new_whole_rect
,
old_client_rect
,
visible_rect
;
WND
*
win
;
DWORD
old_style
,
new_style
,
new_ex_style
;
RECT
new_whole_rect
,
visible_rect
;
DWORD
old_style
,
new_style
;
BOOL
ret
,
make_managed
=
FALSE
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
FALSE
;
...
...
@@ -262,56 +310,20 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
}
}
old_
client_rect
=
data
->
client_rect
;
old_
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
;
if
(
!
data
->
whole_window
)
swp_flags
|=
SWP_NOCOPYBITS
;
/* we can't rely on X11 to move the bits */
if
(
!
(
win
=
WIN_GetPtr
(
hwnd
)))
return
FALSE
;
if
(
win
==
WND_DESKTOP
||
win
==
WND_OTHER_PROCESS
)
{
if
(
IsWindow
(
hwnd
))
ERR
(
"cannot set rectangles of other process window %p
\n
"
,
hwnd
);
return
FALSE
;
}
SERVER_START_REQ
(
set_window_pos
)
{
req
->
handle
=
hwnd
;
req
->
previous
=
insert_after
;
req
->
flags
=
swp_flags
;
req
->
window
.
left
=
rectWindow
->
left
;
req
->
window
.
top
=
rectWindow
->
top
;
req
->
window
.
right
=
rectWindow
->
right
;
req
->
window
.
bottom
=
rectWindow
->
bottom
;
req
->
client
.
left
=
rectClient
->
left
;
req
->
client
.
top
=
rectClient
->
top
;
req
->
client
.
right
=
rectClient
->
right
;
req
->
client
.
bottom
=
rectClient
->
bottom
;
if
(
!
IsRectEmpty
(
&
valid_rects
[
0
]
))
wine_server_add_data
(
req
,
valid_rects
,
2
*
sizeof
(
*
valid_rects
)
);
if
((
ret
=
!
wine_server_call
(
req
)))
{
new_style
=
reply
->
new_style
;
new_ex_style
=
reply
->
new_ex_style
;
visible_rect
.
left
=
reply
->
visible
.
left
;
visible_rect
.
top
=
reply
->
visible
.
top
;
visible_rect
.
right
=
reply
->
visible
.
right
;
visible_rect
.
bottom
=
reply
->
visible
.
bottom
;
}
}
SERVER_END_REQ
;
if
(
ret
)
if
((
ret
=
set_server_window_pos
(
hwnd
,
insert_after
,
rectWindow
,
rectClient
,
swp_flags
,
valid_rects
,
&
visible_rect
)))
{
if
(
data
->
whole_window
==
DefaultRootWindow
(
gdi_display
))
{
data
->
whole_rect
=
data
->
client_rect
=
data
->
window_rect
=
*
rectWindow
;
win
->
rectWindow
=
*
rectWindow
;
win
->
rectClient
=
*
rectClient
;
win
->
dwStyle
=
new_style
;
win
->
dwExStyle
=
new_ex_style
;
WIN_ReleasePtr
(
win
);
return
TRUE
;
}
new_style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
new_whole_rect
=
*
rectWindow
;
X11DRV_window_to_X_rect
(
data
,
&
new_whole_rect
);
if
(
memcmp
(
&
visible_rect
,
&
new_whole_rect
,
sizeof
(
RECT
)
))
...
...
@@ -337,17 +349,10 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
(
swp_flags
&
(
SWP_HIDEWINDOW
|
SWP_SHOWWINDOW
)))
{
RECT
rect
;
UnionRect
(
&
rect
,
rectWindow
,
&
win
->
rectWindow
);
UnionRect
(
&
rect
,
rectWindow
,
&
data
->
window_rect
);
invalidate_dce
(
hwnd
,
&
rect
);
}
win
->
rectWindow
=
*
rectWindow
;
win
->
rectClient
=
*
rectClient
;
old_style
=
win
->
dwStyle
;
win
->
dwStyle
=
new_style
;
win
->
dwExStyle
=
new_ex_style
;
data
->
window_rect
=
*
rectWindow
;
TRACE
(
"win %p window %s client %s style %08x
\n
"
,
hwnd
,
wine_dbgstr_rect
(
rectWindow
),
wine_dbgstr_rect
(
rectClient
),
new_style
);
...
...
@@ -403,6 +408,7 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
}
}
data
->
window_rect
=
*
rectWindow
;
X11DRV_sync_window_position
(
display
,
data
,
swp_flags
,
rectClient
,
&
new_whole_rect
);
if
(
data
->
whole_window
&&
!
data
->
lock_changes
)
...
...
@@ -440,7 +446,6 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
}
}
}
WIN_ReleasePtr
(
win
);
return
ret
;
}
...
...
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