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
5785ee08
Commit
5785ee08
authored
Feb 29, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Avoid accessing the internals of the window structure in the Map/UnmapNotify handlers.
parent
84d260ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
41 deletions
+15
-41
winpos.c
dlls/winex11.drv/winpos.c
+15
-41
No files found.
dlls/winex11.drv/winpos.c
View file @
5785ee08
...
...
@@ -440,7 +440,6 @@ void X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, UINT swp_flags,
void
X11DRV_MapNotify
(
HWND
hwnd
,
XEvent
*
event
)
{
struct
x11drv_win_data
*
data
;
WND
*
win
;
int
state
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
;
...
...
@@ -454,20 +453,13 @@ void X11DRV_MapNotify( HWND hwnd, XEvent *event )
}
state
=
get_window_wm_state
(
event
->
xmap
.
display
,
data
);
if
(
state
!=
NormalState
)
{
TRACE
(
"win %p/%lx ignoring since state=%d
\n
"
,
hwnd
,
data
->
whole_window
,
state
);
return
;
}
data
->
iconic
=
FALSE
;
if
((
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
(
WS_VISIBLE
|
WS_MINIMIZE
))
==
(
WS_VISIBLE
|
WS_MINIMIZE
))
if
(
state
==
NormalState
)
{
int
x
,
y
;
unsigned
int
width
,
height
,
border
,
depth
;
Window
root
,
top
;
WINDOWPLACEMENT
wp
;
RECT
rect
;
LONG
style
=
WS_VISIBLE
;
/* FIXME: hack */
wine_tsx11_lock
();
...
...
@@ -482,17 +474,18 @@ void X11DRV_MapNotify( HWND hwnd, XEvent *event )
OffsetRect
(
&
rect
,
virtual_screen_rect
.
left
,
virtual_screen_rect
.
top
);
X11DRV_X_to_window_rect
(
data
,
&
rect
);
if
(
!
(
win
=
WIN_GetPtr
(
hwnd
)))
return
;
if
(
win
->
flags
&
WIN_RESTORE_MAX
)
style
|=
WS_MAXIMIZE
;
WIN_SetStyle
(
hwnd
,
style
,
WS_MINIMIZE
)
;
WIN_ReleasePtr
(
win
)
;
wp
.
length
=
sizeof
(
wp
)
;
wp
.
flags
=
0
;
wp
.
showCmd
=
SW_RESTORE
;
wp
.
rcNormalPosition
=
rect
;
SendMessageW
(
hwnd
,
WM_SHOWWINDOW
,
SW_RESTORE
,
0
);
TRACE
(
"restoring win %p/%lx
\n
"
,
hwnd
,
data
->
whole_window
);
data
->
iconic
=
FALSE
;
data
->
lock_changes
++
;
SetWindowPos
(
hwnd
,
0
,
rect
.
left
,
rect
.
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_FRAMECHANGED
|
SWP_STATECHANGED
);
SetWindowPlacement
(
hwnd
,
&
wp
);
data
->
lock_changes
--
;
}
else
TRACE
(
"win %p/%lx ignoring since state=%d
\n
"
,
hwnd
,
data
->
whole_window
,
state
);
}
...
...
@@ -502,40 +495,21 @@ void X11DRV_MapNotify( HWND hwnd, XEvent *event )
void
X11DRV_UnmapNotify
(
HWND
hwnd
,
XEvent
*
event
)
{
struct
x11drv_win_data
*
data
;
WND
*
win
;
int
state
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
;
if
(
!
data
->
managed
||
!
data
->
mapped
)
return
;
state
=
get_window_wm_state
(
event
->
xunmap
.
display
,
data
);
if
(
state
!
=
IconicState
)
if
(
state
=
=
IconicState
)
{
TRACE
(
"win %p/%lx ignoring since state=%d
\n
"
,
hwnd
,
data
->
whole_window
,
state
);
return
;
}
data
->
iconic
=
TRUE
;
if
(
!
(
win
=
WIN_GetPtr
(
hwnd
)))
return
;
if
((
win
->
dwStyle
&
WS_VISIBLE
)
&&
X11DRV_is_window_rect_mapped
(
&
win
->
rectWindow
))
{
if
(
win
->
dwStyle
&
WS_MAXIMIZE
)
win
->
flags
|=
WIN_RESTORE_MAX
;
else
if
(
!
(
win
->
dwStyle
&
WS_MINIMIZE
))
win
->
flags
&=
~
WIN_RESTORE_MAX
;
WIN_SetStyle
(
hwnd
,
WS_MINIMIZE
,
WS_MAXIMIZE
);
WIN_ReleasePtr
(
win
);
EndMenu
();
SendMessageW
(
hwnd
,
WM_SHOWWINDOW
,
SW_MINIMIZE
,
0
);
TRACE
(
"minimizing win %p/%lx
\n
"
,
hwnd
,
data
->
whole_window
);
data
->
iconic
=
TRUE
;
data
->
lock_changes
++
;
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
GetSystemMetrics
(
SM_CXICON
),
GetSystemMetrics
(
SM_CYICON
),
SWP_NOMOVE
|
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_STATECHANGED
);
ShowWindow
(
hwnd
,
SW_MINIMIZE
);
data
->
lock_changes
--
;
}
else
WIN_ReleasePtr
(
win
);
else
TRACE
(
"win %p/%lx ignoring since state=%d
\n
"
,
hwnd
,
data
->
whole_window
,
state
);
}
struct
desktop_resize_data
...
...
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