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
59b7d34b
Commit
59b7d34b
authored
Apr 27, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace empty window rect checks by a new X11DRV_is_window_rect_mapped
function so that we can reuse that support for off-screen windows.
parent
84af686a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
+35
-10
window.c
dlls/x11drv/window.c
+20
-1
winpos.c
dlls/x11drv/winpos.c
+14
-9
x11drv.h
dlls/x11drv/x11drv.h
+1
-0
No files found.
dlls/x11drv/window.c
View file @
59b7d34b
...
...
@@ -151,6 +151,24 @@ inline static BOOL is_client_window_mapped( WND *win )
/***********************************************************************
* X11DRV_is_window_rect_mapped
*
* Check if the X whole window should be mapped based on its rectangle
*/
BOOL
X11DRV_is_window_rect_mapped
(
const
RECT
*
rect
)
{
/* don't map if rect is empty */
if
(
IsRectEmpty
(
rect
))
return
FALSE
;
/* don't map if rect is off-screen */
if
(
rect
->
left
>=
screen_width
||
rect
->
top
>=
screen_height
)
return
FALSE
;
if
(
rect
->
right
<
0
||
rect
->
bottom
<
0
)
return
FALSE
;
return
TRUE
;
}
/***********************************************************************
* get_window_attributes
*
* Fill the window attributes structure for an X window.
...
...
@@ -516,7 +534,8 @@ void X11DRV_set_iconic_state( WND *win )
if
(
iconic
)
XIconifyWindow
(
display
,
data
->
whole_window
,
DefaultScreen
(
display
)
);
else
if
(
!
IsRectEmpty
(
&
win
->
rectWindow
))
XMapWindow
(
display
,
data
->
whole_window
);
if
(
X11DRV_is_window_rect_mapped
(
&
win
->
rectWindow
))
XMapWindow
(
display
,
data
->
whole_window
);
}
XFree
(
wm_hints
);
...
...
dlls/x11drv/winpos.c
View file @
59b7d34b
...
...
@@ -817,7 +817,8 @@ static void set_visible_style( HWND hwnd, BOOL set )
{
if
(
win
->
dwStyle
&
WS_VISIBLE
)
goto
done
;
WIN_SetStyle
(
hwnd
,
win
->
dwStyle
|
WS_VISIBLE
);
if
(
!
IsRectEmpty
(
&
win
->
rectWindow
)
&&
get_whole_window
(
win
)
&&
is_window_top_level
(
win
))
if
(
X11DRV_is_window_rect_mapped
(
&
win
->
rectWindow
)
&&
get_whole_window
(
win
)
&&
is_window_top_level
(
win
))
{
Display
*
display
=
thread_display
();
X11DRV_sync_window_style
(
display
,
win
);
...
...
@@ -832,7 +833,8 @@ static void set_visible_style( HWND hwnd, BOOL set )
{
if
(
!
(
win
->
dwStyle
&
WS_VISIBLE
))
goto
done
;
WIN_SetStyle
(
hwnd
,
win
->
dwStyle
&
~
WS_VISIBLE
);
if
(
!
IsRectEmpty
(
&
win
->
rectWindow
)
&&
get_whole_window
(
win
)
&&
is_window_top_level
(
win
))
if
(
X11DRV_is_window_rect_mapped
(
&
win
->
rectWindow
)
&&
get_whole_window
(
win
)
&&
is_window_top_level
(
win
))
{
TRACE
(
"unmapping win %p
\n
"
,
hwnd
);
wine_tsx11_lock
();
...
...
@@ -864,7 +866,7 @@ void X11DRV_SetWindowStyle( HWND hwnd, LONG oldStyle )
if
(
changed
&
WS_VISIBLE
)
{
if
(
!
IsRectEmpty
(
&
wndPtr
->
rectWindow
))
if
(
X11DRV_is_window_rect_mapped
(
&
wndPtr
->
rectWindow
))
{
if
(
wndPtr
->
dwStyle
&
WS_VISIBLE
)
{
...
...
@@ -1013,10 +1015,11 @@ BOOL X11DRV_SetWindowPos( WINDOWPOS *winpos )
set_visible_style
(
winpos
->
hwnd
,
FALSE
);
}
else
if
((
wndPtr
->
dwStyle
&
WS_VISIBLE
)
&&
!
IsRectEmpty
(
&
oldWindowRect
)
&&
IsRectEmpty
(
&
newWindowRect
))
X11DRV_is_window_rect_mapped
(
&
oldWindowRect
)
&&
!
X11DRV_is_window_rect_mapped
(
&
newWindowRect
))
{
/* resizing to zero size -> unmap */
TRACE
(
"unmapping zero size win %p
\n
"
,
winpos
->
hwnd
);
/* resizing to zero size
or off screen
-> unmap */
TRACE
(
"unmapping zero size
or off-screen
win %p
\n
"
,
winpos
->
hwnd
);
wine_tsx11_lock
();
XUnmapWindow
(
display
,
get_whole_window
(
wndPtr
)
);
wine_tsx11_unlock
();
...
...
@@ -1044,10 +1047,11 @@ BOOL X11DRV_SetWindowPos( WINDOWPOS *winpos )
set_visible_style
(
winpos
->
hwnd
,
TRUE
);
}
else
if
((
wndPtr
->
dwStyle
&
WS_VISIBLE
)
&&
IsRectEmpty
(
&
oldWindowRect
)
&&
!
IsRectEmpty
(
&
newWindowRect
))
!
X11DRV_is_window_rect_mapped
(
&
oldWindowRect
)
&&
X11DRV_is_window_rect_mapped
(
&
newWindowRect
))
{
/* resizing from zero size to non-zero -> map */
TRACE
(
"mapping non zero size win %p
\n
"
,
winpos
->
hwnd
);
TRACE
(
"mapping non zero size
or off-screen
win %p
\n
"
,
winpos
->
hwnd
);
XMapWindow
(
display
,
get_whole_window
(
wndPtr
)
);
}
XFlush
(
display
);
/* FIXME: should not be necessary */
...
...
@@ -1449,7 +1453,8 @@ void X11DRV_UnmapNotify( HWND hwnd, XUnmapEvent *event )
if
(
!
(
win
=
WIN_GetPtr
(
hwnd
)))
return
;
if
((
win
->
dwStyle
&
WS_VISIBLE
)
&&
(
win
->
dwExStyle
&
WS_EX_MANAGED
))
if
((
win
->
dwStyle
&
WS_VISIBLE
)
&&
(
win
->
dwExStyle
&
WS_EX_MANAGED
)
&&
X11DRV_is_window_rect_mapped
(
&
win
->
rectWindow
))
{
if
(
win
->
dwStyle
&
WS_MAXIMIZE
)
win
->
flags
|=
WIN_RESTORE_MAX
;
...
...
dlls/x11drv/x11drv.h
View file @
59b7d34b
...
...
@@ -517,6 +517,7 @@ typedef struct x11drv_win_data X11DRV_WND_DATA;
extern
Window
X11DRV_get_client_window
(
HWND
hwnd
);
extern
Window
X11DRV_get_whole_window
(
HWND
hwnd
);
extern
BOOL
X11DRV_is_window_rect_mapped
(
const
RECT
*
rect
);
extern
XIC
X11DRV_get_ic
(
HWND
hwnd
);
inline
static
Window
get_client_window
(
WND
*
wnd
)
...
...
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