Merge lp:~azzar1/unity/fix-lp-1450991 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3979
Proposed branch: lp:~azzar1/unity/fix-lp-1450991
Merge into: lp:unity
Diff against target: 74 lines (+16/-4)
2 files modified
launcher/Launcher.cpp (+15/-3)
launcher/Launcher.h (+1/-1)
To merge this branch: bzr merge lp:~azzar1/unity/fix-lp-1450991
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+259921@code.launchpad.net

Commit message

Fix a regression with urgent icons not showing up if launcher is hidden.

Description of the change

Fix a regression with urgent icons not showing up if launcher is hidden.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Stephen M. Webb (bregma) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'launcher/Launcher.cpp'
--- launcher/Launcher.cpp 2015-04-16 14:38:54 +0000
+++ launcher/Launcher.cpp 2015-05-22 12:33:34 +0000
@@ -686,6 +686,11 @@
686 float present_progress = icon->GetQuirkProgress(AbstractLauncherIcon::Quirk::PRESENTED, monitor());686 float present_progress = icon->GetQuirkProgress(AbstractLauncherIcon::Quirk::PRESENTED, monitor());
687 icon_hide_offset *= 1.0f - (present_progress * icon->PresentUrgency());687 icon_hide_offset *= 1.0f - (present_progress * icon->PresentUrgency());
688688
689 if (present_progress > 0.0f)
690 {
691 parent_->ShowWindow(true);
692 }
693
689 // icon is crossing threshold, start folding694 // icon is crossing threshold, start folding
690 center.z += folded_z_distance * folding_progress;695 center.z += folded_z_distance * folding_progress;
691 arg.rotation.x = animation_neg_rads * folding_progress;696 arg.rotation.x = animation_neg_rads * folding_progress;
@@ -738,7 +743,7 @@
738}743}
739744
740void Launcher::RenderArgs(std::list<RenderArg> &launcher_args,745void Launcher::RenderArgs(std::list<RenderArg> &launcher_args,
741 nux::Geometry& box_geo, float* launcher_alpha, nux::Geometry const& parent_abs_geo)746 nux::Geometry& box_geo, float* launcher_alpha, nux::Geometry const& parent_abs_geo, bool& force_show_window)
742{747{
743 nux::Geometry const& geo = GetGeometry();748 nux::Geometry const& geo = GetGeometry();
744 LauncherModel::iterator it;749 LauncherModel::iterator it;
@@ -912,6 +917,8 @@
912 folding_threshold += shelf_delta;917 folding_threshold += shelf_delta;
913 center.y += shelf_delta;918 center.y += shelf_delta;
914919
920 force_show_window = false;
921
915 for (it = model_->shelf_begin(); it != model_->shelf_end(); ++it)922 for (it = model_->shelf_begin(); it != model_->shelf_end(); ++it)
916 {923 {
917 RenderArg arg;924 RenderArg arg;
@@ -921,6 +928,9 @@
921 autohide_offset, folded_z_distance, animation_neg_rads);928 autohide_offset, folded_z_distance, animation_neg_rads);
922 arg.colorify = colorify;929 arg.colorify = colorify;
923 launcher_args.push_back(arg);930 launcher_args.push_back(arg);
931
932 if (autohide_offset != 0)
933 force_show_window = true;
924 }934 }
925}935}
926936
@@ -1680,13 +1690,15 @@
1680 ROP.SrcBlend = GL_ONE;1690 ROP.SrcBlend = GL_ONE;
1681 ROP.DstBlend = GL_ONE_MINUS_SRC_ALPHA;1691 ROP.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
16821692
1693 bool force_show_window;
1683 nux::Geometry const& geo_absolute = GetAbsoluteGeometry();1694 nux::Geometry const& geo_absolute = GetAbsoluteGeometry();
1684 RenderArgs(args, bkg_box, &launcher_alpha, geo_absolute);1695 RenderArgs(args, bkg_box, &launcher_alpha, geo_absolute, force_show_window);
1685 bkg_box.width -= RIGHT_LINE_WIDTH.CP(cv_);1696 bkg_box.width -= RIGHT_LINE_WIDTH.CP(cv_);
16861697
1687 if (options()->hide_mode != LAUNCHER_HIDE_NEVER &&1698 if (options()->hide_mode != LAUNCHER_HIDE_NEVER &&
1688 bkg_box.x + bkg_box.width <= 0 &&1699 bkg_box.x + bkg_box.width <= 0 &&
1689 hide_machine_.reveal_progress <= 0)1700 hide_machine_.reveal_progress <= 0 &&
1701 !force_show_window)
1690 {1702 {
1691 parent_->ShowWindow(false);1703 parent_->ShowWindow(false);
1692 }1704 }
16931705
=== modified file 'launcher/Launcher.h'
--- launcher/Launcher.h 2015-04-15 15:45:22 +0000
+++ launcher/Launcher.h 2015-05-22 12:33:34 +0000
@@ -265,7 +265,7 @@
265 float animation_neg_rads);265 float animation_neg_rads);
266266
267 void RenderArgs(std::list<ui::RenderArg> &launcher_args,267 void RenderArgs(std::list<ui::RenderArg> &launcher_args,
268 nux::Geometry& box_geo, float* launcher_alpha, nux::Geometry const& parent_abs_geo);268 nux::Geometry& box_geo, float* launcher_alpha, nux::Geometry const& parent_abs_geo, bool& force_show_window);
269269
270 void OnIconAdded(AbstractLauncherIcon::Ptr const& icon);270 void OnIconAdded(AbstractLauncherIcon::Ptr const& icon);
271 void OnIconRemoved(AbstractLauncherIcon::Ptr const& icon);271 void OnIconRemoved(AbstractLauncherIcon::Ptr const& icon);