Added a condition for checking display configuration (cloned/extended)

preferencesAboutTextFull
Craig Watson 8 years ago
parent c3e8e6397c
commit 4698cb49f5
  1. 12
      src/core/UBDisplayManager.cpp

@ -118,24 +118,22 @@ UBDisplayManager::~UBDisplayManager()
int UBDisplayManager::numScreens() int UBDisplayManager::numScreens()
{ {
if (mUseMultiScreen) if (mUseMultiScreen) {
{
int screenCount = mDesktop->screenCount(); int screenCount = mDesktop->screenCount();
// Some window managers report two screens when the two monitors are in "cloned" mode; this hack ensures // Some window managers report two screens when the two monitors are in "cloned" mode; this hack ensures
// that we consider this as just one screen. // that we consider this as just one screen. On most desktops, at least one of the following conditions is
// a good indicator of the displays being in cloned or extended mode.
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
if (screenCount > 1 if (screenCount > 1
&& (mDesktop->screenNumber(mDesktop->screen(0)) == mDesktop->screenNumber(mDesktop->screen(1)))) && (mDesktop->screenNumber(mDesktop->screen(0)) == mDesktop->screenNumber(mDesktop->screen(1))
|| mDesktop->screenGeometry(0) == mDesktop->screenGeometry(1)))
return 1; return 1;
else
#endif #endif
return screenCount; return screenCount;
} }
else else
{
return 1; return 1;
} }
}
int UBDisplayManager::numPreviousViews() int UBDisplayManager::numPreviousViews()

Loading…
Cancel
Save