comparison src/video/x11/SDL_x11wm.c @ 1659:14717b52abc0 SDL-1.3

Merge trunk-1.3-3
author Sam Lantinga <slouken@libsdl.org>
date Wed, 17 May 2006 08:18:28 +0000
parents 3ba88cb7eb1b
children 782fd950bd46
comparison
equal deleted inserted replaced
1658:e49147870aac 1659:14717b52abc0
238 done: 238 done:
239 SDL_Unlock_EventThread(); 239 SDL_Unlock_EventThread();
240 SDL_FreeSurface(sicon); 240 SDL_FreeSurface(sicon);
241 } 241 }
242 242
243 void X11_SetCaption(_THIS, const char *title, const char *icon) 243 void X11_SetCaptionNoLock(_THIS, const char *title, const char *icon)
244 { 244 {
245 XTextProperty titleprop, iconprop; 245 XTextProperty titleprop, iconprop;
246 Status status; 246 Status status;
247 247
248 #ifdef X_HAVE_UTF8_STRING 248 #ifdef X_HAVE_UTF8_STRING
253 if (SDL_X11_HAVE_UTF8) { 253 if (SDL_X11_HAVE_UTF8) {
254 _NET_WM_NAME = XInternAtom(SDL_Display, "_NET_WM_NAME", False); 254 _NET_WM_NAME = XInternAtom(SDL_Display, "_NET_WM_NAME", False);
255 _NET_WM_ICON_NAME = XInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False); 255 _NET_WM_ICON_NAME = XInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False);
256 } 256 }
257 #endif 257 #endif
258
259 /* Lock the event thread, in multi-threading environments */
260 SDL_Lock_EventThread();
261 258
262 if ( title != NULL ) { 259 if ( title != NULL ) {
263 char *title_latin1 = SDL_iconv_utf8_latin1((char *)title); 260 char *title_latin1 = SDL_iconv_utf8_latin1((char *)title);
264 if ( !title_latin1 ) { 261 if ( !title_latin1 ) {
265 SDL_OutOfMemory(); 262 SDL_OutOfMemory();
304 } 301 }
305 } 302 }
306 #endif 303 #endif
307 } 304 }
308 XSync(SDL_Display, False); 305 XSync(SDL_Display, False);
309 306 }
307
308 void X11_SetCaption(_THIS, const char *title, const char *icon)
309 {
310 SDL_Lock_EventThread();
311 X11_SetCaptionNoLock(this, title, icon);
310 SDL_Unlock_EventThread(); 312 SDL_Unlock_EventThread();
311 } 313 }
312 314
313 /* Iconify the window */ 315 /* Iconify the window */
314 int X11_IconifyWindow(_THIS) 316 int X11_IconifyWindow(_THIS)
342 } 344 }
343 /* Try to grab the mouse */ 345 /* Try to grab the mouse */
344 #if 0 /* We'll wait here until we actually grab, otherwise behavior undefined */ 346 #if 0 /* We'll wait here until we actually grab, otherwise behavior undefined */
345 for ( numtries = 0; numtries < 10; ++numtries ) { 347 for ( numtries = 0; numtries < 10; ++numtries ) {
346 #else 348 #else
347 while ( 1 ) { 349 for ( ; ; ) {
348 #endif 350 #endif
349 result = XGrabPointer(SDL_Display, SDL_Window, True, 0, 351 result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
350 GrabModeAsync, GrabModeAsync, 352 GrabModeAsync, GrabModeAsync,
351 SDL_Window, None, CurrentTime); 353 SDL_Window, None, CurrentTime);
352 if ( result == GrabSuccess ) { 354 if ( result == GrabSuccess ) {