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
39f2a082
Commit
39f2a082
authored
Apr 23, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Moved the X11DRV_resize_desktop function to desktop.c.
parent
8c826251
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
71 deletions
+69
-71
desktop.c
dlls/winex11.drv/desktop.c
+67
-0
winpos.c
dlls/winex11.drv/winpos.c
+1
-71
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
No files found.
dlls/winex11.drv/desktop.c
View file @
39f2a082
...
...
@@ -155,3 +155,70 @@ Window X11DRV_create_desktop( UINT width, UINT height )
if
(
win
!=
None
)
X11DRV_init_desktop
(
win
,
width
,
height
);
return
win
;
}
struct
desktop_resize_data
{
RECT
old_screen_rect
;
RECT
old_virtual_rect
;
};
static
BOOL
CALLBACK
update_windows_on_desktop_resize
(
HWND
hwnd
,
LPARAM
lparam
)
{
struct
x11drv_win_data
*
data
;
Display
*
display
=
thread_display
();
struct
desktop_resize_data
*
resize_data
=
(
struct
desktop_resize_data
*
)
lparam
;
int
mask
=
0
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
TRUE
;
/* update the full screen state */
update_net_wm_states
(
display
,
data
);
if
(
resize_data
->
old_virtual_rect
.
left
!=
virtual_screen_rect
.
left
)
mask
|=
CWX
;
if
(
resize_data
->
old_virtual_rect
.
top
!=
virtual_screen_rect
.
top
)
mask
|=
CWY
;
if
(
mask
&&
data
->
whole_window
)
{
XWindowChanges
changes
;
wine_tsx11_lock
();
changes
.
x
=
data
->
whole_rect
.
left
-
virtual_screen_rect
.
left
;
changes
.
y
=
data
->
whole_rect
.
top
-
virtual_screen_rect
.
top
;
XReconfigureWMWindow
(
display
,
data
->
whole_window
,
DefaultScreen
(
display
),
mask
,
&
changes
);
wine_tsx11_unlock
();
}
return
TRUE
;
}
/***********************************************************************
* X11DRV_resize_desktop
*/
void
X11DRV_resize_desktop
(
unsigned
int
width
,
unsigned
int
height
)
{
HWND
hwnd
=
GetDesktopWindow
();
struct
desktop_resize_data
resize_data
;
SetRect
(
&
resize_data
.
old_screen_rect
,
0
,
0
,
screen_width
,
screen_height
);
resize_data
.
old_virtual_rect
=
virtual_screen_rect
;
xinerama_init
(
width
,
height
);
if
(
GetWindowThreadProcessId
(
hwnd
,
NULL
)
!=
GetCurrentThreadId
())
{
SendMessageW
(
hwnd
,
WM_X11DRV_RESIZE_DESKTOP
,
0
,
MAKELPARAM
(
width
,
height
)
);
}
else
{
TRACE
(
"desktop %p change to (%dx%d)
\n
"
,
hwnd
,
width
,
height
);
SetWindowPos
(
hwnd
,
0
,
virtual_screen_rect
.
left
,
virtual_screen_rect
.
top
,
virtual_screen_rect
.
right
-
virtual_screen_rect
.
left
,
virtual_screen_rect
.
bottom
-
virtual_screen_rect
.
top
,
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_DEFERERASE
);
SendMessageTimeoutW
(
HWND_BROADCAST
,
WM_DISPLAYCHANGE
,
screen_bpp
,
MAKELPARAM
(
width
,
height
),
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
}
EnumWindows
(
update_windows_on_desktop_resize
,
(
LPARAM
)
&
resize_data
);
}
dlls/winex11.drv/winpos.c
View file @
39f2a082
...
...
@@ -51,7 +51,7 @@ static const char managed_prop[] = "__wine_x11_managed";
/***********************************************************************
* update_net_wm_states
*/
static
void
update_net_wm_states
(
Display
*
display
,
struct
x11drv_win_data
*
data
)
void
update_net_wm_states
(
Display
*
display
,
struct
x11drv_win_data
*
data
)
{
static
const
unsigned
int
state_atoms
[
NB_NET_WM_STATES
]
=
{
...
...
@@ -464,73 +464,3 @@ void X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, UINT swp_flags,
XFlush
(
display
);
/* make sure changes are done before we start painting again */
wine_tsx11_unlock
();
}
struct
desktop_resize_data
{
RECT
old_screen_rect
;
RECT
old_virtual_rect
;
};
static
BOOL
CALLBACK
update_windows_on_desktop_resize
(
HWND
hwnd
,
LPARAM
lparam
)
{
struct
x11drv_win_data
*
data
;
Display
*
display
=
thread_display
();
struct
desktop_resize_data
*
resize_data
=
(
struct
desktop_resize_data
*
)
lparam
;
int
mask
=
0
;
if
(
!
(
data
=
X11DRV_get_win_data
(
hwnd
)))
return
TRUE
;
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_VISIBLE
)
{
/* update the full screen state */
update_net_wm_states
(
display
,
data
);
}
if
(
resize_data
->
old_virtual_rect
.
left
!=
virtual_screen_rect
.
left
)
mask
|=
CWX
;
if
(
resize_data
->
old_virtual_rect
.
top
!=
virtual_screen_rect
.
top
)
mask
|=
CWY
;
if
(
mask
&&
data
->
whole_window
)
{
XWindowChanges
changes
;
wine_tsx11_lock
();
changes
.
x
=
data
->
whole_rect
.
left
-
virtual_screen_rect
.
left
;
changes
.
y
=
data
->
whole_rect
.
top
-
virtual_screen_rect
.
top
;
XReconfigureWMWindow
(
display
,
data
->
whole_window
,
DefaultScreen
(
display
),
mask
,
&
changes
);
wine_tsx11_unlock
();
}
return
TRUE
;
}
/***********************************************************************
* X11DRV_resize_desktop
*/
void
X11DRV_resize_desktop
(
unsigned
int
width
,
unsigned
int
height
)
{
HWND
hwnd
=
GetDesktopWindow
();
struct
desktop_resize_data
resize_data
;
SetRect
(
&
resize_data
.
old_screen_rect
,
0
,
0
,
screen_width
,
screen_height
);
resize_data
.
old_virtual_rect
=
virtual_screen_rect
;
xinerama_init
(
width
,
height
);
if
(
GetWindowThreadProcessId
(
hwnd
,
NULL
)
!=
GetCurrentThreadId
())
{
SendMessageW
(
hwnd
,
WM_X11DRV_RESIZE_DESKTOP
,
0
,
MAKELPARAM
(
width
,
height
)
);
}
else
{
TRACE
(
"desktop %p change to (%dx%d)
\n
"
,
hwnd
,
width
,
height
);
SetWindowPos
(
hwnd
,
0
,
virtual_screen_rect
.
left
,
virtual_screen_rect
.
top
,
virtual_screen_rect
.
right
-
virtual_screen_rect
.
left
,
virtual_screen_rect
.
bottom
-
virtual_screen_rect
.
top
,
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_DEFERERASE
);
SendMessageTimeoutW
(
HWND_BROADCAST
,
WM_DISPLAYCHANGE
,
screen_bpp
,
MAKELPARAM
(
width
,
height
),
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
}
EnumWindows
(
update_windows_on_desktop_resize
,
(
LPARAM
)
&
resize_data
);
}
dlls/winex11.drv/x11drv.h
View file @
39f2a082
...
...
@@ -711,6 +711,7 @@ extern void flush_gl_drawable( X11DRV_PDEVICE *physDev );
extern
int
get_window_wm_state
(
Display
*
display
,
struct
x11drv_win_data
*
data
);
extern
void
wait_for_withdrawn_state
(
Display
*
display
,
struct
x11drv_win_data
*
data
,
BOOL
set
);
extern
void
update_net_wm_states
(
Display
*
display
,
struct
x11drv_win_data
*
data
);
extern
void
make_window_embedded
(
Display
*
display
,
struct
x11drv_win_data
*
data
);
/* X context to associate a hwnd to an X window */
...
...
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