Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

When using Xinerama, XVidMode always works on screen 0. Otherwise use…

… the real X11 screen.
  • Loading branch information
slouken committed Oct 6, 2012
1 parent e5ed580 commit f0918ca04286f76c370b063c961dc3709087d8ef
Showing with 12 additions and 3 deletions.
  1. +8 −3 src/video/x11/SDL_x11modes.c
  2. +4 −0 src/video/x11/SDL_x11modes.h
@@ -573,7 +573,12 @@ X11_InitModes(_THIS)
#endif
use_vidmode) {
displaydata->use_vidmode = use_vidmode;
XF86VidModeGetModeInfo(data->display, screen, &modedata->vm_mode);
if (displaydata->use_xinerama) {
displaydata->vidmode_screen = 0;
} else {
displaydata->vidmode_screen = screen;
}
XF86VidModeGetModeInfo(data->display, displaydata->vidmode_screen, &modedata->vm_mode);
}
#endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */

@@ -674,7 +679,7 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display)

#if SDL_VIDEO_DRIVER_X11_XVIDMODE
if (data->use_vidmode &&
XF86VidModeGetAllModeLines(display, data->screen, &nmodes, &modes)) {
XF86VidModeGetAllModeLines(display, data->vidmode_screen, &nmodes, &modes)) {
int i;

#ifdef X11MODES_DEBUG
@@ -767,7 +772,7 @@ X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode

#if SDL_VIDEO_DRIVER_X11_XVIDMODE
if (data->use_vidmode) {
XF86VidModeSwitchToMode(display, data->screen, &modedata->vm_mode);
XF86VidModeSwitchToMode(display, data->vidmode_screen, &modedata->vm_mode);
}
#endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */

@@ -45,6 +45,10 @@ typedef struct
RROutput xrandr_output;
#endif

#if SDL_VIDEO_DRIVER_X11_XVIDMODE
int vidmode_screen;
#endif

} SDL_DisplayData;

typedef struct

0 comments on commit f0918ca

Please sign in to comment.