From f9c2d560d40721617d5813fed8bd04af8431c75c Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 22 Aug 2018 19:37:13 +0200 Subject: Fix broken 9a7c0b081fad98bfcfcceff9557781f4b39ec572 Windowsize was wrong when run with nxagent :. Basically three changes: - reference sizeHints and wmHints correctly (no &) - do not use uninitialized wmHints - set wmHints Xutf8SetWMProperties() call instead of separate call --- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 33 +++++++++++++++++------------ 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 11efbf359..036e5b4b8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -853,8 +853,6 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, unsigned long valuemask; XSetWindowAttributes attributes; XWindowAttributes gattributes; - XSizeHints* sizeHints; - XWMHints* wmHints; Mask mask; Bool resetAgentPosition = False; @@ -1870,6 +1868,9 @@ N/A XSelectInput(nxagentDisplay, nxagentFullscreenWindow, mask); } + XSizeHints* sizeHints; + XWMHints* wmHints; + if ((sizeHints = XAllocSizeHints())) { sizeHints->flags = PPosition | PMinSize | PMaxSize; @@ -1898,15 +1899,6 @@ N/A sizeHints->flags |= USSize; } - Xutf8SetWMProperties(nxagentDisplay, - nxagentDefaultWindows[pScreen->myNum], - nxagentWindowName, - nxagentWindowName, - argv , argc , &sizeHints, &wmHints, NULL); - - if (sizeHints) - XFree(sizeHints); - if ((wmHints = XAllocWMHints())) { wmHints->icon_pixmap = nxagentIconPixmap; @@ -1920,9 +1912,24 @@ N/A { wmHints->flags = IconPixmapHint; } + } - XSetWMHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], wmHints); - XFree(wmHints); + Xutf8SetWMProperties(nxagentDisplay, + nxagentDefaultWindows[pScreen->myNum], + nxagentWindowName, + nxagentWindowName, + argv , argc , sizeHints, wmHints, NULL); + + if (sizeHints) + { + XFree(sizeHints); + sizeHints = NULL; + } + + if (wmHints) + { + XFree(wmHints); + wmHints = NULL; } /* -- cgit v1.2.3