diff options
| author | Manuel de la Pena <manuel@canonical.com> | 2013-05-17 12:01:04 +0200 |
|---|---|---|
| committer | Manuel de la Pena <manuel@canonical.com> | 2013-05-17 12:01:04 +0200 |
| commit | a3629e69d051b1333553a73c162563f943b85a02 (patch) | |
| tree | f74a75672b109f7fff9577b30907d422fa117b0c /dash | |
| parent | 4020aa1c98baec33a6391f2fd24a194b6083ea38 (diff) | |
| parent | cad51b9ebe2beea1c3a1d59113db9700753ce03f (diff) | |
Merged with trunk.
(bzr r3263.2.32)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/DashView.cpp | 33 | ||||
| -rw-r--r-- | dash/DashView.h | 1 | ||||
| -rw-r--r-- | dash/ResultRenderer.cpp | 4 |
3 files changed, 24 insertions, 14 deletions
diff --git a/dash/DashView.cpp b/dash/DashView.cpp index 1e93c6e20..831a5d078 100644 --- a/dash/DashView.cpp +++ b/dash/DashView.cpp @@ -57,6 +57,8 @@ const int DASH_RESULT_RIGHT_PAD = 35; const int GROUP_HEADING_HEIGHT = 24; const int PREVIEW_ICON_SPLIT_OFFSCREEN_OFFSET = 10; + +const int MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT = 1000; } // This is so we can access some protected members in nux::VLayout and @@ -190,7 +192,7 @@ bool DashView::IsCommandLensOpen() const } -void DashView::OnResultActivated(ResultView::ActivateType type, LocalResult const& local_result, GVariant* data, std::string const& unique_id) +void DashView::OnResultActivated(ResultView::ActivateType type, LocalResult const& local_result, GVariant* data, std::string const& unique_id) { last_activated_result_ = local_result; stored_activated_unique_id_ = unique_id; @@ -226,7 +228,7 @@ void DashView::OnResultActivated(ResultView::ActivateType type, LocalResult cons void DashView::BuildPreview(Preview::Ptr model) { if (!preview_displaying_) - { + { StartPreviewAnimation(); content_view_->SetPresentRedirectedView(false); @@ -369,7 +371,7 @@ void DashView::StartPreviewAnimation() }); split_animation_->finished.connect(sigc::mem_fun(this, &DashView::OnPreviewAnimationFinished)); - split_animation_->Start(); + split_animation_->Start(); } void DashView::EndPreviewAnimation() @@ -474,12 +476,12 @@ void DashView::AboutToShow() /* Give the scopes a chance to prep data before we map them */ if (active_scope_view_) - { + { scope_bar_->Activate(active_scope_view_->scope()->id()); active_scope_view_->SetVisible(true); active_scope_view_->scope()->view_type = ScopeViewType::SCOPE_VIEW; - + // this will make sure the spinner animates if the search takes a while search_bar_->ForceLiveSearch(); } @@ -704,7 +706,7 @@ void DashView::DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw graphics_engine.PushClippingRectangle(geo_split_clip); if (preview_scope_view_.IsValid()) - { + { DrawPreviewResultTextures(graphics_engine, force_draw); } @@ -923,7 +925,7 @@ void DashView::DrawPreviewResultTextures(nux::GraphicsEngine& graphics_engine, b std::vector<ResultViewTexture::Ptr> result_textures = preview_scope_view_->GetResultTextureContainers(); std::vector<ResultViewTexture::Ptr> top_textures; - + int height_concat_below = 0; // int i = 0; @@ -1063,12 +1065,12 @@ void DashView::DrawPreview(nux::GraphicsEngine& graphics_engine, bool force_draw } preview_container_->SetPresentRedirectedView(true); - + graphics_engine.GetRenderStates().SetBlend(alpha, src, dest); } else { - preview_container_->ProcessDraw(graphics_engine, preview_force_draw); + preview_container_->ProcessDraw(graphics_engine, preview_force_draw); } if (preview_force_draw) @@ -1109,10 +1111,10 @@ void DashView::OnActivateRequest(GVariant* args) if (visible_ && handled_type == ScopeHandledType::NOT_HANDLED) { ubus_manager_.SendMessage(UBUS_OVERLAY_CLOSE_REQUEST, NULL, - glib::Source::Priority::HIGH); + glib::Source::Priority::HIGH); } else if (!visible_ || handled_type == ScopeHandledType::GOTO_DASH_URI) - { + { if (!scopes_->GetScope(id)) { // should trigger the addition of the scope. @@ -1210,7 +1212,8 @@ void DashView::OnScopeSearchFinished(std::string const& scope_id, std::string co search_bar_->SetSearchFinished(); search_in_progress_ = false; - + + activate_timeout_.reset(); if (activate_on_finish_ && !err) OnEntryActivated(); activate_on_finish_= false; @@ -1350,6 +1353,12 @@ void DashView::OnEntryActivated() } // delay the activation until we get the SearchFinished signal activate_on_finish_ = search_in_progress_; + + activate_timeout_.reset(new glib::Timeout(MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT, [this] { + activate_on_finish_ = false; + active_scope_view_->ActivateFirst(); + return FALSE; + })); } // Keyboard navigation diff --git a/dash/DashView.h b/dash/DashView.h index 28105e2fe..8cdcd23e6 100644 --- a/dash/DashView.h +++ b/dash/DashView.h @@ -162,6 +162,7 @@ private: guint64 last_activated_timestamp_; bool search_in_progress_; bool activate_on_finish_; + glib::Source::UniquePtr activate_timeout_; bool visible_; diff --git a/dash/ResultRenderer.cpp b/dash/ResultRenderer.cpp index 2454d298b..551fa639a 100644 --- a/dash/ResultRenderer.cpp +++ b/dash/ResultRenderer.cpp @@ -94,7 +94,7 @@ GdkPixbuf* _icon_hint_get_drag_pixbuf(std::string icon_hint, int size) if (gtk_icon_info_get_filename(info) == NULL) { - gtk_icon_info_free(info); + g_object_unref(G_OBJECT(info)); info = gtk_icon_theme_lookup_icon(theme, "application-default-icon", size, @@ -109,7 +109,7 @@ GdkPixbuf* _icon_hint_get_drag_pixbuf(std::string icon_hint, int size) pbuf = NULL; } - gtk_icon_info_free(info); + g_object_unref(G_OBJECT(info)); return pbuf; } |
