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 08:55:16 -07:00
committed by Colby Klein
parent 7ef14c340d
commit 557be7cf1b
57 changed files with 2616 additions and 370 deletions
+35 -15
View File
@@ -14,7 +14,7 @@
#include "Game.h"
#include "Foreach.h"
#include "GameConstantsAndTypes.h"
#include "DisplayResolutions.h"
#include "DisplaySpec.h"
#include "LocalizedString.h"
#include "SpecialFiles.h"
#include "RageLog.h"
@@ -248,22 +248,25 @@ static void ThemeChoices( vector<RString> &out )
*s = THEME->GetThemeDisplayName( *s );
}
static DisplayResolutions display_resolution_list;
static void cache_display_resolution_list()
static DisplaySpecs display_specs;
static void cache_display_specs()
{
if(display_resolution_list.empty())
if(display_specs.empty())
{
DISPLAY->GetDisplayResolutions(display_resolution_list);
DISPLAY->GetDisplaySpecs(display_specs);
}
}
static void DisplayResolutionChoices( vector<RString> &out )
{
cache_display_resolution_list();
FOREACHS_CONST( DisplayResolution, display_resolution_list, iter )
cache_display_specs();
FOREACHS_CONST( DisplaySpec, display_specs, iter )
{
RString s = ssprintf("%dx%d", iter->iWidth, iter->iHeight);
out.push_back( s );
if (iter->currentMode() != NULL)
{
RString s = ssprintf("%dx%d", iter->currentMode()->width, iter->currentMode()->height);
out.push_back(s);
}
}
}
@@ -516,6 +519,8 @@ static void MaxHighScoresPerListForPlayer(int& sel, bool to_sel, ConfOption cons
#include "LuaManager.h"
#include "LuaBinding.h"
static int GetTimingDifficulty()
{
int iTimingDifficulty = 0;
@@ -583,12 +588,14 @@ static void DisplayResolutionM( int &sel, bool ToSel, const ConfOption *pConfOpt
{
static vector<res_t> res_choices;
if(res_choices.empty())
if( res_choices.empty() )
{
cache_display_resolution_list();
FOREACHS_CONST(DisplayResolution, display_resolution_list, iter)
FOREACHS_CONST( DisplaySpec, display_specs, iter )
{
res_choices.push_back(res_t(iter->iWidth, iter->iHeight));
if ( iter->currentMode() != NULL )
{
res_choices.push_back( res_t( iter->currentMode()->width, iter->currentMode()->height ) );
}
}
}
@@ -733,10 +740,10 @@ static void InitializeConfOptions()
if( !g_ConfOptions.empty() )
return;
// Clear the display_resolution_list so that we don't get problems from
// Clear the display_specs so that we don't get problems from
// caching it. If the DisplayResolution option row is on the screen, it'll
// recache the list. -Kyz
display_resolution_list.clear();
display_specs.clear();
// There are a couple ways of getting the current preference column or turning
// a new choice in the interface into a new preference. The easiest is when
@@ -958,6 +965,19 @@ void ConfOption::MakeOptionsList( vector<RString> &out ) const
out = names;
}
static const char *OptEffectNames[] = {
"SavePreferences",
"ApplyGraphics",
"ApplyTheme",
"ChangeGame",
"ApplySound",
"ApplySong",
"ApplyAspectRatio"
};
XToString( OptEffect );
StringToX( OptEffect );
LuaXType( OptEffect );
/**
* @file
* @author Glenn Maynard (c) 2003-2004