summaryrefslogtreecommitdiff
path: root/plugins/unityshell
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2013-11-19 19:48:35 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2013-11-19 19:48:35 +0100
commitdeac8afaca1436201725e211d8dfcb3228b43f96 (patch)
tree1688e9542a2a46b37ffb0ace05377075fb7a6745 /plugins/unityshell
parent49d84b95f8f2f020a96f2841580d2d7a8996dff9 (diff)
parentbdedc966593acc69add0ab8d7df03203f77c8bbe (diff)
Merge with trunk
(bzr r3506.6.16)
Diffstat (limited to 'plugins/unityshell')
-rw-r--r--plugins/unityshell/src/Monitor.h2
-rw-r--r--plugins/unityshell/src/UnityGestureTarget.h1
-rw-r--r--plugins/unityshell/src/WindowMinimizeSpeedController.cpp8
-rw-r--r--plugins/unityshell/src/unityshell.cpp67
4 files changed, 28 insertions, 50 deletions
diff --git a/plugins/unityshell/src/Monitor.h b/plugins/unityshell/src/Monitor.h
index ee6dfa6b9..11a28c456 100644
--- a/plugins/unityshell/src/Monitor.h
+++ b/plugins/unityshell/src/Monitor.h
@@ -29,6 +29,8 @@ namespace performance {
class Monitor
{
public:
+ virtual ~Monitor() {}
+
void Start();
GVariant* Stop();
virtual std::string GetName() const = 0;
diff --git a/plugins/unityshell/src/UnityGestureTarget.h b/plugins/unityshell/src/UnityGestureTarget.h
index f47996e63..574ba0148 100644
--- a/plugins/unityshell/src/UnityGestureTarget.h
+++ b/plugins/unityshell/src/UnityGestureTarget.h
@@ -34,6 +34,7 @@ class UnityGestureTarget : public nux::GestureTarget
{
public:
UnityGestureTarget();
+ virtual ~UnityGestureTarget() {}
virtual nux::GestureDeliveryRequest GestureEvent(const nux::GestureEvent &event);
diff --git a/plugins/unityshell/src/WindowMinimizeSpeedController.cpp b/plugins/unityshell/src/WindowMinimizeSpeedController.cpp
index a605b93f2..29df106fa 100644
--- a/plugins/unityshell/src/WindowMinimizeSpeedController.cpp
+++ b/plugins/unityshell/src/WindowMinimizeSpeedController.cpp
@@ -42,22 +42,22 @@ WindowMinimizeSpeedController::WindowMinimizeSpeedController()
, _duration(200) // going to be overridden anyway, but at least it is initialised
{
_minimize_count_changed.Connect(_settings, "changed::minimize-count",
- [&] (GSettings*, gchar* name) {
+ [this] (GSettings*, gchar* name) {
_minimize_count = g_settings_get_int(_settings, name);
SetDuration();
});
_minimize_speed_threshold_changed.Connect(_settings, "changed::minimize-speed-threshold",
- [&] (GSettings*, gchar* name) {
+ [this] (GSettings*, gchar* name) {
_minimize_speed_threshold = g_settings_get_int(_settings, name);
SetDuration();
});
_minimize_fast_duration_changed.Connect(_settings, "changed::minimize-fast-duration",
- [&] (GSettings*, gchar* name) {
+ [this] (GSettings*, gchar* name) {
_minimize_fast_duration = g_settings_get_int(_settings, name);
SetDuration();
});
_minimize_slow_duration_changed.Connect(_settings, "changed::minimize-slow-duration",
- [&] (GSettings*, gchar* name) {
+ [this] (GSettings*, gchar* name) {
_minimize_slow_duration = g_settings_get_int(_settings, name);
SetDuration();
});
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index ed7fc32f3..0fe0836a3 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -396,7 +396,7 @@ UnityScreen::UnityScreen(CompScreen* screen)
BackgroundEffectHelper::updates_enabled = true;
- ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [&](GVariant * data)
+ ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [this](GVariant * data)
{
unity::glib::String overlay_identity;
gboolean can_maximise = FALSE;
@@ -548,16 +548,16 @@ void UnityScreen::EnsureSuperKeybindings()
void UnityScreen::CreateSuperNewAction(char shortcut, impl::ActionModifiers flag)
{
- CompActionPtr action(new CompAction());
- const std::string key(optionGetShowLauncher().keyToString());
+ CompActionPtr action(new CompAction());
+ const std::string key(optionGetShowLauncher().keyToString());
- CompAction::KeyBinding binding;
- binding.fromString(impl::CreateActionString(key, shortcut, flag));
+ CompAction::KeyBinding binding;
+ binding.fromString(impl::CreateActionString(key, shortcut, flag));
- action->setKey(binding);
+ action->setKey(binding);
- screen->addAction(action.get());
- _shortcut_actions.push_back(action);
+ screen->addAction(action.get());
+ _shortcut_actions.push_back(action);
}
void UnityScreen::nuxPrologue()
@@ -569,16 +569,6 @@ void UnityScreen::nuxPrologue()
* bit, but we do that here in order to workaround a bug (?) in the NVIDIA
* drivers (lp:703140). */
glDisable(GL_LIGHTING);
-
- /* reset matrices */
- glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT |
- GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT | GL_SCISSOR_BIT);
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
#endif
glGetError();
@@ -587,30 +577,18 @@ void UnityScreen::nuxPrologue()
void UnityScreen::nuxEpilogue()
{
#ifndef USE_GLES
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glDepthRange(0, 1);
- glViewport(-1, -1, 2, 2);
- glRasterPos2f(0, 0);
-
- gScreen->resetRasterPos();
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
-
- glPopAttrib();
+ /* In some unknown place inside nux drawing we change the viewport without
+ * setting it back to the default one, so we need to restore it before allowing
+ * compiz to take the scene */
+ auto* o = _last_output;
+ glViewport(o->x(), screen->height() - o->y2(), o->width(), o->height());
glDepthRange(0, 1);
#else
glDepthRangef(0, 1);
- gScreen->resetRasterPos();
#endif
+ gScreen->resetRasterPos();
glDisable(GL_SCISSOR_TEST);
}
@@ -1016,7 +994,7 @@ bool UnityScreen::DoesPointIntersectUnityGeos(nux::Point const& pt)
}
}
- for (nux::Geometry &panel_geo : panel_controller_->GetGeometries ())
+ for (nux::Geometry const& panel_geo : panel_controller_->GetGeometries ())
{
if (panel_geo.IsInside(pt))
{
@@ -1372,10 +1350,6 @@ void UnityScreen::glPaintTransformedOutput(const GLScreenPaintAttrib& attrib,
ignore_redraw_request_ = true;
compizDamageNux(CompRegionRef(output->region()));
ignore_redraw_request_ = false;
-
- /* Fetch all the presentation list geometries - this will have the side
- * effect of clearing any built-up damage state */
- std::vector<nux::Geometry> dirty = wt->GetPresentationListGeometries();
}
gScreen->glPaintTransformedOutput(attrib, transform, region, output, mask);
@@ -1570,17 +1544,18 @@ void UnityScreen::compizDamageNux(CompRegion const& damage)
}
/* Grab changed nux regions and add damage rects for them */
-void UnityScreen::determineNuxDamage(CompRegion &nux_damage)
+void UnityScreen::determineNuxDamage(CompRegion& nux_damage)
{
/* Fetch all the dirty geometry from nux and aggregate it */
- std::vector<nux::Geometry> dirty = wt->GetPresentationListGeometries();
+ auto const& dirty = wt->GetPresentationListGeometries();
+ auto const& panels_geometries = panel_controller_->GetGeometries();
for (auto const& dirty_geo : dirty)
{
nux_damage += CompRegionFromNuxGeo(dirty_geo);
/* Special case, we need to redraw the panel shadow on panel updates */
- for (auto const& panel_geo : panel_controller_->GetGeometries())
+ for (auto const& panel_geo : panels_geometries)
{
if (!dirty_geo.IsIntersecting(panel_geo))
continue;
@@ -2941,7 +2916,7 @@ void UnityWindow::windowNotify(CompWindowNotify n)
if (window->type() == CompWindowTypeDesktopMask) {
if (!focus_desktop_timeout_)
{
- focus_desktop_timeout_.reset(new glib::Timeout(1000, [&] {
+ focus_desktop_timeout_.reset(new glib::Timeout(1000, [this] {
for (CompWindow *w : screen->clientList())
{
if (!(w->type() & NO_FOCUS_MASK) && w->focus ())
@@ -3321,7 +3296,7 @@ void UnityScreen::ScheduleRelayout(guint timeout)
{
if (!sources_.GetSource(local::RELAYOUT_TIMEOUT))
{
- sources_.AddTimeout(timeout, [&] {
+ sources_.AddTimeout(timeout, [this] {
NeedsRelayout();
Relayout();