diff src/video/x11/SDL_x11wm.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 b5a4ac87b98c
line wrap: on
line diff
--- a/src/video/x11/SDL_x11wm.c	Thu May 04 16:52:53 2006 +0000
+++ b/src/video/x11/SDL_x11wm.c	Fri May 05 05:09:10 2006 +0000
@@ -240,7 +240,7 @@
 	SDL_FreeSurface(sicon);
 }
 
-void X11_SetCaption(_THIS, const char *title, const char *icon)
+void X11_SetCaptionNoLock(_THIS, const char *title, const char *icon)
 {
 	XTextProperty titleprop, iconprop;
 	Status status;
@@ -256,9 +256,6 @@
 	}
 #endif
 
-	/* Lock the event thread, in multi-threading environments */
-	SDL_Lock_EventThread();
-
 	if ( title != NULL ) {
 		char *title_latin1 = SDL_iconv_utf8_latin1((char *)title);
 		if ( !title_latin1 ) {
@@ -306,7 +303,12 @@
 #endif
 	}
 	XSync(SDL_Display, False);
+}
 
+void X11_SetCaption(_THIS, const char *title, const char *icon)
+{
+	SDL_Lock_EventThread();
+	X11_SetCaptionNoLock(this, title, icon);
 	SDL_Unlock_EventThread();
 }
 
@@ -332,13 +334,6 @@
 	if ( ! SDL_Window ) {
 		return(mode);	/* Will be set later on mode switch */
 	}
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-        /* FIXME: Is this okay?
-        if ( use_xinerama ) {
-            mode &= ~SDL_GRAB_FULLSCREEN;
-        }
-        */
-#endif
 	if ( mode == SDL_GRAB_OFF ) {
 		XUngrabPointer(SDL_Display, CurrentTime);
 		XUngrabKeyboard(SDL_Display, CurrentTime);
@@ -351,7 +346,7 @@
 #if 0 /* We'll wait here until we actually grab, otherwise behavior undefined */
 		for ( numtries = 0; numtries < 10; ++numtries ) {
 #else
-		while ( 1 ) {
+		for ( ; ; ) {
 #endif
 			result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
 						GrabModeAsync, GrabModeAsync,