explorer: Return a simple boolean instead of a window in the wine_create_desktop entry point.

This commit is contained in:
Alexandre Julliard 2013-02-06 12:49:41 +01:00
parent 3e24a17c03
commit a73c5d5c81
2 changed files with 13 additions and 14 deletions

View File

@ -130,7 +130,7 @@ void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height )
*
* Create the X11 desktop window for the desktop mode.
*/
Window CDECL X11DRV_create_desktop( UINT width, UINT height )
BOOL CDECL X11DRV_create_desktop( UINT width, UINT height )
{
XSetWindowAttributes win_attr;
Window win;
@ -152,7 +152,9 @@ Window CDECL X11DRV_create_desktop( UINT width, UINT height )
win = XCreateWindow( display, DefaultRootWindow(display),
0, 0, width, height, 0, default_visual.depth, InputOutput, default_visual.visual,
CWEventMask | CWCursor | CWColormap, &win_attr );
if (win != None && width == screen_width && height == screen_height)
if (!win) return FALSE;
if (width == screen_width && height == screen_height)
{
TRACE("setting desktop to fullscreen\n");
XChangeProperty( display, win, x11drv_atom(_NET_WM_STATE), XA_ATOM, 32,
@ -160,8 +162,8 @@ Window CDECL X11DRV_create_desktop( UINT width, UINT height )
1);
}
XFlush( display );
if (win != None) X11DRV_init_desktop( win, width, height );
return win;
X11DRV_init_desktop( win, width, height );
return TRUE;
}

View File

@ -106,13 +106,13 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR
}
}
/* create the desktop and the associated X11 window, and make it the current desktop */
static unsigned long create_desktop( const WCHAR *name, unsigned int width, unsigned int height )
/* create the desktop and the associated driver window, and make it the current desktop */
static BOOL create_desktop( const WCHAR *name, unsigned int width, unsigned int height )
{
static const WCHAR rootW[] = {'r','o','o','t',0};
HDESK desktop;
unsigned long xwin = 0;
unsigned long (CDECL *create_desktop_func)(unsigned int, unsigned int);
BOOL ret = FALSE;
BOOL (CDECL *create_desktop_func)(unsigned int, unsigned int);
desktop = CreateDesktopW( name, NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );
if (!desktop)
@ -124,10 +124,10 @@ static unsigned long create_desktop( const WCHAR *name, unsigned int width, unsi
if (graphics_driver && strcmpiW( name, rootW ))
{
create_desktop_func = (void *)GetProcAddress( graphics_driver, "wine_create_desktop" );
if (create_desktop_func) xwin = create_desktop_func( width, height );
if (create_desktop_func) ret = create_desktop_func( width, height );
}
SetThreadDesktop( desktop );
return xwin;
return ret;
}
/* parse the desktop size specification */
@ -266,7 +266,6 @@ void manage_desktop( WCHAR *arg )
MSG msg;
HDC hdc;
HWND hwnd, msg_hwnd;
unsigned long xwin = 0;
unsigned int width, height;
WCHAR *cmdline = NULL;
WCHAR *p = arg;
@ -299,9 +298,7 @@ void manage_desktop( WCHAR *arg )
hdc = CreateDCW( displayW, NULL, NULL, NULL );
graphics_driver = __wine_get_driver_module( hdc );
if (name && width && height) xwin = create_desktop( name, width, height );
if (!xwin) using_root = TRUE; /* using the root window */
if (name && width && height) using_root = !create_desktop( name, width, height );
/* create the desktop window */
hwnd = CreateWindowExW( 0, DESKTOP_CLASS_ATOM, NULL,