diff options
| -rw-r--r-- | data/com.canonical.Unity.gschema.xml | 5 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/data/com.canonical.Unity.gschema.xml b/data/com.canonical.Unity.gschema.xml index bfeeb7dad..35326a5fb 100644 --- a/data/com.canonical.Unity.gschema.xml +++ b/data/com.canonical.Unity.gschema.xml @@ -100,6 +100,11 @@ when authenticating. Only do this if you have account configured properly on your system.</description> </key> + <key type="b" name="lowgfx"> + <default>false</default> + <summary>Enable/Disable Low Graphics Mode</summary> + <description>Whether Unity runs in Low Graphics Mode.</description> + </key> </schema> <schema path="/com/canonical/unity/interface/" id="com.canonical.Unity.Interface" gettext-domain="unity"> <key type="d" name="text-scale-factor"> diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index c08c44f83..beda277ca 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -291,15 +291,21 @@ UnityScreen::UnityScreen(CompScreen* screen) } } - //In case of software rendering then enable lowgfx mode. + //In case of software rendering then enable lowgfx mode. std::string renderer = ANSI_TO_TCHAR(NUX_REINTERPRET_CAST(const char *, glGetString(GL_RENDERER))); + g_autoptr(GSettings) gs = g_settings_new("com.canonical.Unity"); + if (g_settings_get_boolean(gs, "lowgfx")) + unity_settings_.low_gfx = true; + else + unity_settings_.low_gfx = false; if (renderer.find("Software Rasterizer") != std::string::npos || renderer.find("Mesa X11") != std::string::npos || renderer.find("llvmpipe") != std::string::npos || renderer.find("softpipe") != std::string::npos || (getenv("UNITY_LOW_GFX_MODE") != NULL && atoi(getenv("UNITY_LOW_GFX_MODE")) == 1) || - optionGetLowGraphicsMode()) + optionGetLowGraphicsMode() + ) { unity_settings_.low_gfx = true; } |
