diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-09-16 19:45:43 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-09-16 19:45:43 +0200 |
| commit | ddd53b3970925478d2b3648259a2789bddd127d3 (patch) | |
| tree | f967c5332c9821635c9cfeaf5f14783b6aaf5c13 /plugins/unityshell | |
| parent | 34293419cdc9c9aa637c7d8d61b4209b24986ec0 (diff) | |
UnityShell: redraw the dash also if a non-blurred area is damaged
If the dash is damaged, but not the blurred area, it won't redraw. We need to draw it, in order to avoid flickering of its border. Also, add the redraw_view_if_damaged utility function to redraw a view if really needed. Fixes LP: #1224340 (bzr r3506.4.2)
Diffstat (limited to 'plugins/unityshell')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 85 |
1 files changed, 23 insertions, 62 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 4b052125e..848586b29 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -1354,6 +1354,18 @@ void UnityScreen::donePaint() cScreen->donePaint (); } +void redraw_view_if_damaged(nux::ObjectPtr<nux::View> const& view, CompRegion const& damage) +{ + if (!view || view->IsRedrawNeeded()) + return; + + auto const& geo = view->GetAbsoluteGeometry(); + CompRegion region(geo.x, geo.y, geo.width, geo.height); + + if (damage.intersects(region)) + view->NeedSoftRedraw(); +} + void UnityScreen::compizDamageNux(CompRegion const& damage) { if (!launcher_controller_) @@ -1378,79 +1390,28 @@ void UnityScreen::compizDamageNux(CompRegion const& damage) } } + if (dash_controller_->IsVisible()) + redraw_view_if_damaged(dash_controller_->Dash(), damage); + auto const& launchers = launcher_controller_->launchers(); for (auto const& launcher : launchers) { if (!launcher->Hidden()) { - nux::Geometry const& geo = launcher->GetAbsoluteGeometry(); - CompRegion launcher_region(geo.x, geo.y, geo.width, geo.height); - - if (damage.intersects(launcher_region)) - launcher->QueueDraw(); - - nux::ObjectPtr<nux::View> const& tooltip = launcher->GetActiveTooltip(); - - if (tooltip) - { - nux::Geometry const& g = tooltip->GetAbsoluteGeometry(); - CompRegion tip_region(g.x, g.y, g.width, g.height); - - if (damage.intersects(tip_region)) - tooltip->QueueDraw(); - } - - nux::ObjectPtr<LauncherDragWindow> const& dragged_icon = launcher->GetDraggedIcon(); - - if (dragged_icon) - { - nux::Geometry const& g = dragged_icon->GetAbsoluteGeometry(); - CompRegion icon_region(g.x, g.y, g.width, g.height); - - if (damage.intersects(icon_region)) - dragged_icon->QueueDraw(); - } + redraw_view_if_damaged(launcher, damage); + redraw_view_if_damaged(launcher->GetActiveTooltip(), damage); + redraw_view_if_damaged(launcher->GetDraggedIcon(), damage); } } for (auto const& panel : panel_controller_->panels()) - { - nux::Geometry const& geo = panel->GetAbsoluteGeometry(); - - CompRegion panel_region(geo.x, geo.y, geo.width, geo.height); + redraw_view_if_damaged(panel, damage); - if (damage.intersects(panel_region)) - panel->QueueDraw(); - } - - QuicklistManager* qm = QuicklistManager::Default(); - if (qm) - { - auto const& view = qm->Current(); + if (QuicklistManager* qm = QuicklistManager::Default()) + redraw_view_if_damaged(qm->Current(), damage); - if (view) - { - nux::Geometry const& geo = view->GetAbsoluteGeometry(); - CompRegion quicklist_region(geo.x, geo.y, geo.width, geo.height); - - if (damage.intersects(quicklist_region)) - view->QueueDraw(); - } - } - - if (switcher_controller_ && switcher_controller_->Visible()) - { - auto const& view = switcher_controller_->GetView(); - - if (G_LIKELY(view)) - { - nux::Geometry const& geo = view->GetAbsoluteGeometry(); - CompRegion switcher_region(geo.x, geo.y, geo.width, geo.height); - - if (damage.intersects(switcher_region)) - view->QueueDraw(); - } - } + if (switcher_controller_->Visible()) + redraw_view_if_damaged(switcher_controller_->GetView(), damage); } /* Grab changed nux regions and add damage rects for them */ |
