summaryrefslogtreecommitdiff
diff options
-rw-r--r--launcher/Launcher.cpp7
-rw-r--r--launcher/Launcher.h3
-rw-r--r--manual-tests/Launcher.txt18
-rw-r--r--plugins/unityshell/src/unityshell.cpp54
4 files changed, 66 insertions, 16 deletions
diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp
index 901d7247f..d880f471d 100644
--- a/launcher/Launcher.cpp
+++ b/launcher/Launcher.cpp
@@ -1507,11 +1507,16 @@ bool Launcher::IsBackLightModeToggles() const
}
}
-nux::ObjectPtr<nux::View> Launcher::GetActiveTooltip() const
+nux::ObjectPtr<nux::View> const& Launcher::GetActiveTooltip() const
{
return _active_tooltip;
}
+nux::ObjectPtr<LauncherDragWindow> const& Launcher::GetDraggedIcon() const
+{
+ return _drag_window;
+}
+
void Launcher::SetActionState(LauncherActionState actionstate)
{
if (_launcher_action_state == actionstate)
diff --git a/launcher/Launcher.h b/launcher/Launcher.h
index 5c469cb54..c27275c64 100644
--- a/launcher/Launcher.h
+++ b/launcher/Launcher.h
@@ -96,7 +96,8 @@ public:
return _parent;
};
- nux::ObjectPtr<nux::View> GetActiveTooltip() const; // nullptr = no tooltip
+ nux::ObjectPtr<nux::View> const& GetActiveTooltip() const;
+ nux::ObjectPtr<LauncherDragWindow> const& GetDraggedIcon() const;
virtual void RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags);
virtual void RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags);
diff --git a/manual-tests/Launcher.txt b/manual-tests/Launcher.txt
index 407f6ed14..9194611f0 100644
--- a/manual-tests/Launcher.txt
+++ b/manual-tests/Launcher.txt
@@ -177,7 +177,7 @@ Expected Result:
Dragging icons to reorder - away from launcher
------------------------------------------
+----------------------------------------------
This test is about reordering the icons without the animation showing.
Setup:
@@ -198,6 +198,22 @@ Expected Result:
it, and the any pips for running apps show again.
+Dragged launcher icons out of the launcher are properly drawn
+-------------------------------------------------------------
+This test ensures that the launcher icons out of the launcher are properly drawn
+
+Setup:
+
+Actions:
+#. Move the mouse so it is over a launcher icon for an application
+#. Press and hold the mouse button
+#. Drag the icon away from the launcher, in the middle of the display
+#. Don't move the mouse pointer for some (4-5) seconds, keeping the button pressed
+
+Expected Result:
+ * The icon is always drawn, even when the mouse pointer does not move.
+
+
Dragging icon while program is starting
---------------------------------------
This test that when a program is executed from the launcher and the icon is
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index d483ed2dd..fafd00333 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -1426,31 +1426,48 @@ void UnityScreen::compizDamageNux(CompRegion const& damage)
}
}
- auto launchers = launcher_controller_->launchers();
- for (auto launcher : launchers)
+ auto const& launchers = launcher_controller_->launchers();
+ for (auto const& launcher : launchers)
{
if (!launcher->Hidden())
{
- nux::Geometry geo = launcher->GetAbsoluteGeometry();
+ 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> tooltip = launcher->GetActiveTooltip();
- if (!tooltip.IsNull())
+
+ nux::ObjectPtr<nux::View> const& tooltip = launcher->GetActiveTooltip();
+
+ if (tooltip)
{
- nux::Geometry tip = tooltip->GetAbsoluteGeometry();
- CompRegion tip_region(tip.x, tip.y, tip.width, tip.height);
+ 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();
+ }
}
}
std::vector<nux::View*> const& panels(panel_controller_->GetPanelViews());
for (nux::View* view : panels)
{
- nux::Geometry geo = view->GetAbsoluteGeometry();
+ nux::Geometry const& geo = view->GetAbsoluteGeometry();
+
CompRegion panel_region(geo.x, geo.y, geo.width, geo.height);
+
if (damage.intersects(panel_region))
view->QueueDraw();
}
@@ -1461,8 +1478,9 @@ void UnityScreen::compizDamageNux(CompRegion const& damage)
QuicklistView* view = qm->Current();
if (view)
{
- nux::Geometry geo = view->GetAbsoluteGeometry();
+ nux::Geometry const& geo = view->GetAbsoluteGeometry();
CompRegion quicklist_region(geo.x, geo.y, geo.width, geo.height);
+
if (damage.intersects(quicklist_region))
view->QueueDraw();
}
@@ -1485,7 +1503,8 @@ void UnityScreen::nuxDamageCompiz()
CompRegion nux_damage;
std::vector<nux::Geometry> const& dirty = wt->GetDrawList();
- for (auto geo : dirty)
+
+ for (auto const& geo : dirty)
nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height);
if (launcher_controller_->IsOverlayOpen())
@@ -1495,17 +1514,26 @@ void UnityScreen::nuxDamageCompiz()
nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height);
}
- auto launchers = launcher_controller_->launchers();
- for (auto launcher : launchers)
+ auto const& launchers = launcher_controller_->launchers();
+ for (auto const& launcher : launchers)
{
if (!launcher->Hidden())
{
nux::ObjectPtr<nux::View> tooltip = launcher->GetActiveTooltip();
- if (!tooltip.IsNull())
+
+ if (tooltip)
{
nux::Geometry const& g = tooltip->GetAbsoluteGeometry();
nux_damage += CompRegion(g.x, g.y, g.width, g.height);
}
+
+ nux::ObjectPtr<LauncherDragWindow> const& dragged_icon = launcher->GetDraggedIcon();
+
+ if (dragged_icon)
+ {
+ nux::Geometry const& g = dragged_icon->GetAbsoluteGeometry();
+ nux_damage += CompRegion(g.x, g.y, g.width, g.height);
+ }
}
}