summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-10-30 11:24:07 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-10-30 11:24:07 +0100
commit2e65ae0a0f115c98f419721b71288e754ce93ac9 (patch)
tree48ebfd2bf50642ac1f9bdc8f4a44aea3aead8b9c /plugins
parent8277c58ef6175527a6cd9853ac3553b991a516fb (diff)
WindowManager: avoid to call the spread actions for every windows
Call it only for target ones. (bzr r2846.1.24)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/unityshell.cpp28
-rw-r--r--plugins/unityshell/src/unityshell.h3
2 files changed, 24 insertions, 7 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 0df14c2c4..cfeb91eff 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -405,6 +405,10 @@ UnityScreen::UnityScreen(CompScreen* screen)
sigc::mem_fun(this, &UnityScreen::OnMinimizeDurationChanged)
);
+ WindowManager& wm = WindowManager::Default();
+ wm.initiate_spread.connect(sigc::mem_fun(this, &UnityScreen::OnInitiateSpread));
+ wm.terminate_spread.connect(sigc::mem_fun(this, &UnityScreen::OnTerminateSpread));
+
AddChild(&screen_introspection_);
}
}
@@ -465,6 +469,22 @@ void UnityScreen::initAltTabNextWindow()
}
+void UnityScreen::OnInitiateSpread()
+{
+ UnityWindow::SetupSharedTextures();
+
+ for (auto const& swin : ScaleScreen::get(screen)->getWindows())
+ UnityWindow::get(swin->window)->OnInitiateSpread();
+}
+
+void UnityScreen::OnTerminateSpread()
+{
+ for (auto const& swin : ScaleScreen::get(screen)->getWindows())
+ UnityWindow::get(swin->window)->OnTerminateSpread();
+
+ UnityWindow::CleanupSharedTextures();
+}
+
void UnityScreen::EnsureSuperKeybindings()
{
for (auto action : _shortcut_actions)
@@ -3570,9 +3590,6 @@ UnityWindow::UnityWindow(CompWindow* window)
}
}
}
- WindowManager& wm = WindowManager::Default();
- wm.initiate_spread.connect(sigc::mem_fun(this, &UnityWindow::OnInitiateSpread));
- wm.terminate_spread.connect(sigc::mem_fun(this, &UnityWindow::OnTerminateSpread));
}
@@ -3845,6 +3862,7 @@ void UnityWindow::paintFakeDecoration(nux::Geometry const& geo, GLWindowPaintAtt
int text_x = win::decoration::ITEMS_PADDING * 2 + win::decoration::CLOSE_SIZE;
RenderText(context, text_x, 0.0, width - win::decoration::ITEMS_PADDING, height);
decoration_selected_tex_ = context.pixmap_texture_;
+ uScreen->damageRegion(CompRegion(geo.x, geo.y, width, height));
}
else
{
@@ -3856,9 +3874,6 @@ void UnityWindow::paintFakeDecoration(nux::Geometry const& geo, GLWindowPaintAtt
if (decoration_selected_tex_)
DrawTexture(decoration_selected_tex_->texture_, attrib, transform, mask, geo.x, geo.y);
- if (redraw_decoration)
- uScreen->damageRegion(CompRegion(geo.x, geo.y, width, height));
-
int x = geo.x + win::decoration::ITEMS_PADDING;
int y = geo.y + (height - win::decoration::CLOSE_SIZE) / 2.0f;
@@ -3928,7 +3943,6 @@ void UnityWindow::OnInitiateSpread()
{
close_icon_state_ = panel::WindowState::NORMAL;
middle_clicked_ = false;
- SetupSharedTextures();
WindowManager& wm = WindowManager::Default();
Window xid = window->id();
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index 1264e961b..42ff77728 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -236,6 +236,9 @@ private:
void OnSwitcherStart(GVariant* data);
void OnSwitcherEnd(GVariant* data);
+ void OnInitiateSpread();
+ void OnTerminateSpread();
+
void RestoreWindow(GVariant* data);
bool SaveInputThenFocus(const guint xid);