diff -Nru unity-7.3.2+15.10.20150512/dash/DashController.h unity-7.3.2+15.10.20150522/dash/DashController.h --- unity-7.3.2+15.10.20150512/dash/DashController.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/DashController.h 2015-05-22 13:20:35.000000000 +0000 @@ -21,7 +21,6 @@ #include -#include #include #include #include diff -Nru unity-7.3.2+15.10.20150512/dash/DashView.cpp unity-7.3.2+15.10.20150522/dash/DashView.cpp --- unity-7.3.2+15.10.20150512/dash/DashView.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/DashView.cpp 2015-05-22 13:21:00.000000000 +0000 @@ -59,7 +59,7 @@ const RawPixel PREVIEW_CONTAINER_TRIANGLE_WIDTH = 14_em; const RawPixel PREVIEW_CONTAINER_TRIANGLE_HEIGHT = 12_em; -const int MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT = 1000; +const int MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT = 300; } // This is so we can access some protected members in nux::VLayout and @@ -120,7 +120,6 @@ , preview_displaying_(false) , preview_navigation_mode_(previews::Navigation::NONE) , last_activated_timestamp_(0) - , search_in_progress_(false) , activate_on_finish_(false) , visible_(false) , opening_column_x_(-1) @@ -482,6 +481,7 @@ // this will make sure the spinner animates if the search takes a while search_bar_->ForceLiveSearch(); + search_bar_->search_hint = active_scope_view_->scope()->search_hint; } // if a preview is open, close it @@ -1221,21 +1221,27 @@ void DashView::OnSearchChanged(std::string const& search_string) { - search_in_progress_ = true; + activate_on_finish_ = false; } void DashView::OnLiveSearchReached(std::string const& search_string) { - // reset and set it again once we're sure a search is happening - search_in_progress_ = false; - LOG_DEBUG(logger) << "Live search reached: " << search_string; - if (active_scope_view_) + if (!active_scope_view_.IsValid()) + return; + + if (active_scope_view_->PerformSearch(search_string, sigc::mem_fun(this, &DashView::OnScopeSearchFinished))) { - if (active_scope_view_->PerformSearch(search_string, sigc::mem_fun(this, &DashView::OnScopeSearchFinished))) - { - search_in_progress_ = true; - } + activate_delay_.reset(new glib::Timeout(MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT, [this] { + if (activate_on_finish_) + { + activate_on_finish_ = false; + active_scope_view_->ActivateFirst(); + } + + activate_delay_.reset(); + return false; + })); } } @@ -1254,12 +1260,15 @@ LOG_DEBUG(logger) << "Search completed: " << search_string; search_bar_->SetSearchFinished(); - search_in_progress_ = false; - activate_timeout_.reset(); - if (activate_on_finish_ && !err) - OnEntryActivated(); - activate_on_finish_= false; + if (activate_on_finish_) + { + activate_on_finish_ = false; + activate_delay_.reset(); + + if (!err) + active_scope_view_->ActivateFirst(); + } } } @@ -1407,20 +1416,12 @@ } void DashView::OnEntryActivated() { - if (active_scope_view_.IsValid() && !search_in_progress_) - { - active_scope_view_->ActivateFirst(); - } - // delay the activation until we get the SearchFinished signal - activate_on_finish_ = search_in_progress_; - - if (activate_on_finish_) + if (active_scope_view_.IsValid()) { - activate_timeout_.reset(new glib::Timeout(MAX_ENTRY_ACTIVATE_WAIT_TIMEOUT, [this] { - activate_on_finish_ = false; + if (!activate_delay_ && !search_bar_->in_live_search()) active_scope_view_->ActivateFirst(); - return FALSE; - })); + else + activate_on_finish_ = true; } } @@ -1576,11 +1577,9 @@ direction = KEY_NAV_RIGHT; break; case NUX_VK_LEFT_TAB: - case NUX_VK_PAGE_UP: direction = KEY_NAV_TAB_PREVIOUS; break; case NUX_VK_TAB: - case NUX_VK_PAGE_DOWN: direction = KEY_NAV_TAB_NEXT; break; case NUX_VK_ENTER: @@ -1588,6 +1587,14 @@ // Not sure if Enter should be a navigation key direction = KEY_NAV_ENTER; break; + case NUX_VK_PAGE_UP: + case NUX_VK_PAGE_DOWN: + if (!preview_displaying_) + { + active_scope_view_->PerformPageNavigation((x11_key_code == NUX_VK_PAGE_UP) ? ScrollDir::UP : ScrollDir::DOWN); + return nux::GetWindowCompositor().GetKeyFocusArea(); + } + break; default: auto const& close_key = WindowManager::Default().close_window_key(); diff -Nru unity-7.3.2+15.10.20150512/dash/DashView.h unity-7.3.2+15.10.20150522/dash/DashView.h --- unity-7.3.2+15.10.20150512/dash/DashView.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/DashView.h 2015-05-22 13:20:35.000000000 +0000 @@ -170,10 +170,8 @@ LocalResult last_activated_result_; guint64 last_activated_timestamp_; - bool search_in_progress_; bool activate_on_finish_; - glib::Source::UniquePtr activate_timeout_; - + glib::Source::UniquePtr activate_delay_; bool visible_; nux::ObjectPtr dash_view_copy_; diff -Nru unity-7.3.2+15.10.20150512/dash/ResultView.cpp unity-7.3.2+15.10.20150522/dash/ResultView.cpp --- unity-7.3.2+15.10.20150512/dash/ResultView.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/ResultView.cpp 2015-05-22 13:20:35.000000000 +0000 @@ -23,6 +23,7 @@ #include "ResultView.h" +#include #include #include "unity-shared/IntrospectableWrappers.h" @@ -49,6 +50,7 @@ , scale(DEFAULT_SCALE) , renderer_(NULL) , cached_result_(nullptr, nullptr, nullptr) + , default_click_activation_(ActivateType::PREVIEW) { expanded.changed.connect([this](bool value) { @@ -61,6 +63,21 @@ NeedRedraw(); }); + default_click_activation.SetGetterFunction([this] { + if (Settings::Instance().double_click_activate()) + return default_click_activation_; + return ActivateType::DIRECT; + }); + + default_click_activation.SetSetterFunction([this] (ActivateType at) { + if (default_click_activation_ != at) + { + default_click_activation_ = at; + return true; + } + return false; + }); + Settings::Instance().font_scaling.changed.connect(sigc::mem_fun(this, &ResultView::UpdateFontScale)); enable_texture_render.changed.connect(sigc::mem_fun(this, &ResultView::OnEnableRenderToTexture)); scale.changed.connect(sigc::mem_fun(this, &ResultView::UpdateScale)); @@ -208,6 +225,14 @@ return LocalResult(*GetIteratorAtRow(index)); } +ResultView::ActivateType ResultView::GetLocalResultActivateType(LocalResult const& result) const +{ + if (boost::starts_with(result.uri, "x-unity-no-preview")) + return ActivateType::DIRECT; + + return ActivateType::PREVIEW; +} + void ResultView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) {} diff -Nru unity-7.3.2+15.10.20150512/dash/ResultViewGrid.cpp unity-7.3.2+15.10.20150522/dash/ResultViewGrid.cpp --- unity-7.3.2+15.10.20150512/dash/ResultViewGrid.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/ResultViewGrid.cpp 2015-05-22 13:20:51.000000000 +0000 @@ -24,9 +24,8 @@ #include #include #include -#include -#include #include +#include #include "unity-shared/IntrospectableWrappers.h" #include "unity-shared/Timer.h" @@ -34,8 +33,8 @@ #include "unity-shared/UBusMessages.h" #include "unity-shared/GraphicsUtils.h" #include "unity-shared/RawPixel.h" -#include "unity-shared/UnitySettings.h" #include "unity-shared/WindowManager.h" +#include #include "ResultViewGrid.h" #include "math.h" @@ -58,6 +57,8 @@ const RawPixel WIDTH_PADDING = 25_em; const RawPixel SCROLLBAR_WIDTH = 3_em; + + const std::string APPLICATION_URI_PREFIX = "application://"; } NUX_IMPLEMENT_OBJECT_TYPE(ResultViewGrid); @@ -94,8 +95,7 @@ scale.changed.connect(sigc::mem_fun(this, &ResultViewGrid::UpdateScale)); key_nav_focus_change.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyNavFocusChange)); - key_nav_focus_activate.connect([this] (nux::Area *area) - { + key_nav_focus_activate.connect([this] (nux::Area *area) { Activate(focused_result_, selected_index_, ResultView::ActivateType::DIRECT); }); key_down.connect(sigc::mem_fun(this, &ResultViewGrid::OnKeyDown)); @@ -210,6 +210,12 @@ row_y += row_index * row_height; } + if (type == ActivateType::PREVIEW) + { + if (GetLocalResultActivateType(local_result) != type) + type = ActivateType::DIRECT; + } + active_index_ = index; guint64 timestamp = nux::GetGraphicsDisplay()->GetCurrentEvent().x11_timestamp; glib::Variant data(g_variant_new("(tiiiiii)", timestamp, column_x, row_y, column_width, row_height, left_results, right_results)); @@ -796,6 +802,7 @@ unsigned num_results = GetNumResults(); unsigned index = GetIndexAtPosition(x, y); mouse_over_index_ = index; + if (index < num_results) { // we got a click on a button so activate it @@ -805,32 +812,32 @@ focused_result_ = result; activated_result_ = result; - if (nux::GetEventButton(button_flags) == nux::NUX_MOUSE_BUTTON1) { - if (unity::Settings::Instance().double_click_activate) + if (default_click_activation() == ActivateType::PREVIEW && + GetLocalResultActivateType(activated_result_) == ActivateType::PREVIEW) { // delay activate for single left click. (for double click check) - activate_timer_.reset(new glib::Timeout(DOUBLE_CLICK_SPEED, [this, index]() { - Activate(activated_result_, index, ResultView::ActivateType::PREVIEW_LEFT_BUTTON); + activate_timer_.reset(new glib::Timeout(DOUBLE_CLICK_SPEED, [this, index] { + Activate(activated_result_, index, ActivateType::PREVIEW); return false; })); } else { - Activate(activated_result_, index, ResultView::ActivateType::DIRECT); + Activate(activated_result_, index, ActivateType::DIRECT); } } else { - Activate(activated_result_, index, ResultView::ActivateType::PREVIEW); + Activate(activated_result_, index, ActivateType::PREVIEW); } } } void ResultViewGrid::MouseDoubleClick(int x, int y, unsigned long button_flags, unsigned long key_flags) { - if (unity::Settings::Instance().double_click_activate == false) + if (default_click_activation() == ActivateType::DIRECT) return; unsigned num_results = GetNumResults(); @@ -845,7 +852,7 @@ focused_result_ = result; activated_result_ = result; - Activate(activated_result_, index, ResultView::ActivateType::DIRECT); + Activate(activated_result_, index, ActivateType::DIRECT); } } @@ -916,6 +923,15 @@ if (current_drag_result_.empty()) current_drag_result_.uri = current_drag_result_.uri.substr(current_drag_result_.uri.find(":") + 1); + if (boost::starts_with(current_drag_result_.uri, APPLICATION_URI_PREFIX)) + { + auto desktop_id = current_drag_result_.uri.substr(APPLICATION_URI_PREFIX.size()); + auto desktop_path = DesktopUtilities::GetDesktopPathById(desktop_id); + + if (!desktop_path.empty()) + current_drag_result_.uri = "file://" + desktop_path; + } + LOG_DEBUG (logger) << "Dnd begin at " << last_mouse_down_x_ << ", " << last_mouse_down_y_ << " - using; " << current_drag_result_.uri; diff -Nru unity-7.3.2+15.10.20150512/dash/ResultView.h unity-7.3.2+15.10.20150522/dash/ResultView.h --- unity-7.3.2+15.10.20150512/dash/ResultView.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/ResultView.h 2015-05-22 13:20:35.000000000 +0000 @@ -58,12 +58,11 @@ class ResultView : public nux::View, public debug::Introspectable { public: - typedef enum ActivateType_ + enum class ActivateType { DIRECT, - PREVIEW_LEFT_BUTTON, PREVIEW - } ActivateType; + }; NUX_DECLARE_OBJECT_TYPE(ResultView, nux::View); @@ -73,8 +72,9 @@ void SetModelRenderer(ResultRenderer* renderer); void SetResultsModel(Results::Ptr const& results); - unsigned int GetIndexForLocalResult(LocalResult const& local_result); + unsigned int GetIndexForLocalResult(LocalResult const&); LocalResult GetLocalResultForIndex(unsigned int); + ActivateType GetLocalResultActivateType(LocalResult const&) const; nux::Property expanded; nux::Property results_per_row; @@ -82,6 +82,7 @@ nux::Property desaturation_progress; nux::Property enable_texture_render; nux::Property scale; + nux::RWProperty default_click_activation; sigc::signal ResultActivated; @@ -130,6 +131,7 @@ void UpdateFontScale(double scale); Result cached_result_; + ActivateType default_click_activation_; connection::Manager result_connections_; }; diff -Nru unity-7.3.2+15.10.20150512/dash/ScopeBar.cpp unity-7.3.2+15.10.20150522/dash/ScopeBar.cpp --- unity-7.3.2+15.10.20150512/dash/ScopeBar.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/ScopeBar.cpp 2015-05-22 13:21:06.000000000 +0000 @@ -85,7 +85,7 @@ void ScopeBar::AddScope(Scope::Ptr const& scope) { - ScopeBarIcon* icon = new ScopeBarIcon(scope->id, scope->icon_hint); + ScopeBarIcon* icon = new ScopeBarIcon(scope->id, scope->icon_hint, scope->name); icon->SetVisible(scope->visible); icon->scale = scale(); diff -Nru unity-7.3.2+15.10.20150512/dash/ScopeBarIcon.cpp unity-7.3.2+15.10.20150522/dash/ScopeBarIcon.cpp --- unity-7.3.2+15.10.20150512/dash/ScopeBarIcon.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/ScopeBarIcon.cpp 2015-05-22 13:21:06.000000000 +0000 @@ -37,9 +37,10 @@ NUX_IMPLEMENT_OBJECT_TYPE(ScopeBarIcon); -ScopeBarIcon::ScopeBarIcon(std::string id_, std::string icon_hint) +ScopeBarIcon::ScopeBarIcon(std::string id_, std::string icon_hint, std::string name_) : IconTexture(icon_hint, TEXTURE_SIZE) , id(id_) + , name(name_) , active(false) , scale(DEFAULT_SCALE) , inactive_opacity_(0.4f) diff -Nru unity-7.3.2+15.10.20150512/dash/ScopeBarIcon.h unity-7.3.2+15.10.20150522/dash/ScopeBarIcon.h --- unity-7.3.2+15.10.20150512/dash/ScopeBarIcon.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/ScopeBarIcon.h 2015-05-22 13:21:06.000000000 +0000 @@ -37,9 +37,10 @@ { NUX_DECLARE_OBJECT_TYPE(ScopeBarIcon, IconTexture); public: - ScopeBarIcon(std::string id, std::string icon_hint); + ScopeBarIcon(std::string id, std::string icon_hint, std::string name); nux::Property id; + nux::Property name; nux::Property active; nux::Property scale; diff -Nru unity-7.3.2+15.10.20150512/dash/ScopeView.cpp unity-7.3.2+15.10.20150522/dash/ScopeView.cpp --- unity-7.3.2+15.10.20150512/dash/ScopeView.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/ScopeView.cpp 2015-05-22 13:21:00.000000000 +0000 @@ -481,47 +481,40 @@ /* Reset result count */ counts_[group] = 0; - ResultView* results_view = nullptr; + auto* results_view = new ResultViewGrid(NUX_TRACKER_LOCATION); + if (category.GetContentType() == "social" && category.renderer_name == "default") { - results_view = new ResultViewGrid(NUX_TRACKER_LOCATION); results_view->SetModelRenderer(new ResultRendererHorizontalTile(NUX_TRACKER_LOCATION)); - static_cast (results_view)->horizontal_spacing = CARD_VIEW_GAP_HORIZ.CP(scale()); - static_cast (results_view)->vertical_spacing = CARD_VIEW_GAP_VERT.CP(scale()); + results_view->horizontal_spacing = CARD_VIEW_GAP_HORIZ.CP(scale()); + results_view->vertical_spacing = CARD_VIEW_GAP_VERT.CP(scale()); } else { - results_view = new ResultViewGrid(NUX_TRACKER_LOCATION); results_view->SetModelRenderer(new ResultRendererTile(NUX_TRACKER_LOCATION)); } if (scope_) { - const std::string category_id = category.id(); - std::string unique_id = category.name() + scope_->name(); - results_view->unique_id = unique_id; + results_view->unique_id = name + scope_->name(); results_view->expanded = false; - results_view->ResultActivated.connect([this, unique_id, category_id] (LocalResult const& local_result, ResultView::ActivateType type, GVariant* data) + if (scope_->id() == "applications.scope" || + (scope_->id() == "home.scope" && category.id() == "applications.scope")) { - if (g_str_has_prefix(local_result.uri.c_str(), "x-unity-no-preview")) - type = ResultView::ActivateType::DIRECT; - - // Applications scope results should be activated on left-click (instead of preview). Note that app scope can still - // respond with preview for activation request (the case for uninstalled apps). - bool is_app_scope_result = (scope_->id() == "applications.scope" || (scope_->id() == "home.scope" && category_id == "applications.scope")); + results_view->default_click_activation = ResultView::ActivateType::DIRECT; + } - if (is_app_scope_result && type == ResultView::ActivateType::PREVIEW_LEFT_BUTTON) - type = ResultView::ActivateType::DIRECT; + results_view->ResultActivated.connect([this, results_view] (LocalResult const& local_result, ResultView::ActivateType type, GVariant* data) + { + result_activated.emit(type, local_result, data, results_view->unique_id()); - result_activated.emit(type, local_result, data, unique_id); switch (type) { case ResultView::ActivateType::DIRECT: { scope_->Activate(local_result, nullptr, cancellable_); } break; - case ResultView::ActivateType::PREVIEW_LEFT_BUTTON: case ResultView::ActivateType::PREVIEW: { scope_->Preview(local_result, nullptr, cancellable_); @@ -1007,6 +1000,11 @@ scroll_view_->ScrollToPosition(nux::Geometry(0, 0, 0, 0)); } +void ScopeView::PerformPageNavigation(ScrollDir dir) +{ + scroll_view_->page_direction.emit(dir); +} + void ScopeView::ActivateFirst() { if (!scope_) diff -Nru unity-7.3.2+15.10.20150512/dash/ScopeView.h unity-7.3.2+15.10.20150522/dash/ScopeView.h --- unity-7.3.2+15.10.20150512/dash/ScopeView.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/dash/ScopeView.h 2015-05-22 13:21:00.000000000 +0000 @@ -37,6 +37,7 @@ #include "ResultViewGrid.h" #include "unity-shared/NuxObjectPtrHash.h" #include "unity-shared/UBusWrapper.h" +#include "unity-shared/PlacesOverlayVScrollBar.h" namespace unity { @@ -62,6 +63,7 @@ int GetNumRows(); void AboutToShow(); void JumpToTop(); + void PerformPageNavigation(ScrollDir dir); virtual void ActivateFirst(); diff -Nru unity-7.3.2+15.10.20150512/debian/changelog unity-7.3.2+15.10.20150522/debian/changelog --- unity-7.3.2+15.10.20150512/debian/changelog 2015-05-25 17:33:40.000000000 +0000 +++ unity-7.3.2+15.10.20150522/debian/changelog 2015-05-25 17:33:41.000000000 +0000 @@ -1,3 +1,33 @@ +unity (7.3.2+15.10.20150522-0ubuntu1) wily; urgency=medium + + [ CI Train Bot ] + * New rebuild forced. + + [ Chris Townsend ] + * Add necessary signaling to set the BFB icon's tooltip and the Home + Scope's default search string to accurately reflect if searching + online is enabled or disabled in unity-system-settings. (LP: + #1202160, #1101662) + * Enable real page up/page down key navigation in the Dash. When using + these keys the view scrolls the length of the visible view. (LP: + #913612) + * If Spread/Expo is active, then terminate it when entering Launcher + keynav mode. (LP: #1447810) + * If dragging an application:// uri type from the Dash to the desktop, + change it to a file:// uri type so Nautilus can understand the type + a make a copy of it on the desktop. (LP: #1241972) + * Wait on Spread to be terminated before showing the Quicklist. (LP: + #1441626) + + [ Luke Yelavich ] + * Implement scope bar icon accessibility (LP: #1457073) + + [ Marco Trevisan (TreviƱo) ] + * ResultViewGrid: wait for double-click event only if the relative + result needs the Preview (LP: #1447372, #1291950) + + -- CI Train Bot Fri, 22 May 2015 13:21:14 +0000 + unity (7.3.2+15.10.20150512-0ubuntu1) wily; urgency=medium [ Chris Townsend ] diff -Nru unity-7.3.2+15.10.20150512/hud/HudButton.cpp unity-7.3.2+15.10.20150522/hud/HudButton.cpp --- unity-7.3.2+15.10.20150512/hud/HudButton.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/hud/HudButton.cpp 2015-05-22 13:20:35.000000000 +0000 @@ -20,11 +20,6 @@ */ #include "config.h" -#include -#include -#include -#include - #include #include #include diff -Nru unity-7.3.2+15.10.20150512/hud/HudController.h unity-7.3.2+15.10.20150522/hud/HudController.h --- unity-7.3.2+15.10.20150512/hud/HudController.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/hud/HudController.h 2015-05-22 13:20:35.000000000 +0000 @@ -22,7 +22,6 @@ #include #include -#include #include #include diff -Nru unity-7.3.2+15.10.20150512/launcher/BFBLauncherIcon.cpp unity-7.3.2+15.10.20150522/launcher/BFBLauncherIcon.cpp --- unity-7.3.2+15.10.20150512/launcher/BFBLauncherIcon.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/launcher/BFBLauncherIcon.cpp 2015-05-22 13:20:21.000000000 +0000 @@ -21,6 +21,7 @@ #include "config.h" #include #include "unity-shared/UBusMessages.h" +#include "unity-shared/UnitySettings.h" #include "BFBLauncherIcon.h" @@ -34,7 +35,6 @@ , reader_(dash::GSettingsScopesReader::GetDefault()) , launcher_hide_mode_(hide_mode) { - tooltip_text = _("Search your computer and online sources"); icon_name = PKGDATADIR"/launcher_bfb.png"; position = Position::BEGIN; SetQuirk(Quirk::VISIBLE, true); @@ -42,6 +42,10 @@ background_color_ = nux::color::White; + UpdateDefaultSearchText(); + + Settings::Instance().remote_content.changed.connect(sigc::hide(sigc::mem_fun(this, &BFBLauncherIcon::UpdateDefaultSearchText))); + mouse_enter.connect([this](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL); }); ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::bind(sigc::mem_fun(this, &BFBLauncherIcon::OnOverlayShown), true)); ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::bind(sigc::mem_fun(this, &BFBLauncherIcon::OnOverlayShown), false)); @@ -128,6 +132,20 @@ return result; } +void BFBLauncherIcon::UpdateDefaultSearchText() +{ + auto home_scope = reader_->GetScopeDataById("home.scope"); + + tooltip_text = ((Settings::Instance().remote_content) ? + _("Search your computer and online sources") : + _("Search your computer")); + + if (home_scope) + { + home_scope->search_hint = tooltip_text(); + } +} + std::string BFBLauncherIcon::GetName() const { return "BFBLauncherIcon"; diff -Nru unity-7.3.2+15.10.20150512/launcher/BFBLauncherIcon.h unity-7.3.2+15.10.20150522/launcher/BFBLauncherIcon.h --- unity-7.3.2+15.10.20150512/launcher/BFBLauncherIcon.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/launcher/BFBLauncherIcon.h 2015-05-22 13:20:21.000000000 +0000 @@ -52,6 +52,7 @@ private: void OnOverlayShown(GVariant *data, bool visible); void OnMenuitemActivated(DbusmenuMenuitem* item, int time, std::string const& scope_id); + void UpdateDefaultSearchText(); nux::Color background_color_; dash::GSettingsScopesReader::Ptr reader_; diff -Nru unity-7.3.2+15.10.20150512/launcher/DeviceNotificationDisplayImp.cpp unity-7.3.2+15.10.20150522/launcher/DeviceNotificationDisplayImp.cpp --- unity-7.3.2+15.10.20150512/launcher/DeviceNotificationDisplayImp.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/launcher/DeviceNotificationDisplayImp.cpp 2015-05-22 13:20:35.000000000 +0000 @@ -17,7 +17,6 @@ * Authored by: Andrea Azzarone */ -#include #include "config.h" #include #include diff -Nru unity-7.3.2+15.10.20150512/launcher/LauncherIcon.cpp unity-7.3.2+15.10.20150522/launcher/LauncherIcon.cpp --- unity-7.3.2+15.10.20150512/launcher/LauncherIcon.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/launcher/LauncherIcon.cpp 2015-05-22 13:20:27.000000000 +0000 @@ -577,10 +577,6 @@ } WindowManager& win_manager = WindowManager::Default(); - - if (win_manager.IsScaleActive()) - win_manager.TerminateScale(); - auto const& pos = GetTipPosition(monitor); /* If the expo plugin is active, we need to wait it to be terminated, before @@ -593,6 +589,15 @@ conn->disconnect(); }); } + else if (win_manager.IsScaleActive()) + { + auto conn = std::make_shared(); + *conn = win_manager.terminate_spread.connect([this, conn, pos, restore_input_focus] { + QuicklistManager::Default()->ShowQuicklist(_quicklist, pos.x, pos.y, restore_input_focus); + conn->disconnect(); + }); + win_manager.TerminateScale(); + } else { QuicklistManager::Default()->ShowQuicklist(_quicklist, pos.x, pos.y, restore_input_focus); diff -Nru unity-7.3.2+15.10.20150512/plugins/unityshell/src/unitya11y.cpp unity-7.3.2+15.10.20150522/plugins/unityshell/src/unitya11y.cpp --- unity-7.3.2+15.10.20150512/plugins/unityshell/src/unitya11y.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unitya11y.cpp 2015-05-22 13:21:06.000000000 +0000 @@ -48,6 +48,7 @@ #include "unity-launcher-icon-accessible.h" #include "unity-panel-view-accessible.h" #include "unity-dash-view-accessible.h" +#include "unity-scope-bar-icon-accessible.h" #include "unity-search-bar-accessible.h" #include "unity-sctext-accessible.h" #include "unity-rvgrid-accessible.h" @@ -171,6 +172,9 @@ if (object->Type().IsDerivedFromType(DashView::StaticObjectType)) return unity_dash_view_accessible_new(object); + if (object->Type().IsDerivedFromType(ScopeBarIcon::StaticObjectType)) + return unity_scope_bar_icon_accessible_new(object); + if (object->Type().IsDerivedFromType(PlacesGroup::StaticObjectType)) return unity_places_group_accessible_new(object); diff -Nru unity-7.3.2+15.10.20150512/plugins/unityshell/src/unity-scope-bar-icon-accessible.cpp unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-scope-bar-icon-accessible.cpp --- unity-7.3.2+15.10.20150512/plugins/unityshell/src/unity-scope-bar-icon-accessible.cpp 1970-01-01 00:00:00.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-scope-bar-icon-accessible.cpp 2015-05-22 13:21:06.000000000 +0000 @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2011 Canonical Ltd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authored by: Luke Yelavich + */ + +/** + * SECTION:unity-scope_bar_icon-accessible + * @Title: UnityScopeBarIconAccessible + * @short_description: Implementation of the ATK interfaces for #ScopeBarIcon + * @see_also: ScopeBarIcon + * + * #UnityScopeBarIconAccessible implements the required ATK interfaces for + * #ScopeBarIcon, mainly exposing the text as his name, as this + * #object is mainly used as a label + * + */ + +#include + +#include "unity-scope-bar-icon-accessible.h" + +#include "unitya11y.h" +#include "ScopeBarIcon.h" + +using namespace unity::dash; + +/* GObject */ +static void unity_scope_bar_icon_accessible_class_init(UnityScopeBarIconAccessibleClass* klass); +static void unity_scope_bar_icon_accessible_init(UnityScopeBarIconAccessible* self); +static void unity_scope_bar_icon_accessible_dispose(GObject* object); + +/* AtkObject.h */ +static void unity_scope_bar_icon_accessible_initialize(AtkObject* accessible, + gpointer data); +static const gchar* unity_scope_bar_icon_accessible_get_name(AtkObject* obj); +static void on_focus_changed_cb(nux::Area* area, + bool has_focus, + nux::KeyNavDirection direction, + AtkObject* accessible); +static void on_active_changed_cb(bool is_active, + AtkObject* accessible); + +G_DEFINE_TYPE(UnityScopeBarIconAccessible, unity_scope_bar_icon_accessible, NUX_TYPE_VIEW_ACCESSIBLE); + +#define UNITY_SCOPE_BAR_ICON_ACCESSIBLE_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_SCOPE_BAR_ICON_ACCESSIBLE, \ + UnityScopeBarIconAccessiblePrivate)) + +struct _UnityScopeBarIconAccessiblePrivate +{ + gchar* name; +}; + +static void +unity_scope_bar_icon_accessible_class_init(UnityScopeBarIconAccessibleClass* klass) +{ + AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass); + GObjectClass* gobject_class = G_OBJECT_CLASS(klass); + + gobject_class->dispose = unity_scope_bar_icon_accessible_dispose; + + /* AtkObject */ + atk_class->get_name = unity_scope_bar_icon_accessible_get_name; + atk_class->initialize = unity_scope_bar_icon_accessible_initialize; + + g_type_class_add_private(gobject_class, sizeof(UnityScopeBarIconAccessiblePrivate)); +} + +static void +unity_scope_bar_icon_accessible_init(UnityScopeBarIconAccessible* self) +{ + UnityScopeBarIconAccessiblePrivate* priv = + UNITY_SCOPE_BAR_ICON_ACCESSIBLE_GET_PRIVATE(self); + + self->priv = priv; + self->priv->name = NULL; +} + +static void +unity_scope_bar_icon_accessible_dispose(GObject* object) +{ + UnityScopeBarIconAccessible* self = UNITY_SCOPE_BAR_ICON_ACCESSIBLE(object); + + if (self->priv->name != NULL) + { + g_free(self->priv->name); + self->priv->name = NULL; + } + + G_OBJECT_CLASS(unity_scope_bar_icon_accessible_parent_class)->dispose(object); +} + +AtkObject* +unity_scope_bar_icon_accessible_new(nux::Object* object) +{ + AtkObject* accessible = NULL; + + g_return_val_if_fail(dynamic_cast(object), NULL); + + accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_SCOPE_BAR_ICON_ACCESSIBLE, NULL)); + + atk_object_initialize(accessible, object); + + return accessible; +} + +/* AtkObject.h */ +static void +unity_scope_bar_icon_accessible_initialize(AtkObject* accessible, + gpointer data) +{ + nux::Object* nux_object = NULL; + ScopeBarIcon* icon = NULL; + + ATK_OBJECT_CLASS(unity_scope_bar_icon_accessible_parent_class)->initialize(accessible, data); + + nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible)); + icon = dynamic_cast(nux_object); + + if (icon == NULL) + return; + + icon->key_nav_focus_change.connect(sigc::bind(sigc::ptr_fun(on_focus_changed_cb), accessible)); + + icon->active.changed.connect(sigc::bind(sigc::ptr_fun(on_active_changed_cb), accessible)); + + atk_object_set_role(accessible, ATK_ROLE_PUSH_BUTTON); +} + +static const gchar* +unity_scope_bar_icon_accessible_get_name(AtkObject* obj) +{ + g_return_val_if_fail(UNITY_IS_SCOPE_BAR_ICON_ACCESSIBLE(obj), NULL); + UnityScopeBarIconAccessible* self = UNITY_SCOPE_BAR_ICON_ACCESSIBLE(obj); + + if (self->priv->name) + { + g_free(self->priv->name); + self->priv->name = NULL; + } + + self->priv->name = g_strdup(ATK_OBJECT_CLASS(unity_scope_bar_icon_accessible_parent_class)->get_name(obj)); + if (self->priv->name == NULL) + { + ScopeBarIcon* icon = NULL; + + icon = dynamic_cast(nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj))); + if (icon != NULL) + { + if (icon->active()) + self->priv->name = g_strdup_printf(_("%s: selected"), icon->name().c_str()); + else + self->priv->name = g_strdup(icon->name().c_str()); + } + } + + return self->priv->name; +} + +static void +on_focus_changed_cb(nux::Area* area, + bool has_focus, + nux::KeyNavDirection direction, + AtkObject* accessible) +{ + g_return_if_fail(UNITY_IS_SCOPE_BAR_ICON_ACCESSIBLE(accessible)); + + g_signal_emit_by_name(accessible, "focus-event", has_focus); +} + +static void +on_active_changed_cb(bool is_active, + AtkObject* accessible) +{ + g_return_if_fail(UNITY_IS_SCOPE_BAR_ICON_ACCESSIBLE(accessible)); + + g_object_notify(G_OBJECT(accessible), "accessible-name"); +} diff -Nru unity-7.3.2+15.10.20150512/plugins/unityshell/src/unity-scope-bar-icon-accessible.h unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-scope-bar-icon-accessible.h --- unity-7.3.2+15.10.20150512/plugins/unityshell/src/unity-scope-bar-icon-accessible.h 1970-01-01 00:00:00.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unity-scope-bar-icon-accessible.h 2015-05-22 13:21:06.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2015 Canonical Ltd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authored by: Luke Yelavich + */ + +#ifndef UNITY_SCOPE_BAR_ICON_ACCESSIBLE_H +#define UNITY_SCOPE_BAR_ICON_ACCESSIBLE_H + +#include + +#include "nux-view-accessible.h" + +G_BEGIN_DECLS + +#define UNITY_TYPE_SCOPE_BAR_ICON_ACCESSIBLE (unity_scope_bar_icon_accessible_get_type ()) +#define UNITY_SCOPE_BAR_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_SCOPE_BAR_ICON_ACCESSIBLE, UnityScopeBarIconAccessible)) +#define UNITY_SCOPE_BAR_ICON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_SCOPE_BAR_ICON_ACCESSIBLE, UnityScopeBarIconAccessibleClass)) +#define UNITY_IS_SCOPE_BAR_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_SCOPE_BAR_ICON_ACCESSIBLE)) +#define UNITY_IS_SCOPE_BAR_ICON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_SCOPE_BAR_ICON_ACCESSIBLE)) +#define UNITY_SCOPE_BAR_ICON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_SCOPE_BAR_ICON_ACCESSIBLE, UnityScopeBarIconAccessibleClass)) + +typedef struct _UnityScopeBarIconAccessible UnityScopeBarIconAccessible; +typedef struct _UnityScopeBarIconAccessibleClass UnityScopeBarIconAccessibleClass; +typedef struct _UnityScopeBarIconAccessiblePrivate UnityScopeBarIconAccessiblePrivate; + +struct _UnityScopeBarIconAccessible +{ + NuxViewAccessible parent; + + /*< private >*/ + UnityScopeBarIconAccessiblePrivate* priv; +}; + +struct _UnityScopeBarIconAccessibleClass +{ + NuxViewAccessibleClass parent_class; +}; + +GType unity_scope_bar_icon_accessible_get_type(void); +AtkObject* unity_scope_bar_icon_accessible_new(nux::Object* object); + +G_END_DECLS + +#endif /* __UNITY_SCOPE_BAR_ICON_ACCESSIBLE_H__ */ diff -Nru unity-7.3.2+15.10.20150512/plugins/unityshell/src/unityshell.cpp unity-7.3.2+15.10.20150522/plugins/unityshell/src/unityshell.cpp --- unity-7.3.2+15.10.20150512/plugins/unityshell/src/unityshell.cpp 2015-05-12 13:10:06.000000000 +0000 +++ unity-7.3.2+15.10.20150522/plugins/unityshell/src/unityshell.cpp 2015-05-22 13:20:42.000000000 +0000 @@ -1779,9 +1779,9 @@ dash_controller_->HideDash(); hud_controller_->HideHud(); } + _key_nav_mode_requested = false; launcher_controller_->KeyNavGrab(); } - _key_nav_mode_requested = false; break; case MotionNotify: if (wm.IsScaleActive()) @@ -2264,6 +2264,11 @@ CompAction::State state, CompOption::Vector& options) { + if (WM.IsScaleActive()) + WM.TerminateScale(); + else if (WM.IsExpoActive()) + WM.TerminateExpo(); + _key_nav_mode_requested = true; return true; } diff -Nru unity-7.3.2+15.10.20150512/po/POTFILES.in unity-7.3.2+15.10.20150522/po/POTFILES.in --- unity-7.3.2+15.10.20150512/po/POTFILES.in 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/po/POTFILES.in 2015-05-22 13:21:06.000000000 +0000 @@ -33,6 +33,7 @@ plugins/unityshell/src/unity-launcher-accessible.cpp plugins/unityshell/src/unity-launcher-icon-accessible.cpp plugins/unityshell/src/unity-quicklist-menu-accessible.cpp +plugins/unityshell/src/unity-scope-bar-icon-accessible.cpp plugins/unityshell/src/unity-search-bar-accessible.cpp plugins/unityshell/src/unity-switcher-accessible.cpp plugins/unityshell/src/unityshell.cpp diff -Nru unity-7.3.2+15.10.20150512/unity-shared/BGHash.cpp unity-7.3.2+15.10.20150522/unity-shared/BGHash.cpp --- unity-7.3.2+15.10.20150512/unity-shared/BGHash.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/BGHash.cpp 2015-05-22 13:20:35.000000000 +0000 @@ -116,8 +116,11 @@ .SetDuration(skip_animation ? 0 : TRANSITION_DURATION) .Start(); - // This will make sure that the animation starts even if the screen is idle. - nux::GetWindowThread()->RequestRedraw(); + if (nux::WindowThread* wt = nux::GetWindowThread()) + { + // This will make sure that the animation starts even if the screen is idle. + wt->RequestRedraw(); + } } void BGHash::OnTransitionUpdated(nux::Color const& new_color) diff -Nru unity-7.3.2+15.10.20150512/unity-shared/OverlayScrollView.cpp unity-7.3.2+15.10.20150522/unity-shared/OverlayScrollView.cpp --- unity-7.3.2+15.10.20150512/unity-shared/OverlayScrollView.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/OverlayScrollView.cpp 2015-05-22 13:21:00.000000000 +0000 @@ -50,7 +50,11 @@ scale.changed.connect([this] (double scale) { m_MouseWheelScrollSize = MOUSE_WHEEL_SCROLL_SIZE.CP(scale); }); + + page_direction.connect([scrollbar] (ScrollDir dir) { + scrollbar->PerformPageNavigation(dir); + }); } } // dash namespace -} // unity namespace \ No newline at end of file +} // unity namespace diff -Nru unity-7.3.2+15.10.20150512/unity-shared/OverlayScrollView.h unity-7.3.2+15.10.20150522/unity-shared/OverlayScrollView.h --- unity-7.3.2+15.10.20150512/unity-shared/OverlayScrollView.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/OverlayScrollView.h 2015-05-22 13:21:00.000000000 +0000 @@ -21,6 +21,7 @@ #define _UNITY_SCROLL_VIEW_H_ #include +#include "PlacesOverlayVScrollBar.h" namespace unity { @@ -33,6 +34,7 @@ ScrollView(NUX_FILE_LINE_PROTO); nux::RWProperty scale; + sigc::signal page_direction; using nux::ScrollView::SetVScrollBar; }; diff -Nru unity-7.3.2+15.10.20150512/unity-shared/PlacesOverlayVScrollBar.cpp unity-7.3.2+15.10.20150522/unity-shared/PlacesOverlayVScrollBar.cpp --- unity-7.3.2+15.10.20150512/unity-shared/PlacesOverlayVScrollBar.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/PlacesOverlayVScrollBar.cpp 2015-05-22 13:21:00.000000000 +0000 @@ -121,6 +121,11 @@ animation_.SetFinishValue(stop); } +void PlacesOverlayVScrollBar::PerformPageNavigation(ScrollDir dir) +{ + StartScrollAnimation(dir, _slider->GetBaseHeight()); +} + void PlacesOverlayVScrollBar::StartScrollAnimation(ScrollDir dir, int stop) { if (animation_.CurrentState() == nux::animation::Animation::State::Stopped) diff -Nru unity-7.3.2+15.10.20150512/unity-shared/PlacesOverlayVScrollBar.h unity-7.3.2+15.10.20150522/unity-shared/PlacesOverlayVScrollBar.h --- unity-7.3.2+15.10.20150512/unity-shared/PlacesOverlayVScrollBar.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/PlacesOverlayVScrollBar.h 2015-05-22 13:21:00.000000000 +0000 @@ -34,22 +34,24 @@ namespace dash { +enum class ScrollDir : unsigned int +{ + UP, + DOWN, +}; + class PlacesOverlayVScrollBar: public PlacesVScrollBar { public: PlacesOverlayVScrollBar(NUX_FILE_LINE_PROTO); virtual ~PlacesOverlayVScrollBar() {} + void PerformPageNavigation(ScrollDir dir); + protected: void Draw(nux::GraphicsEngine& graphics_engine, bool force_draw); private: - enum class ScrollDir : unsigned int - { - UP, - DOWN, - }; - void OnTrackGeometryChanged(nux::Area* area, nux::Geometry& geo); void OnVisibilityChanged(nux::Area* area, bool visible); void OnSensitivityChanged(nux::Area* area, bool sensitive); diff -Nru unity-7.3.2+15.10.20150512/unity-shared/SearchBar.cpp unity-7.3.2+15.10.20150522/unity-shared/SearchBar.cpp --- unity-7.3.2+15.10.20150512/unity-shared/SearchBar.cpp 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/SearchBar.cpp 2015-05-22 13:20:35.000000000 +0000 @@ -141,6 +141,9 @@ : View(NUX_FILE_LINE_PARAM) , showing_filters(false) , can_refine_search(false) + , im_active([this] { return pango_entry_->im_active(); }) + , im_preedit([this] { return pango_entry_->im_preedit(); }) + , in_live_search([this] { return live_search_timeout_ && live_search_timeout_->IsRunning(); }) , live_search_wait(DEFAULT_LIVE_SEARCH_TIMEOUT) , scale(DEFAULT_SCALE) , show_filter_hint_(show_filter_hint) @@ -179,11 +182,11 @@ pango_entry_->mouse_down.connect(sigc::mem_fun(this, &SearchBar::OnMouseButtonDown)); pango_entry_->end_key_focus.connect(sigc::mem_fun(this, &SearchBar::OnEndKeyFocus)); pango_entry_->key_up.connect([this] (unsigned int, unsigned long, unsigned long) { - if (get_im_preedit()) - { - hint_->SetVisible(false); - hint_->QueueDraw(); - } + if (im_preedit()) + { + hint_->SetVisible(false); + hint_->QueueDraw(); + } }); layered_layout_ = new nux::LayeredLayout(); @@ -263,10 +266,8 @@ OnFontChanged(); search_hint.changed.connect([this](std::string const& s) { OnSearchHintChanged(); }); - search_string.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_search_string)); + search_string.SetGetterFunction([this] { return pango_entry_->GetText(); }); search_string.SetSetterFunction(sigc::mem_fun(this, &SearchBar::set_search_string)); - im_active.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_active)); - im_preedit.SetGetterFunction(sigc::mem_fun(this, &SearchBar::get_im_preedit)); showing_filters.changed.connect(sigc::mem_fun(this, &SearchBar::OnShowingFiltersChanged)); scale.changed.connect(sigc::mem_fun(this, &SearchBar::UpdateScale)); Settings::Instance().font_scaling.changed.connect(sigc::hide(sigc::mem_fun(this, &SearchBar::UpdateSearchBarSize))); @@ -633,11 +634,6 @@ return expander_view_; } -std::string SearchBar::get_search_string() const -{ - return pango_entry_->GetText(); -} - bool SearchBar::set_search_string(std::string const& string) { pango_entry_->SetText(string.c_str()); @@ -649,16 +645,6 @@ return true; } -bool SearchBar::get_im_active() const -{ - return pango_entry_->im_active(); -} - -bool SearchBar::get_im_preedit() const -{ - return pango_entry_->im_preedit(); -} - // // Highlight // diff -Nru unity-7.3.2+15.10.20150512/unity-shared/SearchBar.h unity-7.3.2+15.10.20150522/unity-shared/SearchBar.h --- unity-7.3.2+15.10.20150512/unity-shared/SearchBar.h 2015-05-12 13:08:43.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/SearchBar.h 2015-05-22 13:20:35.000000000 +0000 @@ -63,6 +63,7 @@ nux::Property can_refine_search; nux::ROProperty im_active; nux::ROProperty im_preedit; + nux::ROProperty in_live_search; nux::Property live_search_wait; nux::Property scale; @@ -88,10 +89,7 @@ bool OnLiveSearchTimeout(); bool OnSpinnerStartCb(); - std::string get_search_string() const; bool set_search_string(std::string const& string); - bool get_im_active() const; - bool get_im_preedit() const; bool show_filter_hint_; std::string GetName() const; diff -Nru unity-7.3.2+15.10.20150512/unity-shared/UnitySettings.cpp unity-7.3.2+15.10.20150522/unity-shared/UnitySettings.cpp --- unity-7.3.2+15.10.20150512/unity-shared/UnitySettings.cpp 2015-05-12 13:09:56.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/UnitySettings.cpp 2015-05-22 13:20:21.000000000 +0000 @@ -59,6 +59,9 @@ const std::string GNOME_SCALE_FACTOR = "scaling-factor"; const std::string GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor"; +const std::string REMOTE_CONTENT_SETTINGS = "com.canonical.Unity.Lenses"; +const std::string REMOTE_CONTENT_KEY = "remote-content-search"; + const int DEFAULT_LAUNCHER_WIDTH = 64; const int MINIMUM_DESKTOP_HEIGHT = 800; const int GNOME_SETTINGS_CHANGED_WAIT_SECONDS = 1; @@ -78,16 +81,19 @@ , ui_settings_(g_settings_new(UI_SETTINGS.c_str())) , ubuntu_ui_settings_(g_settings_new(UBUNTU_UI_SETTINGS.c_str())) , gnome_ui_settings_(g_settings_new(GNOME_UI_SETTINGS.c_str())) + , remote_content_settings_(g_settings_new(REMOTE_CONTENT_SETTINGS.c_str())) , launcher_widths_(monitors::MAX, DEFAULT_LAUNCHER_WIDTH) , cached_form_factor_(FormFactor::DESKTOP) , cursor_scale_(1.0) , cached_double_click_activate_(true) , changing_gnome_settings_(false) , lowGfx_(false) + , remote_content_enabled_(true) { parent_->form_factor.SetGetterFunction(sigc::mem_fun(this, &Impl::GetFormFactor)); parent_->form_factor.SetSetterFunction(sigc::mem_fun(this, &Impl::SetFormFactor)); parent_->double_click_activate.SetGetterFunction(sigc::mem_fun(this, &Impl::GetDoubleClickActivate)); + parent_->remote_content.SetGetterFunction(sigc::mem_fun(this, &Impl::GetRemoteContentEnabled)); for (unsigned i = 0; i < monitors::MAX; ++i) em_converters_.emplace_back(std::make_shared()); @@ -140,6 +146,10 @@ UpdateLimSetting(); }); + signals_.Add(remote_content_settings_, "changed::" + REMOTE_CONTENT_KEY, [this] (GSettings*, const gchar* t) { + UpdateRemoteContentSearch(); + }); + UScreen::GetDefault()->changed.connect(sigc::hide(sigc::hide(sigc::mem_fun(this, &Impl::UpdateDPI)))); // The order is important here, DPI is the last thing to be updated @@ -151,6 +161,7 @@ CacheFormFactor(); CacheDoubleClickActivate(); + UpdateRemoteContentSearch(); } void CacheFormFactor() @@ -316,12 +327,30 @@ }, glib::Source::Priority::LOW)); } + void UpdateRemoteContentSearch() + { + glib::String remote_content(g_settings_get_string(remote_content_settings_, REMOTE_CONTENT_KEY.c_str())); + bool remote_content_enabled = ((remote_content.Str() == "all") ? true : false); + + if (remote_content_enabled != remote_content_enabled_) + { + remote_content_enabled_ = remote_content_enabled; + parent_->remote_content.changed.emit(remote_content_enabled_); + } + } + + bool GetRemoteContentEnabled() const + { + return remote_content_enabled_; + } + Settings* parent_; glib::Object usettings_; glib::Object lim_settings_; glib::Object ui_settings_; glib::Object ubuntu_ui_settings_; glib::Object gnome_ui_settings_; + glib::Object remote_content_settings_; glib::Source::UniquePtr changing_gnome_settings_timeout_; glib::SignalManager signals_; std::vector em_converters_; @@ -331,6 +360,7 @@ bool cached_double_click_activate_; bool changing_gnome_settings_; bool lowGfx_; + bool remote_content_enabled_; }; // diff -Nru unity-7.3.2+15.10.20150512/unity-shared/UnitySettings.h unity-7.3.2+15.10.20150522/unity-shared/UnitySettings.h --- unity-7.3.2+15.10.20150512/unity-shared/UnitySettings.h 2015-05-12 13:09:56.000000000 +0000 +++ unity-7.3.2+15.10.20150522/unity-shared/UnitySettings.h 2015-05-22 13:20:21.000000000 +0000 @@ -56,6 +56,7 @@ nux::Property lim_double_click_wait; nux::Property lim_unfocused_popup; nux::Property font_scaling; + nux::ROProperty remote_content; sigc::signal dpi_changed; sigc::signal low_gfx_changed;