Merge lp:~3v1n0/unity/dash-prompt-app-activation into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3967
Proposed branch: lp:~3v1n0/unity/dash-prompt-app-activation
Merge into: lp:unity
Diff against target: 557 lines (+108/-108)
13 files modified
dash/DashController.h (+0/-1)
dash/DashView.cpp (+30/-30)
dash/DashView.h (+1/-3)
dash/ResultView.cpp (+25/-0)
dash/ResultView.h (+6/-4)
dash/ResultViewGrid.cpp (+16/-13)
dash/ScopeView.cpp (+15/-22)
hud/HudButton.cpp (+0/-5)
hud/HudController.h (+0/-1)
launcher/DeviceNotificationDisplayImp.cpp (+0/-1)
unity-shared/BGHash.cpp (+5/-2)
unity-shared/SearchBar.cpp (+9/-23)
unity-shared/SearchBar.h (+1/-3)
To merge this branch: bzr merge lp:~3v1n0/unity/dash-prompt-app-activation
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Christopher Townsend Approve
Brandon Schaefer (community) Approve
Review via email: mp+257205@code.launchpad.net

Commit message

ResultViewGrid: wait for double-click event only if the relative result needs the Preview

This was causing a 500ms delay between the user click and some results (apps) activation.
Also, at this point, we can get rid of PREVIEW_LEFT_BUTTON activation type.

Description of the change

Remove the annoying delay before launching an application using mouse clicks in dash.

This is a regression we've introduced looong time ago, and really needs to be fixed.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
Revision history for this message
Christopher Townsend (townsend) wrote :

