5 1 new backport x11 fs rework (#1485)

* Use XRandR 1.2 to set fullscreen resolution for single output

Squash of roothorick's PR #497
(also includes Kyzentun's CMake changes from PR #716)

* Cherry-pick json c++1x stuff (b9e3d7174e)

* Cherry-pick c++11 support from 5bba5c0038 and 9f8b045309

* rework Linux (X11) fullscreen, improve display-related Graphics Options

Implement option to select between monitors for exclusive fullscreen mode
on X11 (using XRandR 1.2), or use a fullscreen borderless window.

Reimplement resolution/refresh rate/display mode-related option rows
using Lua, update choices dynamically so only known-good groupings of
resolution/refresh rate/aspect ratio can be selected.

Minimally update Windows/MacOS LowLevelWindow implementations to support
changes made for Linux side. Fullscreen Borderless Window/multi monitor
support from X11 not implemented for those in this commit.

* allow forcibly disabling xinerama use on Linux

When libXinerama is available, SM tries to use it to find the proper
monitor indexes to use to set _NET_WM_FULLSCREEN_MONITORS (on borderless
fullscreen). xfwm4 seems to assume that monitors are numbered in increasing
order from left to right (rather than using the Xinerama-assigned numbers),
so _NET_WM_FULLSCREEN_MONITORS misbehaves on Xfce.

This commit bypasses use of libXinerama, and instead forces SM to induce fullscreen
on the desired monitor in the backup, hacky way: remove all window hints, move window
to desired monitor, then add _NET_WM_STATE_FULLSCREEN hint. This works on
mutter and Xfce.

* Remove multiple warnings on redundant define.

This used to be hard-coded due to pthread related items, but now it's dynamically determined.

* fix _fallback menu behavior for unrecognized aspect ratios

* Fix error recreating existing FS texture

* Bump deployment target to 10.7 to use libc++ on XCode 8

* Add explicit casts to please clang

* Update changelog
This commit is contained in:
Drew Barbarello
2017-06-18 11:55:16 -04:00
committed by Colby Klein
parent 7ef14c340d
commit 557be7cf1b
57 changed files with 2616 additions and 370 deletions
+37 -12
View File
@@ -84,6 +84,31 @@ Sprite::Sprite( const Sprite &cpy ):
m_pTexture = NULL;
}
Sprite &Sprite::operator=( Sprite other )
{
using std::swap;
#define SWAP(a) swap(a, other.a)
SWAP( m_States );
SWAP(m_animation_length_seconds);
SWAP( m_iCurState );
SWAP( m_fSecsIntoState );
SWAP( m_bUsingCustomTexCoords );
SWAP( m_bUsingCustomPosCoords );
SWAP( m_bSkipNextUpdate );
SWAP( m_DecodeMovie );
SWAP( m_EffectMode );
memcpy( m_CustomTexCoords, other.m_CustomTexCoords, sizeof(m_CustomTexCoords) );
memcpy( m_CustomPosCoords, other.m_CustomPosCoords, sizeof(m_CustomPosCoords) );
SWAP( m_fRememberedClipWidth );
SWAP( m_fRememberedClipHeight );
SWAP( m_fTexCoordVelocityX );
SWAP( m_fTexCoordVelocityY );
SWAP(m_use_effect_clock_for_texcoords);
SWAP(m_pTexture);
#undef SWAP
return *this;
}
void Sprite::InitState()
{
Actor::InitState();
@@ -934,7 +959,7 @@ void Sprite::ScaleToClipped( float fWidth, float fHeight )
Sprite::ScaleToCover( RectF(0, 0, fWidth, fHeight) );
// find which dimension is larger
bool bXDimNeedsToBeCropped = GetZoomedWidth() > fWidth+0.01;
if( bXDimNeedsToBeCropped ) // crop X
{
float fPercentageToCutOff = (this->GetZoomedWidth() - fWidth) / this->GetZoomedWidth();
@@ -943,9 +968,9 @@ void Sprite::ScaleToClipped( float fWidth, float fHeight )
// generate a rectangle with new texture coordinates
RectF fCustomImageRect(
fPercentageToCutOffEachSide,
0,
1 - fPercentageToCutOffEachSide,
fPercentageToCutOffEachSide,
0,
1 - fPercentageToCutOffEachSide,
1 );
SetCustomImageRect( fCustomImageRect );
}
@@ -957,9 +982,9 @@ void Sprite::ScaleToClipped( float fWidth, float fHeight )
// generate a rectangle with new texture coordinates
RectF fCustomImageRect(
0,
0,
fPercentageToCutOffEachSide,
1,
1,
1 - fPercentageToCutOffEachSide );
SetCustomImageRect( fCustomImageRect );
}
@@ -995,7 +1020,7 @@ void Sprite::CropTo( float fWidth, float fHeight )
Sprite::ScaleToCover( RectF(0, 0, fWidth, fHeight) );
// find which dimension is larger
bool bXDimNeedsToBeCropped = GetZoomedWidth() > fWidth+0.01;
if( bXDimNeedsToBeCropped ) // crop X
{
float fPercentageToCutOff = (this->GetZoomedWidth() - fWidth) / this->GetZoomedWidth();
@@ -1003,9 +1028,9 @@ void Sprite::CropTo( float fWidth, float fHeight )
// generate a rectangle with new texture coordinates
RectF fCustomImageRect(
fPercentageToCutOffEachSide,
0,
1 - fPercentageToCutOffEachSide,
fPercentageToCutOffEachSide,
0,
1 - fPercentageToCutOffEachSide,
1 );
SetCustomImageRect( fCustomImageRect );
}
@@ -1016,9 +1041,9 @@ void Sprite::CropTo( float fWidth, float fHeight )
// generate a rectangle with new texture coordinates
RectF fCustomImageRect(
0,
0,
fPercentageToCutOffEachSide,
1,
1,
1 - fPercentageToCutOffEachSide );
SetCustomImageRect( fCustomImageRect );
}