Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11modes.c @ 499:f480ecd70499
Added an aborted try at making fullscreen work on Xinerama screen != 0
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 30 Sep 2002 00:35:25 +0000 |
parents | f6ffac90895c |
children | 31d3af76488b |
comparison
equal
deleted
inserted
replaced
498:4b8ff8ac2c07 | 499:f480ecd70499 |
---|---|
41 | 41 |
42 #ifdef HAVE_XINERAMA | 42 #ifdef HAVE_XINERAMA |
43 #include <XFree86/extensions/Xinerama.h> | 43 #include <XFree86/extensions/Xinerama.h> |
44 #endif | 44 #endif |
45 | 45 |
46 #define MAX(a, b) (a > b ? a : b) | 46 #define MAX(a, b) (a > b ? a : b) |
47 | 47 |
48 #ifdef XFREE86_VM | 48 #ifdef XFREE86_VM |
49 Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info) | 49 Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info) |
50 { | 50 { |
51 SDL_NAME(XF86VidModeModeLine) *l = (SDL_NAME(XF86VidModeModeLine)*)((char*)info + sizeof info->dotclock); | 51 SDL_NAME(XF86VidModeModeLine) *l = (SDL_NAME(XF86VidModeModeLine)*)((char*)info + sizeof info->dotclock); |
124 XFree(modes); | 124 XFree(modes); |
125 } | 125 } |
126 } | 126 } |
127 #endif /* XFREE86_VM */ | 127 #endif /* XFREE86_VM */ |
128 | 128 |
129 /* XiG */ | 129 /* XiG */ |
130 #ifdef HAVE_XIGXME | 130 #ifdef HAVE_XIGXME |
131 #ifdef XIG_DEBUG | 131 #ifdef XIG_DEBUG |
132 fprintf(stderr, "XME: set_best_resolution(): w = %d, h = %d\n", | 132 fprintf(stderr, "XME: set_best_resolution(): w = %d, h = %d\n", |
133 width, height); | 133 width, height); |
134 #endif | 134 #endif |
135 if ( SDL_modelist ) { | 135 if ( SDL_modelist ) { |
136 int i; | 136 int i; |
137 | 137 |
138 for ( i=0; SDL_modelist[i]; ++i ) { | 138 for ( i=0; SDL_modelist[i]; ++i ) { |
139 if ( (SDL_modelist[i]->w >= width) && | 139 if ( (SDL_modelist[i]->w >= width) && |
140 (SDL_modelist[i]->h >= height) ) { | 140 (SDL_modelist[i]->h >= height) ) { |
141 break; | 141 break; |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 if ( SDL_modelist[i] ) { /* found one, lets try it */ | 145 if ( SDL_modelist[i] ) { /* found one, lets try it */ |
146 int w, h; | 146 int w, h; |
147 | 147 |
148 /* check current mode so we can avoid uneccessary mode changes */ | 148 /* check current mode so we can avoid uneccessary mode changes */ |
149 get_real_resolution(this, &w, &h); | 149 get_real_resolution(this, &w, &h); |
150 | 150 |
151 if ( (SDL_modelist[i]->w != w) || (SDL_modelist[i]->h != h) ) { | 151 if ( (SDL_modelist[i]->w != w) || (SDL_modelist[i]->h != h) ) { |
152 # ifdef XIG_DEBUG | 152 # ifdef XIG_DEBUG |
153 fprintf(stderr, "XME: set_best_resolution: " | 153 fprintf(stderr, "XME: set_best_resolution: " |
154 "XiGMiscChangeResolution: %d %d\n", | 154 "XiGMiscChangeResolution: %d %d\n", |
155 SDL_modelist[s]->w, SDL_modelist[s]->h); | 155 SDL_modelist[s]->w, SDL_modelist[s]->h); |
156 # endif | 156 # endif |
157 XiGMiscChangeResolution(SDL_Display, | 157 XiGMiscChangeResolution(SDL_Display, |
158 SDL_Screen, | 158 SDL_Screen, |
159 0, /* view */ | 159 0, /* view */ |
160 SDL_modelist[i]->w, | 160 SDL_modelist[i]->w, |
161 SDL_modelist[i]->h, | 161 SDL_modelist[i]->h, |
162 0); | 162 0); |
163 XSync(SDL_Display, False); | 163 XSync(SDL_Display, False); |
164 } | 164 } |
165 } | 165 } |
166 } | 166 } |
167 #endif /* HAVE_XIGXME */ | 167 #endif /* HAVE_XIGXME */ |
168 | 168 |
187 if ( use_xme ) { | 187 if ( use_xme ) { |
188 int ractive; | 188 int ractive; |
189 XiGMiscResolutionInfo *modelist; | 189 XiGMiscResolutionInfo *modelist; |
190 | 190 |
191 XiGMiscQueryResolutions(SDL_Display, SDL_Screen, | 191 XiGMiscQueryResolutions(SDL_Display, SDL_Screen, |
192 0, /* view */ | 192 0, /* view */ |
193 &ractive, &modelist); | 193 &ractive, &modelist); |
194 *w = modelist[ractive].width; | 194 *w = modelist[ractive].width; |
195 *h = modelist[ractive].height; | 195 *h = modelist[ractive].height; |
196 #ifdef XIG_DEBUG | 196 #ifdef XIG_DEBUG |
197 fprintf(stderr, "XME: get_real_resolution: w = %d h = %d\n", *w, *h); | 197 fprintf(stderr, "XME: get_real_resolution: w = %d h = %d\n", *w, *h); |
198 #endif | 198 #endif |
230 | 230 |
231 static int add_visual(_THIS, int depth, int class) | 231 static int add_visual(_THIS, int depth, int class) |
232 { | 232 { |
233 XVisualInfo vi; | 233 XVisualInfo vi; |
234 if(XMatchVisualInfo(SDL_Display, SDL_Screen, depth, class, &vi)) { | 234 if(XMatchVisualInfo(SDL_Display, SDL_Screen, depth, class, &vi)) { |
235 int n = this->hidden->nvisuals; | 235 int n = this->hidden->nvisuals; |
236 this->hidden->visuals[n].depth = vi.depth; | 236 this->hidden->visuals[n].depth = vi.depth; |
237 this->hidden->visuals[n].visual = vi.visual; | 237 this->hidden->visuals[n].visual = vi.visual; |
238 this->hidden->nvisuals++; | 238 this->hidden->nvisuals++; |
239 } | 239 } |
240 return(this->hidden->nvisuals); | 240 return(this->hidden->nvisuals); |
241 } | 241 } |
242 static int add_visual_byid(_THIS, const char *visual_id) | 242 static int add_visual_byid(_THIS, const char *visual_id) |
243 { | 243 { |
247 if ( visual_id ) { | 247 if ( visual_id ) { |
248 memset(&template, 0, (sizeof template)); | 248 memset(&template, 0, (sizeof template)); |
249 template.visualid = strtol(visual_id, NULL, 0); | 249 template.visualid = strtol(visual_id, NULL, 0); |
250 vi = XGetVisualInfo(SDL_Display, VisualIDMask, &template, &nvis); | 250 vi = XGetVisualInfo(SDL_Display, VisualIDMask, &template, &nvis); |
251 if ( vi ) { | 251 if ( vi ) { |
252 int n = this->hidden->nvisuals; | 252 int n = this->hidden->nvisuals; |
253 this->hidden->visuals[n].depth = vi->depth; | 253 this->hidden->visuals[n].depth = vi->depth; |
254 this->hidden->visuals[n].visual = vi->visual; | 254 this->hidden->visuals[n].visual = vi->visual; |
255 this->hidden->nvisuals++; | 255 this->hidden->nvisuals++; |
256 XFree(vi); | 256 XFree(vi); |
257 } | 257 } |
258 } | 258 } |
259 return(this->hidden->nvisuals); | 259 return(this->hidden->nvisuals); |
260 } | 260 } |
313 if ( SDL_NAME(XF86VidModeQueryExtension)(SDL_Display, &vm_event, &vm_error) && | 313 if ( SDL_NAME(XF86VidModeQueryExtension)(SDL_Display, &vm_event, &vm_error) && |
314 SDL_NAME(XF86VidModeQueryVersion)(SDL_Display, &vm_major, &vm_minor) ) { | 314 SDL_NAME(XF86VidModeQueryVersion)(SDL_Display, &vm_major, &vm_minor) ) { |
315 #ifdef BROKEN_XFREE86_4001 | 315 #ifdef BROKEN_XFREE86_4001 |
316 #ifdef X_XF86VidModeGetDotClocks /* Compiled under XFree86 4.0 */ | 316 #ifdef X_XF86VidModeGetDotClocks /* Compiled under XFree86 4.0 */ |
317 /* Earlier X servers hang when doing vidmode */ | 317 /* Earlier X servers hang when doing vidmode */ |
318 if ( vm_major < 2 ) { | 318 if ( vm_major < 2 ) { |
319 #ifdef XFREE86_DEBUG | 319 #ifdef XFREE86_DEBUG |
320 printf("Compiled under XFree86 4.0, server is XFree86 3.X\n"); | 320 printf("Compiled under XFree86 4.0, server is XFree86 3.X\n"); |
321 #endif | 321 #endif |
322 buggy_X11 = 1; | 322 buggy_X11 = 1; |
323 } | 323 } |
324 #else | 324 #else |
325 /* XFree86 3.X code works with XFree86 4.0 servers */; | 325 /* XFree86 3.X code works with XFree86 4.0 servers */; |
326 #endif /* XFree86 4.0 */ | 326 #endif /* XFree86 4.0 */ |
327 #endif /* XFree86 4.02 and newer are fixed wrt backwards compatibility */ | 327 #endif /* XFree86 4.02 and newer are fixed wrt backwards compatibility */ |
328 } else { | 328 } else { |
329 buggy_X11 = 1; | 329 buggy_X11 = 1; |
330 } | 330 } |
375 use_vidmode = vm_major * 100 + vm_minor; | 375 use_vidmode = vm_major * 100 + vm_minor; |
376 save_mode(this); | 376 save_mode(this); |
377 } | 377 } |
378 #endif /* XFREE86_VM */ | 378 #endif /* XFREE86_VM */ |
379 | 379 |
380 /* XiG */ | 380 /* XiG */ |
381 #ifdef HAVE_XIGXME | 381 #ifdef HAVE_XIGXME |
382 /* first lets make sure we have the extension, and it's at least v2.0 */ | 382 /* first lets make sure we have the extension, and it's at least v2.0 */ |
383 if (XiGMiscQueryVersion(SDL_Display, &xme_major, &xme_minor)) { | 383 if (XiGMiscQueryVersion(SDL_Display, &xme_major, &xme_minor)) { |
384 #ifdef XIG_DEBUG | 384 #ifdef XIG_DEBUG |
385 fprintf(stderr, "XME: XiGMiscQueryVersion: V%d.%d\n", | 385 fprintf(stderr, "XME: XiGMiscQueryVersion: V%d.%d\n", |
386 xme_major, xme_minor); | 386 xme_major, xme_minor); |
387 #endif | 387 #endif |
388 /* work around a XiGMisc bogosity in our version of libXext */ | 388 /* work around a XiGMisc bogosity in our version of libXext */ |
389 if (xme_major == 0 && xme_major == 0) { | 389 if (xme_major == 0 && xme_major == 0) { |
390 /* Ideally libxme would spit this out, but the problem is that | 390 /* Ideally libxme would spit this out, but the problem is that |
391 the right Query func will never be called if using the bogus | 391 the right Query func will never be called if using the bogus |
392 libXext version. | 392 libXext version. |
393 */ | 393 */ |
394 fprintf(stderr, | 394 fprintf(stderr, |
395 "XME: If you are using Xi Graphics CDE and a Summit server, you need to\n" | 395 "XME: If you are using Xi Graphics CDE and a Summit server, you need to\n" |
396 "XME: get the libXext update from our ftp site before fullscreen switching\n" | 396 "XME: get the libXext update from our ftp site before fullscreen switching\n" |
397 "XME: will work. Fullscreen switching is only supported on Summit Servers\n"); | 397 "XME: will work. Fullscreen switching is only supported on Summit Servers\n"); |
398 } | 398 } |
399 } else { | 399 } else { |
400 /* not there. Bummer. */ | 400 /* not there. Bummer. */ |
401 xme_major = xme_minor = 0; | 401 xme_major = xme_minor = 0; |
402 } | 402 } |
403 | 403 |
404 modelist = NULL; | 404 modelist = NULL; |
405 if (xme_major >= 2 && (nummodes = XiGMiscQueryResolutions(SDL_Display, | 405 if (xme_major >= 2 && (nummodes = XiGMiscQueryResolutions(SDL_Display, |
406 SDL_Screen, | 406 SDL_Screen, |
407 0, /* view */ | 407 0, /* view */ |
408 &ractive, | 408 &ractive, |
409 &modelist)) > 1) | 409 &modelist)) > 1) |
410 { /* then we actually have some */ | 410 { /* then we actually have some */ |
411 int j; | 411 int j; |
412 | 412 |
413 #ifdef XIG_DEBUG | 413 #ifdef XIG_DEBUG |
414 fprintf(stderr, "XME: nummodes = %d, active mode = %d\n", | 414 fprintf(stderr, "XME: nummodes = %d, active mode = %d\n", |
415 nummodes, ractive); | 415 nummodes, ractive); |
416 #endif | 416 #endif |
417 | 417 |
418 SDL_modelist = (SDL_Rect **)malloc((nummodes+1)*sizeof(SDL_Rect *)); | 418 SDL_modelist = (SDL_Rect **)malloc((nummodes+1)*sizeof(SDL_Rect *)); |
419 | 419 |
420 /* we get the list already sorted in */ | 420 /* we get the list already sorted in */ |
421 /* descending order. We'll copy it in */ | 421 /* descending order. We'll copy it in */ |
422 /* reverse order so SDL is happy */ | 422 /* reverse order so SDL is happy */ |
423 if (SDL_modelist) { | 423 if (SDL_modelist) { |
424 for ( i=0, j=nummodes-1; j>=0; i++, j-- ) { | 424 for ( i=0, j=nummodes-1; j>=0; i++, j-- ) { |
425 if ((SDL_modelist[i] = | 425 if ((SDL_modelist[i] = |
426 (SDL_Rect *)malloc(sizeof(SDL_Rect))) == NULL) | 426 (SDL_Rect *)malloc(sizeof(SDL_Rect))) == NULL) |
427 break; | 427 break; |
428 #ifdef XIG_DEBUG | 428 #ifdef XIG_DEBUG |
429 fprintf(stderr, "XME: mode = %4d, w = %4d, h = %4d\n", | 429 fprintf(stderr, "XME: mode = %4d, w = %4d, h = %4d\n", |
430 i, modelist[i].width, modelist[i].height); | 430 i, modelist[i].width, modelist[i].height); |
431 #endif | 431 #endif |
432 | 432 |
433 SDL_modelist[i]->x = 0; | 433 SDL_modelist[i]->x = 0; |
434 SDL_modelist[i]->y = 0; | 434 SDL_modelist[i]->y = 0; |
435 SDL_modelist[i]->w = modelist[j].width; | 435 SDL_modelist[i]->w = modelist[j].width; |
436 SDL_modelist[i]->h = modelist[j].height; | 436 SDL_modelist[i]->h = modelist[j].height; |
437 | 437 |
438 } | 438 } |
439 SDL_modelist[i] = NULL; /* terminator */ | 439 SDL_modelist[i] = NULL; /* terminator */ |
440 } | 440 } |
441 use_xme = 1; | 441 use_xme = 1; |
442 saved_res = modelist[ractive]; /* save the current resolution */ | 442 saved_res = modelist[ractive]; /* save the current resolution */ |
443 } else { | 443 } else { |
444 use_xme = 0; | 444 use_xme = 0; |
445 } | 445 } |
446 if ( modelist ) { | 446 if ( modelist ) { |
447 XFree(modelist); | 447 XFree(modelist); |
448 } | 448 } |
449 #endif /* HAVE_XIGXME */ | 449 #endif /* HAVE_XIGXME */ |
450 | 450 |
451 { | 451 { |
452 static int depth_list[] = { 32, 24, 16, 15, 8 }; | 452 static int depth_list[] = { 32, 24, 16, 15, 8 }; |
453 int j, np; | 453 int j, np; |
454 int use_directcolor = 1; | 454 int use_directcolor = 1; |
455 XPixmapFormatValues *pf; | 455 XPixmapFormatValues *pf; |
456 | 456 |
457 /* Search for the visuals in deepest-first order, so that the first | 457 /* Search for the visuals in deepest-first order, so that the first |
458 will be the richest one */ | 458 will be the richest one */ |
459 if ( getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) { | 459 if ( getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) { |
460 use_directcolor = 0; | 460 use_directcolor = 0; |
461 } | 461 } |
462 this->hidden->nvisuals = 0; | 462 this->hidden->nvisuals = 0; |
463 if ( ! add_visual_byid(this, getenv("SDL_VIDEO_X11_VISUALID")) ) { | 463 if ( ! add_visual_byid(this, getenv("SDL_VIDEO_X11_VISUALID")) ) { |
464 for ( i=0; i<SDL_TABLESIZE(depth_list); ++i ) { | 464 for ( i=0; i<SDL_TABLESIZE(depth_list); ++i ) { |
465 if ( depth_list[i] > 8 ) { | 465 if ( depth_list[i] > 8 ) { |
466 if ( use_directcolor ) { | 466 if ( use_directcolor ) { |
467 add_visual(this, depth_list[i], DirectColor); | 467 add_visual(this, depth_list[i], DirectColor); |
468 } | 468 } |
469 add_visual(this, depth_list[i], TrueColor); | 469 add_visual(this, depth_list[i], TrueColor); |
470 } else { | 470 } else { |
471 add_visual(this, depth_list[i], PseudoColor); | 471 add_visual(this, depth_list[i], PseudoColor); |
472 add_visual(this, depth_list[i], StaticColor); | 472 add_visual(this, depth_list[i], StaticColor); |
473 } | 473 } |
474 } | 474 } |
475 } | 475 } |
476 if ( this->hidden->nvisuals == 0 ) { | 476 if ( this->hidden->nvisuals == 0 ) { |
477 SDL_SetError("Found no sufficiently capable X11 visuals"); | 477 SDL_SetError("Found no sufficiently capable X11 visuals"); |
478 return -1; | 478 return -1; |
479 } | 479 } |
480 | 480 |
481 /* look up the pixel quantum for each depth */ | 481 /* look up the pixel quantum for each depth */ |
482 pf = XListPixmapFormats(SDL_Display, &np); | 482 pf = XListPixmapFormats(SDL_Display, &np); |
483 for(i = 0; i < this->hidden->nvisuals; i++) { | 483 for(i = 0; i < this->hidden->nvisuals; i++) { |
484 int d = this->hidden->visuals[i].depth; | 484 int d = this->hidden->visuals[i].depth; |
485 for(j = 0; j < np; j++) | 485 for(j = 0; j < np; j++) |
486 if(pf[j].depth == d) | 486 if(pf[j].depth == d) |
487 break; | 487 break; |
488 this->hidden->visuals[i].bpp = j < np ? pf[j].bits_per_pixel : d; | 488 this->hidden->visuals[i].bpp = j < np ? pf[j].bits_per_pixel : d; |
489 } | 489 } |
490 | 490 |
491 XFree(pf); | 491 XFree(pf); |
492 } | 492 } |
493 | 493 |
494 if ( SDL_modelist == NULL ) { | 494 if ( SDL_modelist == NULL ) { |
495 SDL_modelist = (SDL_Rect **)malloc((1+1)*sizeof(SDL_Rect *)); | 495 SDL_modelist = (SDL_Rect **)malloc((1+1)*sizeof(SDL_Rect *)); |
496 if ( SDL_modelist ) { | 496 if ( SDL_modelist ) { |
533 | 533 |
534 #ifdef HAVE_XINERAMA | 534 #ifdef HAVE_XINERAMA |
535 /* Query Xinerama extention */ | 535 /* Query Xinerama extention */ |
536 if ( SDL_NAME(XineramaQueryExtension)(SDL_Display, &i, &i) && | 536 if ( SDL_NAME(XineramaQueryExtension)(SDL_Display, &i, &i) && |
537 SDL_NAME(XineramaIsActive)(SDL_Display) ) { | 537 SDL_NAME(XineramaIsActive)(SDL_Display) ) { |
538 /* Find out which screen is the zero'th one */ | 538 /* Find out which screen is the desired one */ |
539 int desired = 0; | |
539 int screens; | 540 int screens; |
540 SDL_NAME(XineramaScreenInfo) *xinerama; | 541 SDL_NAME(XineramaScreenInfo) *xinerama; |
541 | 542 |
542 #ifdef XINERAMA_DEBUG | 543 #ifdef XINERAMA_DEBUG |
543 printf("X11 detected Xinerama:\n"); | 544 printf("X11 detected Xinerama:\n"); |
545 #endif | |
546 #if 0 /* Apparently the vidmode extension doesn't work with Xinerama */ | |
547 const char *variable = getenv("SDL_VIDEO_X11_XINERAMA_SCREEN"); | |
548 if ( variable ) { | |
549 desired = atoi(variable); | |
550 } | |
544 #endif | 551 #endif |
545 xinerama = SDL_NAME(XineramaQueryScreens)(SDL_Display, &screens); | 552 xinerama = SDL_NAME(XineramaQueryScreens)(SDL_Display, &screens); |
546 for ( i = 0; i < screens; i++ ) { | 553 for ( i = 0; i < screens; i++ ) { |
547 #ifdef XINERAMA_DEBUG | 554 #ifdef XINERAMA_DEBUG |
548 printf("xinerama %d: %dx%d+%d+%d\n", | 555 printf("xinerama %d: %dx%d+%d+%d\n", |
549 xinerama[i].screen_number, | 556 xinerama[i].screen_number, |
550 xinerama[i].width, xinerama[i].height, | 557 xinerama[i].width, xinerama[i].height, |
551 xinerama[i].x_org, xinerama[i].y_org); | 558 xinerama[i].x_org, xinerama[i].y_org); |
552 #endif | 559 #endif |
553 if ( xinerama[i].screen_number == 0 ) { | 560 if ( xinerama[i].screen_number == desired ) { |
554 xinerama_x = xinerama[i].x_org; | 561 xinerama_x = xinerama[i].x_org; |
555 xinerama_y = xinerama[i].y_org; | 562 xinerama_y = xinerama[i].y_org; |
556 } | 563 } |
557 } | 564 } |
558 XFree(xinerama); | 565 XFree(xinerama); |
564 | 571 |
565 int X11_SupportedVisual(_THIS, SDL_PixelFormat *format) | 572 int X11_SupportedVisual(_THIS, SDL_PixelFormat *format) |
566 { | 573 { |
567 int i; | 574 int i; |
568 for(i = 0; i < this->hidden->nvisuals; i++) | 575 for(i = 0; i < this->hidden->nvisuals; i++) |
569 if(this->hidden->visuals[i].bpp == format->BitsPerPixel) | 576 if(this->hidden->visuals[i].bpp == format->BitsPerPixel) |
570 return 1; | 577 return 1; |
571 return 0; | 578 return 0; |
572 } | 579 } |
573 | 580 |
574 SDL_Rect **X11_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags) | 581 SDL_Rect **X11_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags) |
575 { | 582 { |
670 real_w = MAX(real_w, screen_w); | 677 real_w = MAX(real_w, screen_w); |
671 } | 678 } |
672 if ( current_h > real_h ) { | 679 if ( current_h > real_h ) { |
673 real_h = MAX(real_h, screen_h); | 680 real_h = MAX(real_h, screen_h); |
674 } | 681 } |
675 XMoveResizeWindow(SDL_Display, FSwindow, 0, 0, real_w, real_h); | 682 XMoveResizeWindow(SDL_Display, FSwindow, |
683 xinerama_x, xinerama_y, real_w, real_h); | |
676 XMapRaised(SDL_Display, FSwindow); | 684 XMapRaised(SDL_Display, FSwindow); |
677 X11_WaitMapped(this, FSwindow); | 685 X11_WaitMapped(this, FSwindow); |
678 | 686 |
679 #if 0 /* This seems to break WindowMaker in focus-follows-mouse mode */ | 687 #if 0 /* This seems to break WindowMaker in focus-follows-mouse mode */ |
680 /* Make sure we got to the top of the window stack */ | 688 /* Make sure we got to the top of the window stack */ |
743 SDL_NAME(XF86VidModeLockModeSwitch)(SDL_Display, SDL_Screen, False); | 751 SDL_NAME(XF86VidModeLockModeSwitch)(SDL_Display, SDL_Screen, False); |
744 } | 752 } |
745 #endif | 753 #endif |
746 | 754 |
747 #ifdef HAVE_XIGXME | 755 #ifdef HAVE_XIGXME |
748 if ( use_xme ) { | 756 if ( use_xme ) { |
749 int rw, rh; | 757 int rw, rh; |
750 | 758 |
751 /* check current mode so we can avoid uneccessary mode changes */ | 759 /* check current mode so we can avoid uneccessary mode changes */ |
752 get_real_resolution(this, &rw, &rh); | 760 get_real_resolution(this, &rw, &rh); |
753 | 761 |
754 if (rw != saved_res.width || rh != saved_res.height) { | 762 if (rw != saved_res.width || rh != saved_res.height) { |
755 XiGMiscChangeResolution(SDL_Display, | 763 XiGMiscChangeResolution(SDL_Display, |
756 SDL_Screen, | 764 SDL_Screen, |
757 0, /* view */ | 765 0, /* view */ |
758 saved_res.width, | 766 saved_res.width, |
759 saved_res.height, | 767 saved_res.height, |
760 0); | 768 0); |
761 XSync(SDL_Display, False); | 769 XSync(SDL_Display, False); |
762 } | 770 } |
763 } | 771 } |
764 #endif | 772 #endif |
765 | 773 |
766 XUnmapWindow(SDL_Display, FSwindow); | 774 XUnmapWindow(SDL_Display, FSwindow); |
767 X11_WaitUnmapped(this, FSwindow); | 775 X11_WaitUnmapped(this, FSwindow); |
768 XSync(SDL_Display, True); /* Flush spurious mode change events */ | 776 XSync(SDL_Display, True); /* Flush spurious mode change events */ |