From 5ed890904b7d890bfa1682dff465758d10a7ef96 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 11 Jul 2012 17:35:44 +0200 Subject: [PATCH] winex11: Simplify X11DRV_XRandR_Init() error handling a bit. --- dlls/winex11.drv/xrandr.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 53d16c95bbc..ccb004f6cb2 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -277,18 +277,15 @@ void X11DRV_XRandR_Init(void) /* see if Xrandr is available */ wine_tsx11_lock(); - ok = pXRRQueryExtension(gdi_display, &xrandr_event, &xrandr_error); - if (ok) - { - X11DRV_expect_error(gdi_display, XRandRErrorHandler, NULL); - ok = pXRRQueryVersion(gdi_display, &xrandr_major, &xrandr_minor); - if (X11DRV_check_error()) ok = FALSE; - } - if (ok) - { - TRACE("Found XRandR - major: %d, minor: %d\n", xrandr_major, xrandr_minor); - xrandr_init_modes(); - } + if (!pXRRQueryExtension( gdi_display, &xrandr_event, &xrandr_error )) goto done; + X11DRV_expect_error( gdi_display, XRandRErrorHandler, NULL ); + ok = pXRRQueryVersion( gdi_display, &xrandr_major, &xrandr_minor ); + if (X11DRV_check_error() || !ok) goto done; + + TRACE("Found XRandR %d.%d.\n", xrandr_major, xrandr_minor); + xrandr_init_modes(); + +done: wine_tsx11_unlock(); }