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
aca02968
Commit
aca02968
authored
Jul 31, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Check for wm maximized state in ConfigureNotify and update the window state accordingly.
parent
c2c1a55f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
2 deletions
+51
-2
event.c
dlls/winex11.drv/event.c
+51
-2
No files found.
dlls/winex11.drv/event.c
View file @
aca02968
...
...
@@ -763,6 +763,36 @@ static void X11DRV_MapNotify( HWND hwnd, XEvent *event )
/***********************************************************************
* is_net_wm_state_maximized
*/
static
BOOL
is_net_wm_state_maximized
(
Display
*
display
,
struct
x11drv_win_data
*
data
)
{
Atom
type
,
*
state
;
int
format
,
ret
=
0
;
unsigned
long
i
,
count
,
remaining
;
wine_tsx11_lock
();
if
(
!
XGetWindowProperty
(
display
,
data
->
whole_window
,
x11drv_atom
(
_NET_WM_STATE
),
0
,
65536
/
sizeof
(
CARD32
),
False
,
XA_ATOM
,
&
type
,
&
format
,
&
count
,
&
remaining
,
(
unsigned
char
**
)
&
state
))
{
if
(
type
==
XA_ATOM
&&
format
==
32
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
state
[
i
]
==
x11drv_atom
(
_NET_WM_STATE_MAXIMIZED_VERT
)
||
state
[
i
]
==
x11drv_atom
(
_NET_WM_STATE_MAXIMIZED_HORZ
))
ret
++
;
}
}
XFree
(
state
);
}
wine_tsx11_unlock
();
return
(
ret
==
2
);
}
/***********************************************************************
* X11DRV_ConfigureNotify
*/
void
X11DRV_ConfigureNotify
(
HWND
hwnd
,
XEvent
*
xev
)
...
...
@@ -792,8 +822,8 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
rect
.
right
=
x
+
event
->
width
;
rect
.
bottom
=
y
+
event
->
height
;
OffsetRect
(
&
rect
,
virtual_screen_rect
.
left
,
virtual_screen_rect
.
top
);
TRACE
(
"win %p new X rect %d,%d,%dx%d (event %d,%d,%dx%d)
\n
"
,
hwnd
,
rect
.
left
,
rect
.
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
TRACE
(
"win %p
/%lx
new X rect %d,%d,%dx%d (event %d,%d,%dx%d)
\n
"
,
hwnd
,
data
->
whole_window
,
rect
.
left
,
rect
.
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
event
->
x
,
event
->
y
,
event
->
width
,
event
->
height
);
X11DRV_X_to_window_rect
(
data
,
&
rect
);
...
...
@@ -803,6 +833,25 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
cy
=
rect
.
bottom
-
rect
.
top
;
flags
=
SWP_NOACTIVATE
|
SWP_NOZORDER
;
if
(
is_net_wm_state_maximized
(
event
->
display
,
data
))
{
if
(
!
IsZoomed
(
data
->
hwnd
))
{
TRACE
(
"win %p/%lx is maximized
\n
"
,
data
->
hwnd
,
data
->
whole_window
);
SendMessageW
(
data
->
hwnd
,
WM_SYSCOMMAND
,
SC_MAXIMIZE
,
0
);
return
;
}
}
else
{
if
(
IsZoomed
(
data
->
hwnd
))
{
TRACE
(
"window %p/%lx is no longer maximized
\n
"
,
data
->
hwnd
,
data
->
whole_window
);
SendMessageW
(
data
->
hwnd
,
WM_SYSCOMMAND
,
SC_RESTORE
,
0
);
return
;
}
}
/* Compare what has changed */
GetWindowRect
(
hwnd
,
&
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