diff options
| author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-09-04 14:14:38 -0300 |
|---|---|---|
| committer | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-09-04 14:14:38 -0300 |
| commit | ad529eec1b446a63ece2f794a622bffec5e789e0 (patch) | |
| tree | 06f043aee0a291b9d1decb5d9fdcdc2beb4da497 /plugins/unityshell | |
| parent | 5182a9065ab28d7c7921d34f7f25c9c5e3b29524 (diff) | |
Code optimizations.
(bzr r2650.1.12)
Diffstat (limited to 'plugins/unityshell')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 0e79a44a4..e0e36b40a 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -3827,7 +3827,7 @@ UnityWindow::scalePaintDecoration(const GLWindowPaintAttrib& attrib, float y = pos.y() + window->y(); float decorationHeight = SCALE_WINDOW_TITLE_SIZE; - // If window is decorated draw the decoration over the original + // If window is decorated draw the decoration // otherwise draw a small bar over the window if (!highlighted) decorationHeight = SCALE_WINDOW_TITLE_SIZE * 0.30; @@ -3839,7 +3839,7 @@ UnityWindow::scalePaintDecoration(const GLWindowPaintAttrib& attrib, if (highlighted) { const float iconX = x + CLOSE_ICON_SPACE; - const float iconY = y + ((SCALE_WINDOW_TITLE_SIZE - CLOSE_ICON_SIZE) / 2.0); + const float iconY = y + ((decorationHeight - CLOSE_ICON_SIZE) / 2.0); maxHeight = maxWidth = 0; mask |= PAINT_WINDOW_BLEND_MASK; @@ -3891,15 +3891,14 @@ void UnityWindow::InitiateSpreed() const guint32 xid = window->id(); has_original_decoration_ = wm->IsWindowDecorated(xid) && !wm->IsWindowMaximized(xid); - wm->Undecorate(xid); + if (has_original_decoration_) + wm->Undecorate(xid); } void UnityWindow::TerminateSpreed() { if (has_original_decoration_) WindowManager::Default()->Decorate(window->id()); - else - WindowManager::Default()->Undecorate(window->id()); } UnityWindow::~UnityWindow() |
