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
b6cc7f9b
Commit
b6cc7f9b
authored
Jan 24, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Don't create a win_data structure for the root window in non-desktop mode.
parent
4a753f90
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
37 deletions
+23
-37
window.c
dlls/winex11.drv/window.c
+21
-28
winpos.c
dlls/winex11.drv/winpos.c
+2
-9
No files found.
dlls/winex11.drv/window.c
View file @
b6cc7f9b
...
...
@@ -875,7 +875,6 @@ void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data )
if
(
data
->
hwnd
==
GetDesktopWindow
())
{
if
(
data
->
whole_window
==
DefaultRootWindow
(
display
))
return
;
/* force some styles for the desktop to get the correct decorations */
style
|=
WS_CAPTION
|
WS_SYSMENU
|
WS_MINIMIZEBOX
;
owner
=
0
;
...
...
@@ -947,7 +946,7 @@ void X11DRV_set_iconic_state( HWND hwnd )
BOOL
iconic
=
(
style
&
WS_MINIMIZE
)
!=
0
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
;
if
(
!
data
->
whole_window
||
data
->
whole_window
==
DefaultRootWindow
(
display
)
)
return
;
if
(
!
data
->
whole_window
)
return
;
GetWindowRect
(
hwnd
,
&
rect
);
...
...
@@ -1155,7 +1154,6 @@ static void destroy_whole_window( Display *display, struct x11drv_win_data *data
if
(
thread_data
->
cursor_window
==
data
->
whole_window
)
thread_data
->
cursor_window
=
None
;
wine_tsx11_lock
();
XDeleteContext
(
display
,
data
->
whole_window
,
winContext
);
if
(
data
->
whole_window
!=
DefaultRootWindow
(
display
))
XDestroyWindow
(
display
,
data
->
whole_window
);
data
->
whole_window
=
0
;
if
(
data
->
xic
)
...
...
@@ -1242,22 +1240,22 @@ static struct x11drv_win_data *alloc_win_data( Display *display, HWND hwnd )
/* initialize the desktop window id in the desktop manager process */
static
void
get_desktop_xwin
(
Display
*
display
,
struct
x11drv_win_data
*
data
)
static
struct
x11drv_win_data
*
create_desktop_win_data
(
Display
*
display
,
HWND
hwnd
)
{
data
->
whole_window
=
root_window
;
if
(
root_window
!=
DefaultRootWindow
(
display
))
{
struct
x11drv_win_data
*
data
;
VisualID
visualid
;
if
(
!
(
data
=
alloc_win_data
(
display
,
hwnd
)))
return
NULL
;
wine_tsx11_lock
();
visualid
=
XVisualIDFromVisual
(
visual
);
wine_tsx11_unlock
();
data
->
whole_window
=
root_window
;
data
->
managed
=
TRUE
;
SetPropA
(
data
->
hwnd
,
managed_prop
,
(
HANDLE
)
1
);
SetPropA
(
data
->
hwnd
,
whole_window_prop
,
(
HANDLE
)
root_window
);
SetPropA
(
data
->
hwnd
,
visual_id_prop
,
(
HANDLE
)
visualid
);
set_initial_wm_hints
(
display
,
data
);
}
return
data
;
}
/**********************************************************************
...
...
@@ -1309,7 +1307,6 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
{
Display
*
display
=
thread_display
();
WND
*
wndPtr
;
struct
x11drv_win_data
*
data
;
HWND
insert_after
;
RECT
rect
;
DWORD
style
;
...
...
@@ -1318,20 +1315,27 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
BOOL
ret
=
FALSE
;
INT
cx
=
cs
->
cx
,
cy
=
cs
->
cy
;
if
(
!
(
data
=
alloc_win_data
(
display
,
hwnd
)))
return
FALSE
;
if
(
hwnd
==
GetDesktopWindow
())
get_desktop_xwin
(
display
,
data
);
if
(
hwnd
==
GetDesktopWindow
())
{
if
(
root_window
!=
DefaultRootWindow
(
display
))
{
if
(
!
create_desktop_win_data
(
display
,
hwnd
))
return
FALSE
;
}
}
else
{
struct
x11drv_win_data
*
data
;
if
(
!
(
data
=
alloc_win_data
(
display
,
hwnd
)))
return
FALSE
;
/* create an X window if it's a top level window */
if
(
GetAncestor
(
hwnd
,
GA_PARENT
)
==
GetDesktopWindow
())
{
if
(
!
create_whole_window
(
display
,
data
))
goto
failed
;
}
}
/* get class or window DC if needed */
alloc_window_dce
(
data
);
}
/* Call the WH_CBT hook */
...
...
@@ -1379,11 +1383,11 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
}
/* make sure the window is still valid */
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
FALSE
;
if
(
data
->
whole_window
)
X11DRV_sync_window_style
(
display
,
data
);
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
)))
return
FALSE
;
/* send WM_NCCALCSIZE */
rect
=
data
->
window_rect
;
rect
=
wndPtr
->
rectWindow
;
WIN_ReleasePtr
(
wndPtr
);
SendMessageW
(
hwnd
,
WM_NCCALCSIZE
,
FALSE
,
(
LPARAM
)
&
rect
);
if
(
!
(
wndPtr
=
WIN_GetPtr
(
hwnd
)))
return
FALSE
;
...
...
@@ -1393,17 +1397,6 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
X11DRV_SetWindowPos
(
hwnd
,
insert_after
,
&
wndPtr
->
rectWindow
,
&
rect
,
SWP_NOACTIVATE
,
NULL
);
TRACE
(
"win %p window %d,%d,%d,%d client %d,%d,%d,%d whole %d,%d,%d,%d X client %d,%d,%d,%d xwin %x
\n
"
,
hwnd
,
wndPtr
->
rectWindow
.
left
,
wndPtr
->
rectWindow
.
top
,
wndPtr
->
rectWindow
.
right
,
wndPtr
->
rectWindow
.
bottom
,
wndPtr
->
rectClient
.
left
,
wndPtr
->
rectClient
.
top
,
wndPtr
->
rectClient
.
right
,
wndPtr
->
rectClient
.
bottom
,
data
->
whole_rect
.
left
,
data
->
whole_rect
.
top
,
data
->
whole_rect
.
right
,
data
->
whole_rect
.
bottom
,
data
->
client_rect
.
left
,
data
->
client_rect
.
top
,
data
->
client_rect
.
right
,
data
->
client_rect
.
bottom
,
(
unsigned
int
)
data
->
whole_window
);
WIN_ReleasePtr
(
wndPtr
);
if
(
unicode
)
...
...
dlls/winex11.drv/winpos.c
View file @
b6cc7f9b
...
...
@@ -353,17 +353,11 @@ BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
RECT
old_window_rect
,
old_whole_rect
,
old_client_rect
,
visible_rect
;
DWORD
new_style
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
FALSE
;
if
(
!
set_server_window_pos
(
hwnd
,
insert_after
,
rectWindow
,
rectClient
,
swp_flags
,
valid_rects
,
&
visible_rect
))
return
FALSE
;
if
(
data
->
whole_window
==
DefaultRootWindow
(
gdi_display
))
{
data
->
whole_rect
=
data
->
client_rect
=
data
->
window_rect
=
*
rectWindow
;
return
TRUE
;
}
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
FALSE
;
/* check if we need to switch the window to managed */
if
(
!
data
->
managed
&&
data
->
whole_window
&&
managed_mode
&&
...
...
@@ -933,7 +927,6 @@ static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam
void
X11DRV_resize_desktop
(
unsigned
int
width
,
unsigned
int
height
)
{
HWND
hwnd
=
GetDesktopWindow
();
struct
x11drv_win_data
*
data
;
struct
desktop_resize_data
resize_data
;
SetRect
(
&
resize_data
.
old_screen_rect
,
0
,
0
,
screen_width
,
screen_height
);
...
...
@@ -941,7 +934,7 @@ void X11DRV_resize_desktop( unsigned int width, unsigned int height )
xinerama_init
(
width
,
height
);
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)
))
if
(
GetWindowThreadProcessId
(
hwnd
,
NULL
)
!=
GetCurrentThreadId
(
))
{
SendMessageW
(
hwnd
,
WM_X11DRV_RESIZE_DESKTOP
,
0
,
MAKELPARAM
(
width
,
height
)
);
}
...
...
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