Added an environment variable SDL_VIDEO_X11_WMCLASS
authorSam Lantinga <slouken@libsdl.org>
Mon, 19 Aug 2002 03:40:44 +0000
changeset 449 8a687496061f
parent 448 323c766f5a46
child 450 8a43e0cbf02f
Added an environment variable SDL_VIDEO_X11_WMCLASS
src/video/x11/SDL_x11video.c
--- a/src/video/x11/SDL_x11video.c	Mon Aug 19 03:09:25 2002 +0000
+++ b/src/video/x11/SDL_x11video.c	Mon Aug 19 03:40:44 2002 +0000
@@ -350,8 +350,12 @@
 	XClassHint *classhints;
 	classhints = XAllocClassHint();
 	if(classhints != NULL) {
-	    classhints->res_name = "SDL_App";
-	    classhints->res_class = "SDL_App";
+            char *classname = getenv("SDL_VIDEO_X11_WMCLASS");
+            if ( ! classname ) {
+                classname = "SDL_App";
+            }
+	    classhints->res_name = classname;
+	    classhints->res_class = classname;
 	    XSetClassHint(SDL_Display, WMwindow, classhints);
 	    XFree(classhints);
 	}