Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
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 f0918ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/video/x11/SDL_x11modes.c
Expand Up @@ -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 */

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 */

Expand Down
4 changes: 4 additions & 0 deletions src/video/x11/SDL_x11modes.h
Expand Up @@ -45,6 +45,10 @@ typedef struct
RROutput xrandr_output;
#endif

#if SDL_VIDEO_DRIVER_X11_XVIDMODE
int vidmode_screen;
#endif

} SDL_DisplayData;

typedef struct
Expand Down

0 comments on commit f0918ca

Please sign in to comment.