Base fullscreen detection on window decoration
rather than window size, since the size of full screen windows can change: e.g. Xinerama mode automatically resizes fullscreen windows to cover the area belonging to a single display only - so the "(Xinerama) screen area == window size" check always failed - even in fullscreen mode.
This commit is contained in:
parent
7ed8b625c9
commit
57410852b9
1 changed files with 9 additions and 2 deletions
|
@ -345,10 +345,17 @@ void fgOSFullScreen()
|
|||
int height;
|
||||
window->getWindowRectangle(x, y, width, height);
|
||||
|
||||
bool isFullScreen = x == 0 && y == 0 && width == (int)screenWidth && height == (int)screenHeight;
|
||||
/* Note: the simple "is window size == screen size" check to detect full screen state doesn't work with
|
||||
* X screen servers in Xinerama mode, since the reported screen width (or height) exceeds the maximum width
|
||||
* (or height) usable by a single window (Xserver automatically shrinks/moves the full screen window to fit a
|
||||
* single display) - so we detect full screen mode using "WindowDecoration" state instead.
|
||||
* "false" - even when a single window is display in fullscreen */
|
||||
//bool isFullScreen = x == 0 && y == 0 && width == (int)screenWidth && height == (int)screenHeight;
|
||||
bool isFullScreen = !window->getWindowDecoration();
|
||||
|
||||
SG_LOG(SG_VIEW, SG_DEBUG, "Toggling fullscreen. Previous window rectangle ("
|
||||
<< x << ", " << y << ") x (" << width << ", " << height << "), fullscreen: " << isFullScreen);
|
||||
<< x << ", " << y << ") x (" << width << ", " << height << "), fullscreen: " << isFullScreen
|
||||
<< ", number of screens: " << wsi->getNumScreens());
|
||||
if (isFullScreen)
|
||||
{
|
||||
// limit x,y coordinates and window size to screen area
|
||||
|
|
Loading…
Reference in a new issue