From 2fdbeefc9693fe4af2ec9b9581311442f141633e Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 28 May 2009 15:00:10 +0900 Subject: [PATCH] winex11.drv: Avoid a crash if not in a desktop mode. --- dlls/winex11.drv/desktop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 5b96e33b759..a2bc00486d7 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -137,6 +137,8 @@ Window CDECL X11DRV_create_desktop( UINT width, UINT height ) Window win; Display *display = thread_init_display(); + TRACE( "%u x %u\n", width, height ); + wine_tsx11_lock(); /* Create window */ @@ -206,7 +208,7 @@ static void update_desktop_fullscreen( unsigned int width, unsigned int height) Display *display = thread_display(); XEvent xev; - wine_tsx11_lock(); + if (!display || root_window != DefaultRootWindow( display )) return; xev.xclient.type = ClientMessage; xev.xclient.window = root_window; @@ -225,9 +227,9 @@ static void update_desktop_fullscreen( unsigned int width, unsigned int height) TRACE("action=%li\n", xev.xclient.data.l[0]); + wine_tsx11_lock(); XSendEvent( display, DefaultRootWindow(display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev ); - wine_tsx11_unlock(); }