+ }
+
+ win = XCreateWindow(vidx11_display, root, 0, 0, mode->width, mode->height, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr);
+
+ xpm = (char *) FS_LoadFile("darkplaces-icon.xpm", tempmempool, false, NULL);
+ idata = NULL;
+ if(xpm)
+ idata = XPM_DecodeString(xpm);
+ if(!idata)
+ idata = ENGINE_ICON;
+
+ wmhints = XAllocWMHints();
+ if(XpmCreatePixmapFromData(vidx11_display, win,
+ idata,
+ &wmhints->icon_pixmap, &wmhints->icon_mask, NULL) == XpmSuccess)
+ wmhints->flags |= IconPixmapHint | IconMaskHint;
+
+ if(xpm)
+ Mem_Free(xpm);
+
+ clshints = XAllocClassHint();
+ clshints->res_name = strdup(gamename);
+ clshints->res_class = strdup("DarkPlaces");
+
+ szhints = XAllocSizeHints();
+ if(vid_resizable.integer == 0 && !vid_isnetwmfullscreen)
+ {
+ szhints->min_width = szhints->max_width = mode->width;
+ szhints->min_height = szhints->max_height = mode->height;
+ szhints->flags |= PMinSize | PMaxSize;
+ }
+
+ XmbSetWMProperties(vidx11_display, win, gamename, gamename, (char **) com_argv, com_argc, szhints, wmhints, clshints);
+ // strdup() allocates using malloc(), should be freed with free()
+ free(clshints->res_name);
+ free(clshints->res_class);
+ XFree(clshints);
+ XFree(wmhints);
+ XFree(szhints);