Commit 0062917f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winex11: Move create_desktop implementation to dllmain.c.

parent fce3f9c3
...@@ -321,13 +321,14 @@ void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height ) ...@@ -321,13 +321,14 @@ void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height )
/*********************************************************************** /***********************************************************************
* X11DRV_create_desktop * x11drv_create_desktop
* *
* Create the X11 desktop window for the desktop mode. * Create the X11 desktop window for the desktop mode.
*/ */
BOOL CDECL X11DRV_create_desktop( UINT width, UINT height ) NTSTATUS x11drv_create_desktop( void *arg )
{ {
static const WCHAR rootW[] = {'r','o','o','t',0}; static const WCHAR rootW[] = {'r','o','o','t',0};
const struct create_desktop_params *params = arg;
XSetWindowAttributes win_attr; XSetWindowAttributes win_attr;
Window win; Window win;
Display *display = thread_init_display(); Display *display = thread_init_display();
...@@ -337,7 +338,7 @@ BOOL CDECL X11DRV_create_desktop( UINT width, UINT height ) ...@@ -337,7 +338,7 @@ BOOL CDECL X11DRV_create_desktop( UINT width, UINT height )
UOI_NAME, name, sizeof(name), NULL )) UOI_NAME, name, sizeof(name), NULL ))
name[0] = 0; name[0] = 0;
TRACE( "%s %ux%u\n", debugstr_w(name), width, height ); TRACE( "%s %ux%u\n", debugstr_w(name), params->width, params->height );
/* magic: desktop "root" means use the root window */ /* magic: desktop "root" means use the root window */
if (!lstrcmpiW( name, rootW )) return FALSE; if (!lstrcmpiW( name, rootW )) return FALSE;
...@@ -354,12 +355,12 @@ BOOL CDECL X11DRV_create_desktop( UINT width, UINT height ) ...@@ -354,12 +355,12 @@ BOOL CDECL X11DRV_create_desktop( UINT width, UINT height )
win_attr.colormap = None; win_attr.colormap = None;
win = XCreateWindow( display, DefaultRootWindow(display), win = XCreateWindow( display, DefaultRootWindow(display),
0, 0, width, height, 0, default_visual.depth, InputOutput, default_visual.visual, 0, 0, params->width, params->height, 0, default_visual.depth, InputOutput,
CWEventMask | CWCursor | CWColormap, &win_attr ); default_visual.visual, CWEventMask | CWCursor | CWColormap, &win_attr );
if (!win) return FALSE; if (!win) return FALSE;
if (!create_desktop_win_data( win )) return FALSE; if (!create_desktop_win_data( win )) return FALSE;
X11DRV_init_desktop( win, width, height ); X11DRV_init_desktop( win, params->width, params->height );
if (is_desktop_fullscreen()) if (is_desktop_fullscreen())
{ {
TRACE("setting desktop to fullscreen\n"); TRACE("setting desktop to fullscreen\n");
......
...@@ -134,3 +134,13 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) ...@@ -134,3 +134,13 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
x11drv_module = instance; x11drv_module = instance;
return !x11drv_init( NULL ); return !x11drv_init( NULL );
} }
/***********************************************************************
* wine_create_desktop (winex11.@)
*/
BOOL CDECL wine_create_desktop( UINT width, UINT height )
{
struct create_desktop_params params = { .width = width, .height = height };
return x11drv_create_desktop( &params );
}
...@@ -28,6 +28,13 @@ struct clipboard_message_params ...@@ -28,6 +28,13 @@ struct clipboard_message_params
LPARAM lparam; LPARAM lparam;
}; };
/* x11drv_create_desktop params */
struct create_desktop_params
{
UINT width;
UINT height;
};
/* DnD support */ /* DnD support */
struct format_entry struct format_entry
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
@ cdecl WTInfoW(long long ptr) X11DRV_WTInfoW @ cdecl WTInfoW(long long ptr) X11DRV_WTInfoW
# Desktop # Desktop
@ cdecl wine_create_desktop(long long) X11DRV_create_desktop @ cdecl wine_create_desktop(long long)
# System tray # System tray
@ cdecl wine_notify_icon(long ptr) @ cdecl wine_notify_icon(long ptr)
......
...@@ -845,6 +845,7 @@ static inline BOOL is_window_rect_mapped( const RECT *rect ) ...@@ -845,6 +845,7 @@ static inline BOOL is_window_rect_mapped( const RECT *rect )
extern NTSTATUS x11drv_init( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_init( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_clipboard_message( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_clipboard_message( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS x11drv_create_desktop( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS WINAPI x11drv_post_drop( void *data, ULONG size ) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI x11drv_post_drop( void *data, ULONG size ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment