xrandr: move restore resolution to separated function because it makes a mess...

This commit is contained in:
Deve 2014-08-20 19:36:44 +02:00
parent 56fa56a38f
commit c2cf83bb6a
2 changed files with 56 additions and 50 deletions

View File

@ -194,7 +194,7 @@ CIrrDeviceLinux::~CIrrDeviceLinux()
}
// Reset fullscreen resolution change
switchToFullscreen(true);
restoreResolution();
if (!ExternalWindow)
{
@ -235,13 +235,11 @@ int IrrPrintXError(Display *display, XErrorEvent *event)
}
#endif
bool CIrrDeviceLinux::switchToFullscreen(bool reset)
bool CIrrDeviceLinux::restoreResolution()
{
if (!CreationParams.Fullscreen)
return true;
if (reset)
{
#ifdef _IRR_LINUX_X11_VIDMODE_
if (UseXVidMode && CreationParams.Fullscreen)
{
@ -287,9 +285,16 @@ bool CIrrDeviceLinux::switchToFullscreen(bool reset)
}
#endif
return true;
}
}
bool CIrrDeviceLinux::switchToFullscreen()
{
if (!CreationParams.Fullscreen)
return true;
getVideoModeList();
#if defined(_IRR_LINUX_X11_VIDMODE_) || defined(_IRR_LINUX_X11_RANDR_)
s32 eventbase, errorbase;
s32 bestMode = -1;

View File

@ -150,7 +150,8 @@ namespace irr
void initXAtoms();
bool switchToFullscreen(bool reset=false);
bool restoreResolution();
bool switchToFullscreen();
//! Implementation of the linux cursor control
class CCursorControl : public gui::ICursorControl