Commit 209c8d8c authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Screen.c: harmonize size/wmhints code

parent 4b9466ff
...@@ -454,8 +454,6 @@ Window nxagentCreateIconWindow(void) ...@@ -454,8 +454,6 @@ Window nxagentCreateIconWindow(void)
*/ */
XSizeHints* sizeHints = XAllocSizeHints(); XSizeHints* sizeHints = XAllocSizeHints();
XWMHints* wmHints = XAllocWMHints();;
if (sizeHints) if (sizeHints)
{ {
sizeHints->flags = PMinSize | PMaxSize; sizeHints->flags = PMinSize | PMaxSize;
...@@ -463,27 +461,23 @@ Window nxagentCreateIconWindow(void) ...@@ -463,27 +461,23 @@ Window nxagentCreateIconWindow(void)
sizeHints->min_height = sizeHints->max_height = 1; sizeHints->min_height = sizeHints->max_height = 1;
} }
XWMHints* wmHints = XAllocWMHints();;
if (wmHints) if (wmHints)
{ {
wmHints->flags = IconPixmapHint | IconMaskHint; wmHints->flags = StateHint | IconPixmapHint;
wmHints->initial_state = IconicState; wmHints->initial_state = IconicState;
wmHints->icon_pixmap = nxagentIconPixmap; wmHints->icon_pixmap = nxagentIconPixmap;
if (useXpmIcon) if (useXpmIcon)
{ {
wmHints->flags |= IconMaskHint;
wmHints->icon_mask = nxagentIconShape; wmHints->icon_mask = nxagentIconShape;
wmHints->flags = IconPixmapHint | IconMaskHint;
}
else
{
wmHints->flags = StateHint | IconPixmapHint;
} }
} }
char *window_name = nxagentWindowName;
Xutf8SetWMProperties(nxagentDisplay, w, Xutf8SetWMProperties(nxagentDisplay, w,
window_name, window_name, nxagentWindowName, nxagentWindowName,
NULL , 0 , sizeHints, wmHints, NULL); NULL , 0 , sizeHints, wmHints, NULL);
SAFE_XFree(sizeHints); SAFE_XFree(sizeHints);
SAFE_XFree(wmHints); SAFE_XFree(wmHints);
...@@ -1901,10 +1895,8 @@ N/A ...@@ -1901,10 +1895,8 @@ N/A
XSelectInput(nxagentDisplay, nxagentFullscreenWindow, mask); XSelectInput(nxagentDisplay, nxagentFullscreenWindow, mask);
} }
XSizeHints* sizeHints; XSizeHints* sizeHints = XAllocSizeHints();
XWMHints* wmHints; if (sizeHints)
if ((sizeHints = XAllocSizeHints()))
{ {
sizeHints->flags = PPosition | PMinSize | PMaxSize; sizeHints->flags = PPosition | PMinSize | PMaxSize;
sizeHints->x = nxagentOption(X) + POSITION_OFFSET; sizeHints->x = nxagentOption(X) + POSITION_OFFSET;
...@@ -1932,18 +1924,16 @@ N/A ...@@ -1932,18 +1924,16 @@ N/A
sizeHints->flags |= USSize; sizeHints->flags |= USSize;
} }
if ((wmHints = XAllocWMHints())) XWMHints* wmHints = XAllocWMHints();
if (wmHints)
{ {
wmHints->flags = IconPixmapHint;
wmHints->icon_pixmap = nxagentIconPixmap; wmHints->icon_pixmap = nxagentIconPixmap;
if (useXpmIcon) if (useXpmIcon)
{ {
wmHints->flags |= IconMaskHint;
wmHints->icon_mask = nxagentIconShape; wmHints->icon_mask = nxagentIconShape;
wmHints->flags = IconPixmapHint | IconMaskHint;
}
else
{
wmHints->flags = IconPixmapHint;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment