Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f7560908
Commit
f7560908
authored
Mar 17, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the server know about the visible area of a window, which is the
window rect minus the caption and borders when they are handled by the window manager.
parent
75b93ff1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
15 deletions
+32
-15
winpos.c
dlls/x11drv/winpos.c
+6
-2
server_protocol.h
include/wine/server_protocol.h
+2
-1
protocol.def
server/protocol.def
+1
-0
trace.c
server/trace.c
+3
-0
window.c
server/window.c
+20
-12
No files found.
dlls/x11drv/winpos.c
View file @
f7560908
...
...
@@ -728,8 +728,12 @@ BOOL X11DRV_set_window_pos( HWND hwnd, HWND insert_after, const RECT *rectWindow
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
(
memcmp
(
rectWindow
,
&
new_whole_rect
,
sizeof
(
RECT
)
)
||
!
IsRectEmpty
(
&
valid_rects
[
0
]
))
{
wine_server_add_data
(
req
,
&
new_whole_rect
,
sizeof
(
new_whole_rect
)
);
if
(
!
IsRectEmpty
(
&
valid_rects
[
0
]
))
wine_server_add_data
(
req
,
valid_rects
,
2
*
sizeof
(
*
valid_rects
)
);
}
ret
=
!
wine_server_call
(
req
);
new_style
=
reply
->
new_style
;
}
...
...
include/wine/server_protocol.h
View file @
f7560908
...
...
@@ -2607,6 +2607,7 @@ struct get_window_rectangles_reply
{
struct
reply_header
__header
;
rectangle_t
window
;
rectangle_t
visible
;
rectangle_t
client
;
};
...
...
@@ -3780,6 +3781,6 @@ union generic_reply
struct
duplicate_token_reply
duplicate_token_reply
;
};
#define SERVER_PROTOCOL_VERSION 16
0
#define SERVER_PROTOCOL_VERSION 16
1
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
f7560908
...
...
@@ -1841,6 +1841,7 @@ enum message_type
user_handle_t handle; /* handle to the window */
@REPLY
rectangle_t window; /* window rectangle */
rectangle_t visible; /* visible part of the window rectangle */
rectangle_t client; /* client rectangle */
@END
...
...
server/trace.c
View file @
f7560908
...
...
@@ -2218,6 +2218,9 @@ static void dump_get_window_rectangles_reply( const struct get_window_rectangles
fprintf
(
stderr
,
" window="
);
dump_rectangle
(
&
req
->
window
);
fprintf
(
stderr
,
","
);
fprintf
(
stderr
,
" visible="
);
dump_rectangle
(
&
req
->
visible
);
fprintf
(
stderr
,
","
);
fprintf
(
stderr
,
" client="
);
dump_rectangle
(
&
req
->
client
);
}
...
...
server/window.c
View file @
f7560908
...
...
@@ -65,6 +65,7 @@ struct window
atom_t
atom
;
/* class atom */
user_handle_t
last_active
;
/* last active popup */
rectangle_t
window_rect
;
/* window rectangle (relative to parent client area) */
rectangle_t
visible_rect
;
/* visible part of window rect (relative to parent client area) */
rectangle_t
client_rect
;
/* client rectangle (relative to parent client area) */
struct
region
*
win_region
;
/* region for shaped windows (relative to window rect) */
struct
region
*
update_region
;
/* update region (relative to window rect) */
...
...
@@ -443,8 +444,8 @@ static inline int is_point_in_window( struct window *win, int x, int y )
return
0
;
/* disabled child */
if
((
win
->
ex_style
&
(
WS_EX_LAYERED
|
WS_EX_TRANSPARENT
))
==
(
WS_EX_LAYERED
|
WS_EX_TRANSPARENT
))
return
0
;
/* transparent */
if
(
x
<
win
->
window_rect
.
left
||
x
>=
win
->
window
_rect
.
right
||
y
<
win
->
window_rect
.
top
||
y
>=
win
->
window
_rect
.
bottom
)
if
(
x
<
win
->
visible_rect
.
left
||
x
>=
win
->
visible
_rect
.
right
||
y
<
win
->
visible_rect
.
top
||
y
>=
win
->
visible
_rect
.
bottom
)
return
0
;
/* not in window */
if
(
win
->
win_region
&&
!
point_in_region
(
win
->
win_region
,
x
-
win
->
window_rect
.
left
,
y
-
win
->
window_rect
.
top
))
...
...
@@ -629,7 +630,7 @@ static struct region *clip_children( struct window *parent, struct window *last,
if
(
ptr
==
last
)
break
;
if
(
!
(
ptr
->
style
&
WS_VISIBLE
))
continue
;
if
(
ptr
->
ex_style
&
WS_EX_TRANSPARENT
)
continue
;
set_region_rect
(
tmp
,
&
ptr
->
window
_rect
);
set_region_rect
(
tmp
,
&
ptr
->
visible
_rect
);
if
(
ptr
->
win_region
&&
!
intersect_window_region
(
tmp
,
ptr
))
{
free_region
(
tmp
);
...
...
@@ -689,7 +690,7 @@ static struct region *get_visible_region( struct window *win, unsigned int flags
}
else
if
(
flags
&
DCX_WINDOW
)
{
set_region_rect
(
region
,
&
win
->
window
_rect
);
set_region_rect
(
region
,
&
win
->
visible
_rect
);
if
(
win
->
win_region
&&
!
intersect_window_region
(
region
,
win
))
goto
error
;
offset_x
=
win
->
window_rect
.
left
;
offset_y
=
win
->
window_rect
.
top
;
...
...
@@ -1067,10 +1068,12 @@ static void expose_window( struct window *win, struct region *region )
/* set the window and client rectangles, updating the update region if necessary */
static
void
set_window_pos
(
struct
window
*
win
,
struct
window
*
previous
,
unsigned
int
swp_flags
,
const
rectangle_t
*
window_rect
,
const
rectangle_t
*
client_rect
,
const
rectangle_t
*
valid_rects
)
const
rectangle_t
*
client_rect
,
const
rectangle_t
*
visible_rect
,
const
rectangle_t
*
valid_rects
)
{
struct
region
*
old_vis_rgn
=
NULL
,
*
new_vis_rgn
;
const
rectangle_t
old_window_rect
=
win
->
window_rect
;
const
rectangle_t
old_visible_rect
=
win
->
visible_rect
;
const
rectangle_t
old_client_rect
=
win
->
client_rect
;
int
visible
=
(
win
->
style
&
WS_VISIBLE
)
||
(
swp_flags
&
SWP_SHOWWINDOW
);
...
...
@@ -1080,8 +1083,9 @@ static void set_window_pos( struct window *win, struct window *previous,
/* set the new window info before invalidating anything */
win
->
window_rect
=
*
window_rect
;
win
->
client_rect
=
*
client_rect
;
win
->
window_rect
=
*
window_rect
;
win
->
visible_rect
=
*
visible_rect
;
win
->
client_rect
=
*
client_rect
;
if
(
!
(
swp_flags
&
SWP_NOZORDER
))
link_window
(
win
,
win
->
parent
,
previous
);
if
(
swp_flags
&
SWP_SHOWWINDOW
)
win
->
style
|=
WS_VISIBLE
;
else
if
(
swp_flags
&
SWP_HIDEWINDOW
)
win
->
style
&=
~
WS_VISIBLE
;
...
...
@@ -1120,6 +1124,7 @@ static void set_window_pos( struct window *win, struct window *previous,
if
((
swp_flags
&
SWP_FRAMECHANGED
)
||
memcmp
(
window_rect
,
&
old_window_rect
,
sizeof
(
old_window_rect
)
)
||
memcmp
(
visible_rect
,
&
old_visible_rect
,
sizeof
(
old_visible_rect
)
)
||
memcmp
(
client_rect
,
&
old_client_rect
,
sizeof
(
old_client_rect
)
))
{
struct
region
*
tmp
=
create_empty_region
();
...
...
@@ -1426,7 +1431,7 @@ DECL_HANDLER(get_window_tree)
/* set the position and Z order of a window */
DECL_HANDLER
(
set_window_pos
)
{
const
rectangle_t
*
valid_rects
=
NULL
;
const
rectangle_t
*
v
isible_rect
=
NULL
,
*
v
alid_rects
=
NULL
;
struct
window
*
previous
=
NULL
;
struct
window
*
win
=
get_window
(
req
->
handle
);
unsigned
int
flags
=
req
->
flags
;
...
...
@@ -1464,9 +1469,11 @@ DECL_HANDLER(set_window_pos)
return
;
}
if
(
get_req_data_size
()
>=
2
*
sizeof
(
rectangle_t
))
valid_rects
=
get_req_data
();
if
(
get_req_data_size
()
>=
sizeof
(
rectangle_t
))
visible_rect
=
get_req_data
();
if
(
get_req_data_size
()
>=
3
*
sizeof
(
rectangle_t
))
valid_rects
=
visible_rect
+
1
;
set_window_pos
(
win
,
previous
,
flags
,
&
req
->
window
,
&
req
->
client
,
valid_rects
);
if
(
!
visible_rect
)
visible_rect
=
&
req
->
window
;
set_window_pos
(
win
,
previous
,
flags
,
&
req
->
window
,
&
req
->
client
,
visible_rect
,
valid_rects
);
reply
->
new_style
=
win
->
style
;
}
...
...
@@ -1478,8 +1485,9 @@ DECL_HANDLER(get_window_rectangles)
if
(
win
)
{
reply
->
window
=
win
->
window_rect
;
reply
->
client
=
win
->
client_rect
;
reply
->
window
=
win
->
window_rect
;
reply
->
visible
=
win
->
visible_rect
;
reply
->
client
=
win
->
client_rect
;
}
}
...
...
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