@@ -425,10 +425,12 @@ static bool X11_MessageBoxCreateWindow(SDL_MessageBoxDataX11 *data)
425
425
Display * display = data -> display ;
426
426
SDL_WindowData * windowdata = NULL ;
427
427
const SDL_MessageBoxData * messageboxdata = data -> messageboxdata ;
428
+ #ifdef SDL_VIDEO_DRIVER_X11_XRANDR
428
429
#ifdef XRANDR_DISABLED_BY_DEFAULT
429
430
const bool use_xrandr_by_default = false;
430
431
#else
431
432
const bool use_xrandr_by_default = true;
433
+ #endif
432
434
#endif
433
435
434
436
if (messageboxdata -> window ) {
@@ -502,12 +504,16 @@ static bool X11_MessageBoxCreateWindow(SDL_MessageBoxDataX11 *data)
502
504
const SDL_DisplayData * dpydata = dpy -> internal ;
503
505
x = dpydata -> x + ((dpy -> current_mode -> w - data -> dialog_width ) / 2 );
504
506
y = dpydata -> y + ((dpy -> current_mode -> h - data -> dialog_height ) / 3 );
505
- } else if (SDL_GetHintBoolean (SDL_HINT_VIDEO_X11_XRANDR , use_xrandr_by_default )) {
507
+ }
508
+ #ifdef SDL_VIDEO_DRIVER_X11_XRANDR
509
+ else if (SDL_GetHintBoolean (SDL_HINT_VIDEO_X11_XRANDR , use_xrandr_by_default )) {
506
510
XRRScreenResources * screen = X11_XRRGetScreenResourcesCurrent (display , DefaultRootWindow (display ));
507
511
XRRCrtcInfo * crtc_info = X11_XRRGetCrtcInfo (display , screen , screen -> crtcs [0 ]);
508
512
x = (crtc_info -> width - data -> dialog_width ) / 2 ;
509
513
y = (crtc_info -> height - data -> dialog_height ) / 3 ;
510
- } else {
514
+ }
515
+ #endif
516
+ else {
511
517
// oh well. This will misposition on a multi-head setup. Init first next time.
512
518
x = (DisplayWidth (display , data -> screen ) - data -> dialog_width ) / 2 ;
513
519
y = (DisplayHeight (display , data -> screen ) - data -> dialog_height ) / 3 ;
0 commit comments