Yeah, very nice! No more 1 second(!) delay when trying to start an app after opening the Dash. I'll wait for Jenkins to ack/nack before top approving.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'dash/DashController.h'
--- dash/DashController.h 2014-04-25 02:42:01 +0000
+++ dash/DashController.h 2015-04-24 13:00:45 +0000
@@ -21,7 +21,6 @@
2121
22#include <memory>22#include <memory>
2323
24#include <gdk/gdk.h>
25#include <UnityCore/ConnectionManager.h>24#include <UnityCore/ConnectionManager.h>
26#include <UnityCore/GLibDBusServer.h>25#include <UnityCore/GLibDBusServer.h>
27#include <UnityCore/GLibSignal.h>26#include <UnityCore/GLibSignal.h>
2827
=== modified file 'dash/DashView.cpp'
--- dash/DashView.cpp 2015-03-20 18:03:15 +0000
+++ dash/DashView.cpp 2015-04-24 13:00:45 +0000
@@ -59,7 +59,7 @@
59const RawPixel PREVIEW_CONTAINER_TRIANGLE_WIDTH = 14_em;59const RawPixel PREVIEW_CONTAINER_TRIANGLE_WIDTH = 14_em;
60const RawPixel PREVIEW_CONTAINER_TRIANGLE_HEIGHT = 12_em;60const RawPixel PREVIEW_CONTAINER_TRIANGLE_HEIGHT = 12_em;
6161
62const int MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT = 1000;62const int MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT = 300;
63}63}
6464
65// This is so we can access some protected members in nux::VLayout and65// This is so we can access some protected members in nux::VLayout and
@@ -120,7 +120,6 @@
120 , preview_displaying_(false)120 , preview_displaying_(false)
121 , preview_navigation_mode_(previews::Navigation::NONE)121 , preview_navigation_mode_(previews::Navigation::NONE)
122 , last_activated_timestamp_(0)122 , last_activated_timestamp_(0)
123 , search_in_progress_(false)
124 , activate_on_finish_(false)123 , activate_on_finish_(false)
125 , visible_(false)124 , visible_(false)
126 , opening_column_x_(-1)125 , opening_column_x_(-1)
@@ -1221,21 +1220,27 @@
12211220
1222void DashView::OnSearchChanged(std::string const& search_string)1221void DashView::OnSearchChanged(std::string const& search_string)
1223{1222{
1224 search_in_progress_ = true;1223 activate_on_finish_ = false;
1225}1224}
12261225
1227void DashView::OnLiveSearchReached(std::string const& search_string)1226void DashView::OnLiveSearchReached(std::string const& search_string)
1228{1227{
1229 // reset and set it again once we're sure a search is happening
1230 search_in_progress_ = false;
1231
1232 LOG_DEBUG(logger) << "Live search reached: " << search_string;1228 LOG_DEBUG(logger) << "Live search reached: " << search_string;
1233 if (active_scope_view_)1229 if (!active_scope_view_.IsValid())
1230 return;
1231
1232 if (active_scope_view_->PerformSearch(search_string, sigc::mem_fun(this, &DashView::OnScopeSearchFinished)))
1234 {1233 {
1235 if (active_scope_view_->PerformSearch(search_string, sigc::mem_fun(this, &DashView::OnScopeSearchFinished)))1234 activate_delay_.reset(new glib::Timeout(MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT, [this] {
1236 {1235 if (activate_on_finish_)
1237 search_in_progress_ = true;1236 {
1238 }1237 activate_on_finish_ = false;
1238 active_scope_view_->ActivateFirst();
1239 }
1240
1241 activate_delay_.reset();
1242 return false;
1243 }));
1239 }1244 }
1240}1245}
12411246
@@ -1254,12 +1259,15 @@
1254 LOG_DEBUG(logger) << "Search completed: " << search_string;1259 LOG_DEBUG(logger) << "Search completed: " << search_string;
12551260
1256 search_bar_->SetSearchFinished();1261 search_bar_->SetSearchFinished();
1257 search_in_progress_ = false;1262
12581263 if (activate_on_finish_)
1259 activate_timeout_.reset();1264 {
1260 if (activate_on_finish_ && !err)1265 activate_on_finish_ = false;
1261 OnEntryActivated();1266 activate_delay_.reset();
1262 activate_on_finish_= false;1267
1268 if (!err)
1269 active_scope_view_->ActivateFirst();
1270 }
1263 }1271 }
1264}1272}
12651273
@@ -1407,20 +1415,12 @@
1407}1415}
1408void DashView::OnEntryActivated()1416void DashView::OnEntryActivated()
1409{1417{
1410 if (active_scope_view_.IsValid() && !search_in_progress_)1418 if (active_scope_view_.IsValid())
1411 {1419 {
1412 active_scope_view_->ActivateFirst();1420 if (!activate_delay_ && !search_bar_->in_live_search())
1413 }
1414 // delay the activation until we get the SearchFinished signal
1415 activate_on_finish_ = search_in_progress_;
1416
1417 if (activate_on_finish_)
1418 {
1419 activate_timeout_.reset(new glib::Timeout(MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT, [this] {
1420 activate_on_finish_ = false;
1421 active_scope_view_->ActivateFirst();1421 active_scope_view_->ActivateFirst();
1422 return FALSE;1422 else
1423 }));1423 activate_on_finish_ = true;
1424 }1424 }
1425}1425}
14261426
14271427
=== modified file 'dash/DashView.h'
--- dash/DashView.h 2015-02-03 09:46:48 +0000
+++ dash/DashView.h 2015-04-24 13:00:45 +0000
@@ -170,10 +170,8 @@
170170
171 LocalResult last_activated_result_;171 LocalResult last_activated_result_;
172 guint64 last_activated_timestamp_;172 guint64 last_activated_timestamp_;
173 bool search_in_progress_;
174 bool activate_on_finish_;173 bool activate_on_finish_;
175 glib::Source::UniquePtr activate_timeout_;174 glib::Source::UniquePtr activate_delay_;
176
177 bool visible_;175 bool visible_;
178176
179 nux::ObjectPtr<nux::IOpenGLBaseTexture> dash_view_copy_;177 nux::ObjectPtr<nux::IOpenGLBaseTexture> dash_view_copy_;
180178
=== modified file 'dash/ResultView.cpp'
--- dash/ResultView.cpp 2014-03-20 05:13:04 +0000
+++ dash/ResultView.cpp 2015-04-24 13:00:45 +0000
@@ -23,6 +23,7 @@
2323
24#include "ResultView.h"24#include "ResultView.h"
2525
26#include <boost/algorithm/string.hpp>
26#include <Nux/Layout.h>27#include <Nux/Layout.h>
2728
28#include "unity-shared/IntrospectableWrappers.h"29#include "unity-shared/IntrospectableWrappers.h"
@@ -49,6 +50,7 @@
49 , scale(DEFAULT_SCALE)50 , scale(DEFAULT_SCALE)
50 , renderer_(NULL)51 , renderer_(NULL)
51 , cached_result_(nullptr, nullptr, nullptr)52 , cached_result_(nullptr, nullptr, nullptr)
53 , default_click_activation_(ActivateType::PREVIEW)
52{54{
53 expanded.changed.connect([this](bool value)55 expanded.changed.connect([this](bool value)
54 {56 {
@@ -61,6 +63,21 @@
61 NeedRedraw();63 NeedRedraw();
62 });64 });
6365
66 default_click_activation.SetGetterFunction([this] {
67 if (Settings::Instance().double_click_activate())
68 return default_click_activation_;
69 return ActivateType::DIRECT;
70 });
71
72 default_click_activation.SetSetterFunction([this] (ActivateType at) {
73 if (default_click_activation_ != at)
74 {
75 default_click_activation_ = at;
76 return true;
77 }
78 return false;
79 });
80
64 Settings::Instance().font_scaling.changed.connect(sigc::mem_fun(this, &ResultView::UpdateFontScale));81 Settings::Instance().font_scaling.changed.connect(sigc::mem_fun(this, &ResultView::UpdateFontScale));
65 enable_texture_render.changed.connect(sigc::mem_fun(this, &ResultView::OnEnableRenderToTexture));82 enable_texture_render.changed.connect(sigc::mem_fun(this, &ResultView::OnEnableRenderToTexture));
66 scale.changed.connect(sigc::mem_fun(this, &ResultView::UpdateScale));83 scale.changed.connect(sigc::mem_fun(this, &ResultView::UpdateScale));
@@ -208,6 +225,14 @@
208 return LocalResult(*GetIteratorAtRow(index));225 return LocalResult(*GetIteratorAtRow(index));
209}226}
210227
228ResultView::ActivateType ResultView::GetLocalResultActivateType(LocalResult const& result) const
229{
230 if (boost::starts_with(result.uri, "x-unity-no-preview"))
231 return ActivateType::DIRECT;
232
233 return ActivateType::PREVIEW;
234}
235
211void ResultView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)236void ResultView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
212{}237{}
213238
214239
=== modified file 'dash/ResultView.h'
--- dash/ResultView.h 2014-03-20 05:13:04 +0000
+++ dash/ResultView.h 2015-04-24 13:00:45 +0000
@@ -58,12 +58,11 @@
58class ResultView : public nux::View, public debug::Introspectable58class ResultView : public nux::View, public debug::Introspectable
59{59{
60public:60public:
61 typedef enum ActivateType_61 enum class ActivateType
62 {62 {
63 DIRECT,63 DIRECT,
64 PREVIEW_LEFT_BUTTON,
65 PREVIEW64 PREVIEW
66 } ActivateType;65 };
6766
68 NUX_DECLARE_OBJECT_TYPE(ResultView, nux::View);67 NUX_DECLARE_OBJECT_TYPE(ResultView, nux::View);
6968
@@ -73,8 +72,9 @@
73 void SetModelRenderer(ResultRenderer* renderer);72 void SetModelRenderer(ResultRenderer* renderer);
74 void SetResultsModel(Results::Ptr const& results);73 void SetResultsModel(Results::Ptr const& results);
7574
76 unsigned int GetIndexForLocalResult(LocalResult const& local_result);75 unsigned int GetIndexForLocalResult(LocalResult const&);
77 LocalResult GetLocalResultForIndex(unsigned int);76 LocalResult GetLocalResultForIndex(unsigned int);
77 ActivateType GetLocalResultActivateType(LocalResult const&) const;
7878
79 nux::Property<bool> expanded;79 nux::Property<bool> expanded;
80 nux::Property<int> results_per_row;80 nux::Property<int> results_per_row;
@@ -82,6 +82,7 @@
82 nux::Property<float> desaturation_progress;82 nux::Property<float> desaturation_progress;
83 nux::Property<bool> enable_texture_render;83 nux::Property<bool> enable_texture_render;
84 nux::Property<double> scale;84 nux::Property<double> scale;
85 nux::RWProperty<ActivateType> default_click_activation;
8586
86 sigc::signal<void, LocalResult const&, ActivateType, GVariant*> ResultActivated;87 sigc::signal<void, LocalResult const&, ActivateType, GVariant*> ResultActivated;
8788
@@ -130,6 +131,7 @@
130 void UpdateFontScale(double scale);131 void UpdateFontScale(double scale);
131132
132 Result cached_result_;133 Result cached_result_;
134 ActivateType default_click_activation_;
133 connection::Manager result_connections_;135 connection::Manager result_connections_;
134};136};
135137
136138
=== modified file 'dash/ResultViewGrid.cpp'
--- dash/ResultViewGrid.cpp 2014-03-20 04:05:39 +0000
+++ dash/ResultViewGrid.cpp 2015-04-24 13:00:45 +0000
@@ -24,8 +24,6 @@
24#include <NuxCore/Logger.h>24#include <NuxCore/Logger.h>
25#include <Nux/VLayout.h>25#include <Nux/VLayout.h>
26#include <NuxGraphics/GdkGraphics.h>26#include <NuxGraphics/GdkGraphics.h>
27#include <gtk/gtk.h>
28#include <gdk/gdk.h>
29#include <unity-protocol.h>27#include <unity-protocol.h>
3028
31#include "unity-shared/IntrospectableWrappers.h"29#include "unity-shared/IntrospectableWrappers.h"
@@ -34,7 +32,6 @@
34#include "unity-shared/UBusMessages.h"32#include "unity-shared/UBusMessages.h"
35#include "unity-shared/GraphicsUtils.h"33#include "unity-shared/GraphicsUtils.h"
36#include "unity-shared/RawPixel.h"34#include "unity-shared/RawPixel.h"
37#include "unity-shared/UnitySettings.h"
38#include "unity-shared/WindowManager.h"35#include "unity-shared/WindowManager.h"
39#include "ResultViewGrid.h"36#include "ResultViewGrid.h"
40#include "math.h"37#include "math.h"
@@ -94,8 +91,7 @@
94 scale.changed.connect(sigc::mem_fun(this, &ResultViewGrid::UpdateScale));91 scale.changed.connect(sigc::mem_fun(this, &ResultViewGrid::UpdateScale));
9592
96 key_nav_focus_change.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyNavFocusChange));93 key_nav_focus_change.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyNavFocusChange));
97 key_nav_focus_activate.connect([this] (nux::Area *area)94 key_nav_focus_activate.connect([this] (nux::Area *area) {
98 {
99 Activate(focused_result_, selected_index_, ResultView::ActivateType::DIRECT);95 Activate(focused_result_, selected_index_, ResultView::ActivateType::DIRECT);
100 });96 });
101 key_down.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyDown));97 key_down.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyDown));
@@ -210,6 +206,12 @@
210 row_y += row_index * row_height;206 row_y += row_index * row_height;
211 }207 }
212208
209 if (type == ActivateType::PREVIEW)
210 {
211 if (GetLocalResultActivateType(local_result) != type)
212 type = ActivateType::DIRECT;
213 }
214
213 active_index_ = index;215 active_index_ = index;
214 guint64 timestamp = nux::GetGraphicsDisplay()->GetCurrentEvent().x11_timestamp;216 guint64 timestamp = nux::GetGraphicsDisplay()->GetCurrentEvent().x11_timestamp;
215 glib::Variant data(g_variant_new("(tiiiiii)", timestamp, column_x, row_y, column_width, row_height, left_results, right_results));217 glib::Variant data(g_variant_new("(tiiiiii)", timestamp, column_x, row_y, column_width, row_height, left_results, right_results));
@@ -796,6 +798,7 @@
796 unsigned num_results = GetNumResults();798 unsigned num_results = GetNumResults();
797 unsigned index = GetIndexAtPosition(x, y);799 unsigned index = GetIndexAtPosition(x, y);
798 mouse_over_index_ = index;800 mouse_over_index_ = index;
801
799 if (index < num_results)802 if (index < num_results)
800 {803 {
801 // we got a click on a button so activate it804 // we got a click on a button so activate it
@@ -805,32 +808,32 @@
805 focused_result_ = result;808 focused_result_ = result;
806 activated_result_ = result;809 activated_result_ = result;
807810
808
809 if (nux::GetEventButton(button_flags) == nux::NUX_MOUSE_BUTTON1)811 if (nux::GetEventButton(button_flags) == nux::NUX_MOUSE_BUTTON1)
810 {812 {
811 if (unity::Settings::Instance().double_click_activate)813 if (default_click_activation() == ActivateType::PREVIEW &&
814 GetLocalResultActivateType(activated_result_) == ActivateType::PREVIEW)
812 {815 {
813 // delay activate for single left click. (for double click check)816 // delay activate for single left click. (for double click check)
814 activate_timer_.reset(new glib::Timeout(DOUBLE_CLICK_SPEED, [this, index]() {817 activate_timer_.reset(new glib::Timeout(DOUBLE_CLICK_SPEED, [this, index] {
815 Activate(activated_result_, index, ResultView::ActivateType::PREVIEW_LEFT_BUTTON);818 Activate(activated_result_, index, ActivateType::PREVIEW);
816 return false;819 return false;
817 }));820 }));
818 }821 }
819 else822 else
820 {823 {
821 Activate(activated_result_, index, ResultView::ActivateType::DIRECT);824 Activate(activated_result_, index, ActivateType::DIRECT);
822 }825 }
823 }826 }
824 else827 else
825 {828 {
826 Activate(activated_result_, index, ResultView::ActivateType::PREVIEW);829 Activate(activated_result_, index, ActivateType::PREVIEW);
827 }830 }
828 }831 }
829}832}
830833
831void ResultViewGrid::MouseDoubleClick(int x, int y, unsigned long button_flags, unsigned long key_flags)834void ResultViewGrid::MouseDoubleClick(int x, int y, unsigned long button_flags, unsigned long key_flags)
832{835{
833 if (unity::Settings::Instance().double_click_activate == false)836 if (default_click_activation() == ActivateType::DIRECT)
834 return;837 return;
835838
836 unsigned num_results = GetNumResults();839 unsigned num_results = GetNumResults();
@@ -845,7 +848,7 @@
845 focused_result_ = result;848 focused_result_ = result;
846849
847 activated_result_ = result;850 activated_result_ = result;
848 Activate(activated_result_, index, ResultView::ActivateType::DIRECT);851 Activate(activated_result_, index, ActivateType::DIRECT);
849 }852 }
850}853}
851854
852855
=== modified file 'dash/ScopeView.cpp'
--- dash/ScopeView.cpp 2014-07-11 22:26:26 +0000
+++ dash/ScopeView.cpp 2015-04-24 13:00:45 +0000
@@ -481,47 +481,40 @@
481 /* Reset result count */481 /* Reset result count */
482 counts_[group] = 0;482 counts_[group] = 0;
483483
484 ResultView* results_view = nullptr;484 auto* results_view = new ResultViewGrid(NUX_TRACKER_LOCATION);
485
485 if (category.GetContentType() == "social" && category.renderer_name == "default")486 if (category.GetContentType() == "social" && category.renderer_name == "default")
486 {487 {
487 results_view = new ResultViewGrid(NUX_TRACKER_LOCATION);
488 results_view->SetModelRenderer(new ResultRendererHorizontalTile(NUX_TRACKER_LOCATION));488 results_view->SetModelRenderer(new ResultRendererHorizontalTile(NUX_TRACKER_LOCATION));
489 static_cast<ResultViewGrid*> (results_view)->horizontal_spacing = CARD_VIEW_GAP_HORIZ.CP(scale());489 results_view->horizontal_spacing = CARD_VIEW_GAP_HORIZ.CP(scale());
490 static_cast<ResultViewGrid*> (results_view)->vertical_spacing = CARD_VIEW_GAP_VERT.CP(scale());490 results_view->vertical_spacing = CARD_VIEW_GAP_VERT.CP(scale());
491 }491 }
492 else492 else
493 {493 {
494 results_view = new ResultViewGrid(NUX_TRACKER_LOCATION);
495 results_view->SetModelRenderer(new ResultRendererTile(NUX_TRACKER_LOCATION));494 results_view->SetModelRenderer(new ResultRendererTile(NUX_TRACKER_LOCATION));
496 }495 }
497496
498 if (scope_)497 if (scope_)
499 {498 {
500 const std::string category_id = category.id();499 results_view->unique_id = name + scope_->name();
501 std::string unique_id = category.name() + scope_->name();
502 results_view->unique_id = unique_id;
503 results_view->expanded = false;500 results_view->expanded = false;
504501
505 results_view->ResultActivated.connect([this, unique_id, category_id] (LocalResult const& local_result, ResultView::ActivateType type, GVariant* data)502 if (scope_->id() == "applications.scope" ||
506 {503 (scope_->id() == "home.scope" && category.id() == "applications.scope"))
507 if (g_str_has_prefix(local_result.uri.c_str(), "x-unity-no-preview"))504 {
508 type = ResultView::ActivateType::DIRECT;505 results_view->default_click_activation = ResultView::ActivateType::DIRECT;
509506 }
510 // Applications scope results should be activated on left-click (instead of preview). Note that app scope can still507
511 // respond with preview for activation request (the case for uninstalled apps).508 results_view->ResultActivated.connect([this, results_view] (LocalResult const& local_result, ResultView::ActivateType type, GVariant* data)
512 bool is_app_scope_result = (scope_->id() == "applications.scope" || (scope_->id() == "home.scope" && category_id == "applications.scope"));509 {
513510 result_activated.emit(type, local_result, data, results_view->unique_id());
514 if (is_app_scope_result && type == ResultView::ActivateType::PREVIEW_LEFT_BUTTON)511
515 type = ResultView::ActivateType::DIRECT;
516
517 result_activated.emit(type, local_result, data, unique_id);
518 switch (type)512 switch (type)
519 {513 {
520 case ResultView::ActivateType::DIRECT:514 case ResultView::ActivateType::DIRECT:
521 {515 {
522 scope_->Activate(local_result, nullptr, cancellable_);516 scope_->Activate(local_result, nullptr, cancellable_);
523 } break;517 } break;
524 case ResultView::ActivateType::PREVIEW_LEFT_BUTTON:
525 case ResultView::ActivateType::PREVIEW:518 case ResultView::ActivateType::PREVIEW:
526 {519 {
527 scope_->Preview(local_result, nullptr, cancellable_);520 scope_->Preview(local_result, nullptr, cancellable_);
528521
=== modified file 'hud/HudButton.cpp'
--- hud/HudButton.cpp 2014-07-30 00:49:35 +0000
+++ hud/HudButton.cpp 2015-04-24 13:00:45 +0000
@@ -20,11 +20,6 @@
20 */20 */
21#include "config.h"21#include "config.h"
2222
23#include <pango/pango.h>
24#include <pango/pangocairo.h>
25#include <gdk/gdk.h>
26#include <gtk/gtk.h>
27
28#include <Nux/Nux.h>23#include <Nux/Nux.h>
29#include <Nux/HLayout.h>24#include <Nux/HLayout.h>
30#include <NuxGraphics/CairoGraphics.h>25#include <NuxGraphics/CairoGraphics.h>
3126
=== modified file 'hud/HudController.h'
--- hud/HudController.h 2014-07-11 01:45:49 +0000
+++ hud/HudController.h 2015-04-24 13:00:45 +0000
@@ -22,7 +22,6 @@
22#include <functional>22#include <functional>
23#include <memory>23#include <memory>
2424
25#include <gdk/gdk.h>
26#include <UnityCore/Hud.h>25#include <UnityCore/Hud.h>
27#include <UnityCore/GLibSignal.h>26#include <UnityCore/GLibSignal.h>
2827
2928
=== modified file 'launcher/DeviceNotificationDisplayImp.cpp'
--- launcher/DeviceNotificationDisplayImp.cpp 2013-10-03 23:48:48 +0000
+++ launcher/DeviceNotificationDisplayImp.cpp 2015-04-24 13:00:45 +0000
@@ -17,7 +17,6 @@
17 * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>17 * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
18 */18 */
1919
20#include <gdk/gdk.h>
21#include "config.h"20#include "config.h"
22#include <glib/gi18n-lib.h>21#include <glib/gi18n-lib.h>
23#include <libnotify/notify.h>22#include <libnotify/notify.h>
2423
=== modified file 'unity-shared/BGHash.cpp'
--- unity-shared/BGHash.cpp 2014-12-11 12:54:37 +0000
+++ unity-shared/BGHash.cpp 2015-04-24 13:00:45 +0000
@@ -116,8 +116,11 @@
116 .SetDuration(skip_animation ? 0 : TRANSITION_DURATION)116 .SetDuration(skip_animation ? 0 : TRANSITION_DURATION)
117 .Start();117 .Start();
118118
119 // This will make sure that the animation starts even if the screen is idle.119 if (nux::WindowThread* wt = nux::GetWindowThread())
120 nux::GetWindowThread()->RequestRedraw();120 {
121 // This will make sure that the animation starts even if the screen is idle.
122 wt->RequestRedraw();
123 }
121}124}
122125
123void BGHash::OnTransitionUpdated(nux::Color const& new_color)126void BGHash::OnTransitionUpdated(nux::Color const& new_color)
124127
=== modified file 'unity-shared/SearchBar.cpp'
--- unity-shared/SearchBar.cpp 2014-09-04 22:11:33 +0000
+++ unity-shared/SearchBar.cpp 2015-04-24 13:00:45 +0000
@@ -141,6 +141,9 @@
141 : View(NUX_FILE_LINE_PARAM)141 : View(NUX_FILE_LINE_PARAM)
142 , showing_filters(false)142 , showing_filters(false)
143 , can_refine_search(false)143 , can_refine_search(false)
144 , im_active([this] { return pango_entry_->im_active(); })
145 , im_preedit([this] { return pango_entry_->im_preedit(); })
146 , in_live_search([this] { return live_search_timeout_ && live_search_timeout_->IsRunning(); })
144 , live_search_wait(DEFAULT_LIVE_SEARCH_TIMEOUT)147 , live_search_wait(DEFAULT_LIVE_SEARCH_TIMEOUT)
145 , scale(DEFAULT_SCALE)148 , scale(DEFAULT_SCALE)
146 , show_filter_hint_(show_filter_hint)149 , show_filter_hint_(show_filter_hint)
@@ -179,11 +182,11 @@
179 pango_entry_->mouse_down.connect(sigc::mem_fun(this, &SearchBar::OnMouseButtonDown));182 pango_entry_->mouse_down.connect(sigc::mem_fun(this, &SearchBar::OnMouseButtonDown));
180 pango_entry_->end_key_focus.connect(sigc::mem_fun(this, &SearchBar::OnEndKeyFocus));183 pango_entry_->end_key_focus.connect(sigc::mem_fun(this, &SearchBar::OnEndKeyFocus));
181 pango_entry_->key_up.connect([this] (unsigned int, unsigned long, unsigned long) {184 pango_entry_->key_up.connect([this] (unsigned int, unsigned long, unsigned long) {
182 if (get_im_preedit())185 if (im_preedit())
183 {186 {
184 hint_->SetVisible(false);187 hint_->SetVisible(false);
185 hint_->QueueDraw();188 hint_->QueueDraw();
186 }189 }
187 });190 });
188191
189 layered_layout_ = new nux::LayeredLayout();192 layered_layout_ = new nux::LayeredLayout();
@@ -263,10 +266,8 @@
263 OnFontChanged();266 OnFontChanged();
264267
265 search_hint.changed.connect([this](std::string const& s) { OnSearchHintChanged(); });268 search_hint.changed.connect([this](std::string const& s) { OnSearchHintChanged(); });
266 search_string.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_search_string));269 search_string.SetGetterFunction([this] { return pango_entry_->GetText(); });
267 search_string.SetSetterFunction(sigc::mem_fun(this, &SearchBar::set_search_string));270 search_string.SetSetterFunction(sigc::mem_fun(this, &SearchBar::set_search_string));
268 im_active.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_active));
269 im_preedit.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_preedit));
270 showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged));271 showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged));
271 scale.changed.connect(sigc::mem_fun(this, &SearchBar::UpdateScale));272 scale.changed.connect(sigc::mem_fun(this, &SearchBar::UpdateScale));
272 Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateSearchBarSize)));273 Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateSearchBarSize)));
@@ -633,11 +634,6 @@
633 return expander_view_;634 return expander_view_;
634}635}
635636
636std::string SearchBar::get_search_string() const
637{
638 return pango_entry_->GetText();
639}
640
641bool SearchBar::set_search_string(std::string const& string)637bool SearchBar::set_search_string(std::string const& string)
642{638{
643 pango_entry_->SetText(string.c_str());639 pango_entry_->SetText(string.c_str());
@@ -649,16 +645,6 @@
649 return true;645 return true;
650}646}
651647
652bool SearchBar::get_im_active() const
653{
654 return pango_entry_->im_active();
655}
656
657bool SearchBar::get_im_preedit() const
658{
659 return pango_entry_->im_preedit();
660}
661
662//648//
663// Highlight649// Highlight
664//650//
665651
=== modified file 'unity-shared/SearchBar.h'
--- unity-shared/SearchBar.h 2014-08-06 19:46:43 +0000
+++ unity-shared/SearchBar.h 2015-04-24 13:00:45 +0000
@@ -63,6 +63,7 @@
63 nux::Property<bool> can_refine_search;63 nux::Property<bool> can_refine_search;
64 nux::ROProperty<bool> im_active;64 nux::ROProperty<bool> im_active;
65 nux::ROProperty<bool> im_preedit;65 nux::ROProperty<bool> im_preedit;
66 nux::ROProperty<bool> in_live_search;
66 nux::Property<unsigned> live_search_wait;67 nux::Property<unsigned> live_search_wait;
67 nux::Property<double> scale;68 nux::Property<double> scale;
6869
@@ -88,10 +89,7 @@
88 bool OnLiveSearchTimeout();89 bool OnLiveSearchTimeout();
89 bool OnSpinnerStartCb();90 bool OnSpinnerStartCb();
9091
91 std::string get_search_string() const;
92 bool set_search_string(std::string const& string);92 bool set_search_string(std::string const& string);
93 bool get_im_active() const;
94 bool get_im_preedit() const;
95 bool show_filter_hint_;93 bool show_filter_hint_;
9694
97 std::string GetName() const;95 std::string GetName() const;