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

Commit

Permalink
Fixed bug where desktop resolution was never restored if Xinerama was…
Browse files Browse the repository at this point in the history
… enabled.
  • Loading branch information
slouken committed Sep 28, 2012
1 parent c6ab260 commit 9d1a86b
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions src/video/x11/SDL_x11modes.c
Expand Up @@ -596,15 +596,6 @@ static void
get_real_resolution(Display * display, SDL_DisplayData * data, int *w, int *h,
int *rate)
{
#if SDL_VIDEO_DRIVER_X11_XINERAMA
if (data->use_xinerama) {
*w = data->xinerama_info.width;
*h = data->xinerama_info.height;
*rate = 0;
return;
}
#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */

#if SDL_VIDEO_DRIVER_X11_XRANDR
if (data->use_xrandr) {
int nsizes;
Expand Down Expand Up @@ -644,6 +635,15 @@ get_real_resolution(Display * display, SDL_DisplayData * data, int *w, int *h,
}
#endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */

#if SDL_VIDEO_DRIVER_X11_XINERAMA
if (data->use_xinerama) {
*w = data->xinerama_info.width;
*h = data->xinerama_info.height;
*rate = 0;
return;
}
#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */

*w = DisplayWidth(display, data->screen);
*h = DisplayHeight(display, data->screen);
*rate = 0;
Expand All @@ -658,15 +658,9 @@ set_best_resolution(Display * display, SDL_DisplayData * data, int w, int h,
/* check current mode so we can avoid uneccessary mode changes */
get_real_resolution(display, data, &real_w, &real_h, &real_rate);

#if SDL_VIDEO_DRIVER_X11_XINERAMA
if (w == real_w && h == real_h && (data->use_xinerama || !rate || rate == real_rate)) {
if (w == real_w && h == real_h && (!rate || !real_rate || rate == real_rate)) {
return;
}
#else
if (w == real_w && h == real_h && (!rate || rate == real_rate)) {
return;
}
#endif

#if SDL_VIDEO_DRIVER_X11_XRANDR
if (data->use_xrandr) {
Expand Down

0 comments on commit 9d1a86b

Please sign in to comment.