diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2020-01-04 16:22:24 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-01-06 00:50:30 +0100 |
commit | 209c8d8c5d71ebdc4390059c5e4378a0d60ef368 (patch) | |
tree | 2502716a8616f6a82f42d182416cbc52a0ea4b5c | |
parent | 4b9466ff5c031ba2076cba20b41fb26787338dbe (diff) | |
download | nx-libs-209c8d8c5d71ebdc4390059c5e4378a0d60ef368.tar.gz nx-libs-209c8d8c5d71ebdc4390059c5e4378a0d60ef368.tar.bz2 nx-libs-209c8d8c5d71ebdc4390059c5e4378a0d60ef368.zip |
Screen.c: harmonize size/wmhints code
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 33add9cb5..2ed7d9593 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -454,8 +454,6 @@ Window nxagentCreateIconWindow(void) */ XSizeHints* sizeHints = XAllocSizeHints(); - XWMHints* wmHints = XAllocWMHints();; - if (sizeHints) { sizeHints->flags = PMinSize | PMaxSize; @@ -463,27 +461,23 @@ Window nxagentCreateIconWindow(void) sizeHints->min_height = sizeHints->max_height = 1; } + XWMHints* wmHints = XAllocWMHints();; if (wmHints) { - wmHints->flags = IconPixmapHint | IconMaskHint; + wmHints->flags = StateHint | IconPixmapHint; wmHints->initial_state = IconicState; wmHints->icon_pixmap = nxagentIconPixmap; if (useXpmIcon) { + wmHints->flags |= IconMaskHint; wmHints->icon_mask = nxagentIconShape; - wmHints->flags = IconPixmapHint | IconMaskHint; - } - else - { - wmHints->flags = StateHint | IconPixmapHint; } } - char *window_name = nxagentWindowName; Xutf8SetWMProperties(nxagentDisplay, w, - window_name, window_name, - NULL , 0 , sizeHints, wmHints, NULL); + nxagentWindowName, nxagentWindowName, + NULL , 0 , sizeHints, wmHints, NULL); SAFE_XFree(sizeHints); SAFE_XFree(wmHints); @@ -1901,10 +1895,8 @@ N/A XSelectInput(nxagentDisplay, nxagentFullscreenWindow, mask); } - XSizeHints* sizeHints; - XWMHints* wmHints; - - if ((sizeHints = XAllocSizeHints())) + XSizeHints* sizeHints = XAllocSizeHints(); + if (sizeHints) { sizeHints->flags = PPosition | PMinSize | PMaxSize; sizeHints->x = nxagentOption(X) + POSITION_OFFSET; @@ -1932,18 +1924,16 @@ N/A sizeHints->flags |= USSize; } - if ((wmHints = XAllocWMHints())) + XWMHints* wmHints = XAllocWMHints(); + if (wmHints) { + wmHints->flags = IconPixmapHint; wmHints->icon_pixmap = nxagentIconPixmap; if (useXpmIcon) { + wmHints->flags |= IconMaskHint; wmHints->icon_mask = nxagentIconShape; - wmHints->flags = IconPixmapHint | IconMaskHint; - } - else - { - wmHints->flags = IconPixmapHint; } } |