From e61c8c85cc11dad063da23fb2f1d031c574166f5 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan <ïonic@ionic.de> Date: Sat, 9 Jul 2016 03:28:27 +0000 Subject: nx-X11/programs/Xserver/hw/nxagent/Display.c: split up nxagentCheckForPixmapFormatsCompatibility() and nxagentInitPixmapFormats(). Don't implicitly call the checking function in the init function (and throw away the checking functions result...) Instead, explicitly use the checking function after the init function in other parts of the code and throw away the checking functions return value selectively or actually use it while reconnecting. This is totally different behavior compared to the original one. Hopefully it doesn't cause any problems (i.e., hopefully there was no good reason for never using the checking functions return value, but an oversight.) --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 382cdf3c1..1cd3c25d9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1347,6 +1347,7 @@ FIXME: Use of nxagentParentWindow is strongly deprecated. nxagentInitDepths(); nxagentInitPixmapFormats(); + (void) nxagentCheckForPixmapFormatsCompatibility(); /* * Create a pixmap for each depth matching the @@ -1727,8 +1728,6 @@ XXX: Some X server doesn't list 1 among available depths... } } #endif - - nxagentCheckForPixmapFormatsCompatibility(); } void nxagentSetDefaultDrawables() @@ -2838,11 +2837,16 @@ Bool nxagentReconnectDisplay(void *p0) * formats are supported. */ - /* - * FIXME: add an actual check here (and pass check value through nxagentInitPixmapFormats().) - */ nxagentInitPixmapFormats(); + if (nxagentCheckForPixmapFormatsCompatibility() == 0) + { + nxagentSetReconnectError(FAILED_RESUME_PIXMAPS_ALERT, + "Couldn't restore all the required pixmap formats."); + + return False; + } + reconnectDisplayState = GOT_PIXMAP_FORMAT_LIST; /* -- cgit v1.2.3