summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-09-06 13:31:42 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-09-06 13:31:42 +0200
commit8c5d01310b6d9cde6fdde1392c90195f9876d839 (patch)
tree81297763997216d19eb43d7885ee51c959ea18b1 /plugins
parent30421d692e7fe0ff4f92552fa24b12ea2f64c20e (diff)
UnityShell: remove scale_highlighted_window_ variable, using scale's getSelectedWindow instead.
(bzr r2655.6.1)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/unityshell.cpp33
-rw-r--r--plugins/unityshell/src/unityshell.h3
2 files changed, 12 insertions, 24 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 9830a6fac..2ab62db25 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -134,7 +134,6 @@ UnityScreen::UnityScreen(CompScreen* screen)
, panel_texture_has_changed_(true)
, paint_panel_(false)
, scale_just_activated_(false)
- , scale_highlighted_window_(0)
, minimize_speed_controller(new WindowMinimizeSpeedController())
{
Timer timer;
@@ -392,7 +391,6 @@ UnityScreen::UnityScreen(CompScreen* screen)
}
panel::Style::Instance().changed.connect(sigc::mem_fun(this, &UnityScreen::OnPanelStyleChanged));
- WindowManager::Default()->terminate_spread.connect([this] { scale_highlighted_window_ = 0; });
minimize_speed_controller->DurationChanged.connect(
sigc::mem_fun(this, &UnityScreen::OnMinimizeDurationChanged)
@@ -1649,9 +1647,10 @@ void UnityScreen::handleEvent(XEvent* event)
_key_nav_mode_requested = false;
break;
case MotionNotify:
- if (scale_highlighted_window_ && PluginAdapter::Default()->IsScaleActive())
+ if (PluginAdapter::Default()->IsScaleActive())
{
- if (CompWindow *w = screen->findWindow(scale_highlighted_window_))
+ ScaleScreen* ss = ScaleScreen::get(screen);
+ if (CompWindow *w = screen->findWindow(ss->getSelectedWindow()))
skip_other_plugins = UnityWindow::get(w)->handleEvent(event);
}
break;
@@ -1661,9 +1660,10 @@ void UnityScreen::handleEvent(XEvent* event)
launcher_controller_->KeyNavTerminate(false);
EnableCancelAction(CancelActionTarget::LAUNCHER_SWITCHER, false);
}
- if (scale_highlighted_window_ && PluginAdapter::Default()->IsScaleActive())
+ if (PluginAdapter::Default()->IsScaleActive())
{
- if (CompWindow *w = screen->findWindow(scale_highlighted_window_))
+ ScaleScreen* ss = ScaleScreen::get(screen);
+ if (CompWindow *w = screen->findWindow(ss->getSelectedWindow()))
skip_other_plugins = UnityWindow::get(w)->handleEvent(event);
}
@@ -1686,10 +1686,11 @@ void UnityScreen::handleEvent(XEvent* event)
}
}
}
- else if (scale_highlighted_window_ && PluginAdapter::Default()->IsScaleActive())
+ else if (PluginAdapter::Default()->IsScaleActive())
{
- if (CompWindow *w = screen->findWindow(scale_highlighted_window_))
- UnityWindow::get(w)->handleEvent(event);
+ ScaleScreen* ss = ScaleScreen::get(screen);
+ if (CompWindow *w = screen->findWindow(ss->getSelectedWindow()))
+ skip_other_plugins = UnityWindow::get(w)->handleEvent(event);
}
break;
case KeyPress:
@@ -3810,8 +3811,8 @@ void UnityWindow::scalePaintDecoration(GLWindowPaintAttrib const& attrib,
if (!scale_win->hasSlot()) // animation not finished
return;
- UnityScreen* us = UnityScreen::get(screen);
- const bool highlighted = (us->scale_highlighted_window_ == window->id());
+ ScaleScreen* ss = ScaleScreen::get(screen);
+ const bool highlighted = (ss->getSelectedWindow() == window->id());
ScalePosition const& pos = scale_win->getCurrentPosition();
auto const& border_rect = window->borderRect();
@@ -3864,16 +3865,6 @@ void UnityWindow::scalePaintDecoration(GLWindowPaintAttrib const& attrib,
}
}
-void UnityWindow::scaleSelectWindow()
-{
- ScaleWindow::get(window)->scaleSelectWindow();
-
- UnityScreen* us = UnityScreen::get(screen);
-
- if (us->scale_highlighted_window_ != window->id())
- us->scale_highlighted_window_ = window->id();
-}
-
void UnityWindow::OnInitiateSpreed()
{
auto const windows = screen->windows();
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index 21498f0cf..4727606d2 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -345,8 +345,6 @@ private:
glib::SourceManager sources_;
unity::ThumbnailGenerator thumb_generator;
- Window scale_highlighted_window_;
-
WindowMinimizeSpeedController* minimize_speed_controller;
friend class UnityWindow;
};
@@ -425,7 +423,6 @@ public:
//! Emited when CompWindowNotifyBeforeDestroy is received
sigc::signal<void> being_destroyed;
- void scaleSelectWindow();
void scalePaintDecoration(const GLWindowPaintAttrib &,
const GLMatrix &,
const CompRegion &,