=== modified file 'panel/PanelView.cpp'
--- panel/PanelView.cpp 2015-02-03 10:47:59 +0000
+++ panel/PanelView.cpp 2015-04-21 20:18:17 +0000
@@ -61,6 +61,7 @@
auto& wm = WindowManager::Default();
panel::Style::Instance().changed.connect(sigc::mem_fun(this, &PanelView::ForceUpdateBackground));
Settings::Instance().dpi_changed.connect(sigc::mem_fun(this, &PanelView::Resize));
+ Settings::Instance().low_gfx_changed.connect(sigc::mem_fun(this, &PanelView::OnLowGfxChanged));
wm.average_color.changed.connect(sigc::mem_fun(this, &PanelView::OnBackgroundUpdate));
wm.initiate_spread.connect(sigc::mem_fun(this, &PanelView::OnSpreadInitiate));
@@ -249,6 +250,22 @@
EnableOverlayMode(false);
}
+void PanelView::OnLowGfxChanged()
+{
+ if (!Settings::Instance().GetLowGfxMode())
+ {
+ nux::ROPConfig rop;
+
+ rop.Blend = true;
+ rop.SrcBlend = GL_ZERO;
+ rop.DstBlend = GL_SRC_COLOR;
+ nux::Color darken_colour = nux::Color(0.9f, 0.9f, 0.9f, 1.0f);
+ bg_darken_layer_.reset(new nux::ColorLayer(darken_colour, false, rop));
+ }
+
+ ForceUpdateBackground();
+}
+
void PanelView::AddPanelView(PanelIndicatorsView* child,
unsigned int stretchFactor)
{
@@ -537,6 +554,7 @@
is_dirty_ = true;
UpdateBackground();
+ QueueRelayout();
QueueDraw();
}
=== modified file 'panel/PanelView.h'
--- panel/PanelView.h 2014-12-12 22:33:24 +0000
+++ panel/PanelView.h 2015-04-21 20:18:17 +0000
@@ -98,6 +98,7 @@
void OnOverlayHidden(GVariant *data);
void OnSpreadInitiate();
void OnSpreadTerminate();
+ void OnLowGfxChanged();
void EnableOverlayMode(bool);
bool ActivateFirstSensitive();
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2015-04-10 21:59:05 +0000
+++ plugins/unityshell/src/unityshell.cpp 2015-04-21 20:18:17 +0000
@@ -261,7 +261,8 @@
renderer.find("Mesa X11") != std::string::npos ||
renderer.find("LLVM") != std::string::npos ||
renderer.find("on softpipe") != std::string::npos ||
- (getenv("UNITY_LOW_GFX_MODE") != NULL && atoi(getenv("UNITY_LOW_GFX_MODE")) == 1))
+ (getenv("UNITY_LOW_GFX_MODE") != NULL && atoi(getenv("UNITY_LOW_GFX_MODE")) == 1) ||
+ optionGetLowGraphicsMode())
{
unity_settings_.SetLowGfxMode(true);
}
@@ -337,6 +338,7 @@
optionSetAutohideAnimationNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
optionSetDashBlurExperimentalNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
optionSetShortcutOverlayNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
+ optionSetLowGraphicsModeNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
optionSetShowLauncherInitiate(boost::bind(&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));
optionSetShowLauncherTerminate(boost::bind(&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3));
optionSetKeyboardFocusInitiate(boost::bind(&UnityScreen::setKeyboardFocusKeyInitiate, this, _1, _2, _3));
@@ -3596,6 +3598,14 @@
case UnityshellOptions::ShortcutOverlay:
shortcut_controller_->SetEnabled(optionGetShortcutOverlay());
break;
+ case UnityshellOptions::LowGraphicsMode:
+ if (optionGetLowGraphicsMode())
+ BackgroundEffectHelper::blur_type = BLUR_NONE;
+ else
+ BackgroundEffectHelper::blur_type = (unity::BlurType)optionGetDashBlurExperimental();
+
+ unity::Settings::Instance().SetLowGfxMode(optionGetLowGraphicsMode());
+ break;
case UnityshellOptions::DecayRate:
launcher_options->edge_decay_rate = optionGetDecayRate() * 100;
break;
=== modified file 'plugins/unityshell/unityshell.xml.in'
--- plugins/unityshell/unityshell.xml.in 2015-02-04 08:20:43 +0000
+++ plugins/unityshell/unityshell.xml.in 2015-04-21 20:18:17 +0000
@@ -146,6 +146,12 @@
<_long>Enables possibility to display an overlay showing available mouse and keyboard shortcuts.
true
+
+
=== modified file 'unity-shared/OverlayRenderer.cpp'
--- unity-shared/OverlayRenderer.cpp 2014-07-10 20:32:06 +0000
+++ unity-shared/OverlayRenderer.cpp 2015-04-21 20:18:17 +0000
@@ -116,6 +116,8 @@
{
parent->scale = Settings::Instance().em()->DPIScale();
parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
+ Settings::Instance().low_gfx_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures));
+
UpdateTextures();
LoadScaledTextures();
}
=== modified file 'unity-shared/UnitySettings.cpp'
--- unity-shared/UnitySettings.cpp 2015-02-19 19:33:36 +0000
+++ unity-shared/UnitySettings.cpp 2015-04-21 20:18:17 +0000
@@ -373,7 +373,12 @@
void Settings::SetLowGfxMode(const bool low_gfx)
{
- pimpl->lowGfx_ = low_gfx;
+ if (pimpl->lowGfx_ != low_gfx)
+ {
+ pimpl->lowGfx_ = low_gfx;
+
+ low_gfx_changed.emit();
+ }
}
EMConverter::Ptr const& Settings::em(int monitor) const
=== modified file 'unity-shared/UnitySettings.h'
--- unity-shared/UnitySettings.h 2015-02-03 12:31:32 +0000
+++ unity-shared/UnitySettings.h 2015-04-21 20:18:17 +0000
@@ -58,6 +58,7 @@
nux::Property font_scaling;
sigc::signal dpi_changed;
+ sigc::signal low_gfx_changed;
private:
class Impl;