Alexandre Julliard : explorer: Return a simple boolean instead of a window in the wine_create_desktop entry point .
Alexandre Julliard
julliard at winehq.org
Wed Feb 6 13:38:12 CST 2013
Module: wine
Branch: master
Commit: a73c5d5c8134ee87a98fc0ea7b7401a3518e08b9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a73c5d5c8134ee87a98fc0ea7b7401a3518e08b9
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Feb 6 12:49:41 2013 +0100
explorer: Return a simple boolean instead of a window in the wine_create_desktop entry point.
---
dlls/winex11.drv/desktop.c | 10 ++++++----
programs/explorer/desktop.c | 17 +++++++----------
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c
index 8d9de20..5fbb860 100644
--- a/dlls/winex11.drv/desktop.c
+++ b/dlls/winex11.drv/desktop.c
@@ -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;
}
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index a4f21bf..3e01f9f 100644
--- a/programs/explorer/desktop.c
+++ b/programs/explorer/desktop.c
@@ -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,
More information about the wine-cvs
mailing list