diff src/video/x11/SDL_x11video.c @ 1767:ae9f6be81810

Fixed bug #196 Use the title and icon stored in the SDL video info, when creating X11 windows.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 05 May 2006 05:09:10 +0000
parents c2c6ff414ef5
children c546353b1ad4
line wrap: on
line diff
--- a/src/video/x11/SDL_x11video.c	Thu May 04 16:52:53 2006 +0000
+++ b/src/video/x11/SDL_x11video.c	Fri May 05 05:09:10 2006 +0000
@@ -311,18 +311,13 @@
 static void create_aux_windows(_THIS)
 {
     int x = 0, y = 0;
-    Atom _NET_WM_NAME;
-    Atom _NET_WM_ICON_NAME;
     char classname[1024];
     XSetWindowAttributes xattr;
     XWMHints *hints;
-    XTextProperty titleprop, titlepropUTF8, iconprop, iconpropUTF8;
     int def_vis = (SDL_Visual == DefaultVisual(SDL_Display, SDL_Screen));
 
     /* Look up some useful Atoms */
     WM_DELETE_WINDOW = XInternAtom(SDL_Display, "WM_DELETE_WINDOW", False);
-    _NET_WM_NAME = XInternAtom(SDL_Display, "_NET_WM_NAME", False);
-    _NET_WM_ICON_NAME = XInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False);
 
     /* Don't create any extra windows if we are being managed */
     if ( SDL_windowid ) {
@@ -372,15 +367,9 @@
     }
 
     hints = NULL;
-    titleprop.value = titlepropUTF8.value = NULL;
-    iconprop.value = iconpropUTF8.value = NULL;
     if(WMwindow) {
 	/* All window attributes must survive the recreation */
 	hints = XGetWMHints(SDL_Display, WMwindow);
-	XGetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
-	XGetTextProperty(SDL_Display, WMwindow, &titlepropUTF8, _NET_WM_NAME);
-	XGetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
-	XGetTextProperty(SDL_Display, WMwindow, &iconpropUTF8, _NET_WM_ICON_NAME);
 	XDestroyWindow(SDL_Display, WMwindow);
     }
 
@@ -400,22 +389,7 @@
     }
     XSetWMHints(SDL_Display, WMwindow, hints);
     XFree(hints);
-    if(titleprop.value) {
-	XSetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
-	XFree(titleprop.value);
-    }
-    if(titlepropUTF8.value) {
-	XSetTextProperty(SDL_Display, WMwindow, &titlepropUTF8, _NET_WM_NAME);
-	XFree(titlepropUTF8.value);
-    }
-    if(iconprop.value) {
-	XSetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
-	XFree(iconprop.value);
-    }
-    if(iconpropUTF8.value) {
-	XSetTextProperty(SDL_Display, WMwindow, &iconpropUTF8, _NET_WM_ICON_NAME);
-	XFree(iconpropUTF8.value);
-    }
+    X11_SetCaptionNoLock(this, this->wm_title, this->wm_icon);
 
     XSelectInput(SDL_Display, WMwindow,
 		 FocusChangeMask | KeyPressMask | KeyReleaseMask