diff options
author | Mihai Moldovan <ionic@ionic.de> | 2019-10-10 11:37:04 +0200 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2019-10-10 11:37:04 +0200 |
commit | c68a579eb22fa701a86853db324d8807df845f0e (patch) | |
tree | 343e95ac4cdae50d4aa6bbf14c1519a65f1d423c /nx-X11/programs/Xserver/hw | |
parent | 994305ff43e7165d0aca8510263a969ac2fb1327 (diff) | |
parent | 646e3ce242a00687877259d3b2d7866e0f42f2fb (diff) | |
download | nx-libs-c68a579eb22fa701a86853db324d8807df845f0e.tar.gz nx-libs-c68a579eb22fa701a86853db324d8807df845f0e.tar.bz2 nx-libs-c68a579eb22fa701a86853db324d8807df845f0e.zip |
Merge branch 'uli42-pr/fix_fullscreen_memleak' into 3.6.x
Attributes GH PR #849: https://github.com/ArcticaProject/nx-libs/pull/849
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index c8449675a..2b1146496 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -418,29 +418,23 @@ FIXME: We'll check for ReparentNotify and LeaveNotify events after Window nxagentCreateIconWindow(void) { - XSetWindowAttributes attributes; - unsigned long valuemask; - char* window_name; - XTextProperty windowName; - XSizeHints* sizeHints; - XWMHints* wmHints; - Window w; - Mask mask; - /* * Create icon window. */ - attributes.override_redirect = False; - attributes.colormap = DefaultColormap(nxagentDisplay, DefaultScreen(nxagentDisplay)); - attributes.background_pixmap = nxagentScreenSaverPixmap; - valuemask = CWOverrideRedirect | CWBackPixmap | CWColormap; + XSetWindowAttributes attributes = { + .override_redirect = False, + .colormap = DefaultColormap(nxagentDisplay, DefaultScreen(nxagentDisplay)), + .background_pixmap = nxagentScreenSaverPixmap, + }; + + unsigned long valuemask = CWOverrideRedirect | CWBackPixmap | CWColormap; #ifdef TEST fprintf(stderr, "nxagentCreateIconWindow: Going to create new icon window.\n"); #endif - w = XCreateWindow(nxagentDisplay, DefaultRootWindow(nxagentDisplay), + Window w = XCreateWindow(nxagentDisplay, DefaultRootWindow(nxagentDisplay), 0, 0, 1, 1, 0, DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)), InputOutput, @@ -460,17 +454,17 @@ Window nxagentCreateIconWindow(void) * Set hints to the window manager for the icon window. */ - window_name = nxagentWindowName; - XStringListToTextProperty(&window_name, 1, &windowName); + XSizeHints* sizeHints = XAllocSizeHints(); + XWMHints* wmHints = XAllocWMHints();; - if ((sizeHints = XAllocSizeHints())) + if (sizeHints) { sizeHints->flags = PMinSize | PMaxSize; sizeHints->min_width = sizeHints->max_width = 1; sizeHints->min_height = sizeHints->max_height = 1; } - if ((wmHints = XAllocWMHints())) + if (wmHints) { wmHints->flags = IconPixmapHint | IconMaskHint; wmHints->initial_state = IconicState; @@ -487,6 +481,7 @@ Window nxagentCreateIconWindow(void) } } + char *window_name = nxagentWindowName; Xutf8SetWMProperties(nxagentDisplay, w, window_name, window_name, NULL , 0 , sizeHints, wmHints, NULL); @@ -498,7 +493,7 @@ Window nxagentCreateIconWindow(void) * Enable events from the icon window. */ - mask = nxagentGetDefaultEventMask(); + Mask mask = nxagentGetDefaultEventMask(); XSelectInput(nxagentDisplay, w, (mask & ~(KeyPressMask | KeyReleaseMask)) | StructureNotifyMask); |