xrandr: move restore resolution to separated function because it makes a mess...
This commit is contained in:
parent
56fa56a38f
commit
c2cf83bb6a
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user