Merge lp:~3v1n0/unity/lim-visibility-fixes into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Stephen M. Webb
Approved revision: no longer in the source branch.
Merged at revision: 3907
Proposed branch: lp:~3v1n0/unity/lim-visibility-fixes
Merge into: lp:unity
Diff against target: 845 lines (+217/-96)
17 files modified
UnityCore/AppmenuIndicator.cpp (+24/-0)
UnityCore/AppmenuIndicator.h (+8/-0)
com.canonical.Unity.gschema.xml (+8/-0)
decorations/DecoratedWindow.cpp (+24/-14)
decorations/DecorationsForceQuitDialog.cpp (+24/-18)
decorations/DecorationsManager.cpp (+10/-3)
decorations/DecorationsSlidingLayout.cpp (+14/-8)
decorations/DecorationsSlidingLayout.h (+2/-0)
panel/PanelMenuView.cpp (+63/-32)
panel/PanelMenuView.h (+4/-1)
plugins/unityshell/src/unityshell.cpp (+1/-1)
unity-shared/DecorationStyle.cpp (+0/-1)
unity-shared/DecorationStyle.h (+0/-1)
unity-shared/MenuManager.cpp (+27/-4)
unity-shared/MenuManager.h (+5/-1)
unity-shared/UScreen.cpp (+3/-6)
unity-shared/UnitySettings.cpp (+0/-6)
To merge this branch: bzr merge lp:~3v1n0/unity/lim-visibility-fixes
Reviewer Review Type Date Requested Status
Christopher Townsend Approve
PS Jenkins bot (community) continuous-integration Approve
Stephen M. Webb (community) Approve
Review via email: mp+245189@code.launchpad.net

Commit message

MenuManager: make sure menus are always shown when mouse is over them or when the always-show-menus option is on

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
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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: Needs Fixing (continuous-integration)
Revision history for this message
Stephen M. Webb (bregma) wrote :

Builds OK (thanks for nothing, Jenkins).

Will do more rigourous testing from the landing silo.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

Ok

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

lol, I meant to approve the SRU branch. My Firefox tabs got me confused:)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'UnityCore/AppmenuIndicator.cpp'
--- UnityCore/AppmenuIndicator.cpp 2012-12-04 00:33:18 +0000
+++ UnityCore/AppmenuIndicator.cpp 2015-01-15 14:44:53 +0000
@@ -17,6 +17,7 @@
17 * Authored by: Marco Trevisan (Treviño) <3v1n0@ubuntu.com>17 * Authored by: Marco Trevisan (Treviño) <3v1n0@ubuntu.com>
18 */18 */
1919
20#include "GLibSource.h"
20#include "AppmenuIndicator.h"21#include "AppmenuIndicator.h"
2122
22namespace unity23namespace unity
@@ -24,8 +25,31 @@
24namespace indicator25namespace indicator
25{26{
2627
28struct AppmenuIndicator::Impl
29{
30 Impl(AppmenuIndicator* parent)
31 {
32 // When the active window has changed we might need to emit an updated signal
33 parent->active_window.changed.connect([this, parent] (unsigned long) {
34 update_wait_.reset(new glib::Timeout(250, [parent] {
35 parent->updated.emit();
36 return false;
37 }));
38 });
39
40 parent->updated.connect([this] { update_wait_.reset(); });
41 }
42
43 glib::Source::UniquePtr update_wait_;
44};
45
27AppmenuIndicator::AppmenuIndicator(std::string const& name)46AppmenuIndicator::AppmenuIndicator(std::string const& name)
28 : Indicator(name)47 : Indicator(name)
48 , active_window(0)
49 , impl_(new AppmenuIndicator::Impl(this))
50{}
51
52AppmenuIndicator::~AppmenuIndicator()
29{}53{}
3054
31void AppmenuIndicator::ShowAppmenu(unsigned int xid, int x, int y) const55void AppmenuIndicator::ShowAppmenu(unsigned int xid, int x, int y) const
3256
=== modified file 'UnityCore/AppmenuIndicator.h'
--- UnityCore/AppmenuIndicator.h 2014-02-12 00:51:09 +0000
+++ UnityCore/AppmenuIndicator.h 2015-01-15 14:44:53 +0000
@@ -20,6 +20,7 @@
20#ifndef UNITY_APPMENU_INDICATOR_H20#ifndef UNITY_APPMENU_INDICATOR_H
21#define UNITY_APPMENU_INDICATOR_H21#define UNITY_APPMENU_INDICATOR_H
2222
23#include <NuxCore/Property.h>
23#include "Indicator.h"24#include "Indicator.h"
2425
25namespace unity26namespace unity
@@ -33,12 +34,19 @@
33 typedef std::shared_ptr<AppmenuIndicator> Ptr;34 typedef std::shared_ptr<AppmenuIndicator> Ptr;
3435
35 AppmenuIndicator(std::string const& name);36 AppmenuIndicator(std::string const& name);
37 ~AppmenuIndicator();
38
39 nux::Property<unsigned> active_window;
3640
37 virtual bool IsAppmenu() const { return true; }41 virtual bool IsAppmenu() const { return true; }
3842
39 void ShowAppmenu(unsigned xid, int x, int y) const;43 void ShowAppmenu(unsigned xid, int x, int y) const;
4044
41 sigc::signal<void, unsigned, int, int> on_show_appmenu;45 sigc::signal<void, unsigned, int, int> on_show_appmenu;
46
47private:
48 struct Impl;
49 std::unique_ptr<Impl> impl_;
42};50};
4351
44}52}
4553
=== modified file 'com.canonical.Unity.gschema.xml'
--- com.canonical.Unity.gschema.xml 2014-09-10 12:48:03 +0000
+++ com.canonical.Unity.gschema.xml 2015-01-15 14:44:53 +0000
@@ -53,6 +53,14 @@
53 on the window decoration, otherwise they will be always shown on the53 on the window decoration, otherwise they will be always shown on the
54 unity top panel</description>54 unity top panel</description>
55 </key>55 </key>
56 <key type="b" name="always-show-menus">
57 <default>false</default>
58 <summary>Toggle the menu visibility based on mouse hovering.</summary>
59 <description>When this is enabled, the application menus will be always
60 shown (on the window decoration or in the unity panel, depending whether
61 integrated menus are enabled), otherwise they will be shown only when
62 the mouse cursor is over the relative mouse area.</description>
63 </key>
56 </schema>64 </schema>
57 <schema path="/com/canonical/unity/interface/" id="com.canonical.Unity.Interface" gettext-domain="unity">65 <schema path="/com/canonical/unity/interface/" id="com.canonical.Unity.Interface" gettext-domain="unity">
58 <key type="d" name="text-scale-factor">66 <key type="d" name="text-scale-factor">
5967
=== modified file 'decorations/DecoratedWindow.cpp'
--- decorations/DecoratedWindow.cpp 2014-11-28 12:55:13 +0000
+++ decorations/DecoratedWindow.cpp 2015-01-15 14:44:53 +0000
@@ -708,16 +708,14 @@
708 auto const& sliding_layout = sliding_layout_.lock();708 auto const& sliding_layout = sliding_layout_.lock();
709 sliding_layout->SetInputItem(nullptr);709 sliding_layout->SetInputItem(nullptr);
710 sliding_layout->mouse_owner = false;710 sliding_layout->mouse_owner = false;
711 sliding_layout->override_main_item = false;
712 grab_mouse_changed_->disconnect();
711713
712 if (!menu_manager->HasAppMenu() || !Style::Get()->integrated_menus())714 if (!menu_manager->HasAppMenu() || !menu_manager->integrated_menus())
713 return;715 return;
714716
715 auto visibility_cb = sigc::hide(sigc::mem_fun(this, &Impl::UpdateAppMenuVisibility));
716 auto menus = std::make_shared<MenuLayout>(menu_manager, win_);717 auto menus = std::make_shared<MenuLayout>(menu_manager, win_);
717 menus->Setup();718 menus->Setup();
718 menus->active.changed.connect(visibility_cb);
719 menus->show_now.changed.connect(visibility_cb);
720 menus->mouse_owner.changed.connect(visibility_cb);
721 menus_ = menus;719 menus_ = menus;
722720
723 auto const& grab_edge = grab_edge_.lock();721 auto const& grab_edge = grab_edge_.lock();
@@ -725,15 +723,27 @@
725 sliding_layout->fadein = menu_manager->fadein();723 sliding_layout->fadein = menu_manager->fadein();
726 sliding_layout->fadeout = menu_manager->fadeout();724 sliding_layout->fadeout = menu_manager->fadeout();
727725
728 if (grab_edge->mouse_owner() || grab_edge->Geometry().contains(CompPoint(pointerX, pointerY)))726 if (menu_manager->always_show_menus())
729 sliding_layout->mouse_owner = true;727 {
730728 sliding_layout->override_main_item = true;
731 grab_mouse_changed_ = grab_edge->mouse_owner.changed.connect([this] (bool owner) {729 }
732 sliding_layout_->mouse_owner = owner;730 else
733 });731 {
734732 auto visibility_cb = sigc::hide(sigc::mem_fun(this, &Impl::UpdateAppMenuVisibility));
735 if (sliding_layout->mouse_owner())733 menus->active.changed.connect(visibility_cb);
736 input_mixer_->ForceMouseOwnerCheck();734 menus->show_now.changed.connect(visibility_cb);
735 menus->mouse_owner.changed.connect(visibility_cb);
736
737 if (grab_edge->mouse_owner() || grab_edge->Geometry().contains(CompPoint(pointerX, pointerY)))
738 sliding_layout->mouse_owner = true;
739
740 grab_mouse_changed_ = grab_edge->mouse_owner.changed.connect([this] (bool owner) {
741 sliding_layout_->mouse_owner = owner || menus_->show_now();
742 });
743
744 if (sliding_layout->mouse_owner())
745 input_mixer_->ForceMouseOwnerCheck();
746 }
737747
738 SyncMenusGeometries();748 SyncMenusGeometries();
739}749}
740750
=== modified file 'decorations/DecorationsForceQuitDialog.cpp'
--- decorations/DecorationsForceQuitDialog.cpp 2015-01-12 18:30:09 +0000
+++ decorations/DecorationsForceQuitDialog.cpp 2015-01-15 14:44:53 +0000
@@ -97,6 +97,20 @@
97static void close_button_init(CloseButton*);97static void close_button_init(CloseButton*);
98static void close_button_class_init(CloseButtonClass*);98static void close_button_class_init(CloseButtonClass*);
9999
100bool gdk_error_trap_pop_with_output(std::string const& prefix)
101{
102 if (int error_code = gdk_error_trap_pop())
103 {
104 gchar tmp[1024];
105 XGetErrorText(gdk_x11_get_default_xdisplay(), error_code, tmp, sizeof(tmp) - 1);
106 tmp[sizeof(tmp) - 1] = '\0';
107 LOG_ERROR(logger) << (prefix.empty() ? "X error: " : prefix+": ") << tmp;
108 return true;
109 }
110
111 return false;
112}
113
100// Window implementation114// Window implementation
101GtkWidget* sheet_style_window_new(ForceQuitDialog* main_dialog, Window parent_xid)115GtkWidget* sheet_style_window_new(ForceQuitDialog* main_dialog, Window parent_xid)
102{116{
@@ -112,15 +126,20 @@
112 gtk_window_set_deletable(self, FALSE);126 gtk_window_set_deletable(self, FALSE);
113 gtk_window_set_title(self, "Force Quit Dialog");127 gtk_window_set_title(self, "Force Quit Dialog");
114128
129 gdk_error_trap_push();
115 XClassHint parent_class = {nullptr, nullptr};130 XClassHint parent_class = {nullptr, nullptr};
116 XGetClassHint(dpy, parent_xid, &parent_class);131 XGetClassHint(dpy, parent_xid, &parent_class);
117 gtk_window_set_wmclass(self, parent_class.res_name, parent_class.res_class);132
133 if (!gdk_error_trap_pop_with_output("Impossible to get window class"))
134 gtk_window_set_wmclass(self, parent_class.res_name, parent_class.res_class);
135
118 XFree(parent_class.res_class);136 XFree(parent_class.res_class);
119 XFree(parent_class.res_name);137 XFree(parent_class.res_name);
120138
121 Atom WM_PID = gdk_x11_get_xatom_by_name("_NET_WM_PID");139 Atom WM_PID = gdk_x11_get_xatom_by_name("_NET_WM_PID");
122 Atom WM_CLIENT_MACHINE = gdk_x11_get_xatom_by_name("WM_CLIENT_MACHINE");140 Atom WM_CLIENT_MACHINE = gdk_x11_get_xatom_by_name("WM_CLIENT_MACHINE");
123141
142 gdk_error_trap_push();
124 auto& wm = WindowManager::Default();143 auto& wm = WindowManager::Default();
125 auto parent_hostname = wm.GetStringProperty(parent_xid, WM_CLIENT_MACHINE);144 auto parent_hostname = wm.GetStringProperty(parent_xid, WM_CLIENT_MACHINE);
126 long parent_pid = 0;145 long parent_pid = 0;
@@ -139,6 +158,8 @@
139 }158 }
140 }159 }
141160
161 gdk_error_trap_pop_with_output("Impossible to get window client machine and PID");
162
142 auto const& deco_style = decoration::Style::Get();163 auto const& deco_style = decoration::Style::Get();
143 auto const& offset = deco_style->ShadowOffset();164 auto const& offset = deco_style->ShadowOffset();
144 int max_offset = std::max(std::abs(offset.x * 4), std::abs(offset.y * 4));165 int max_offset = std::max(std::abs(offset.x * 4), std::abs(offset.y * 4));
@@ -162,14 +183,7 @@
162 auto xid = gdk_x11_window_get_xid(gwindow);183 auto xid = gdk_x11_window_get_xid(gwindow);
163 XSetTransientForHint(dpy, xid, parent_xid);184 XSetTransientForHint(dpy, xid, parent_xid);
164 XSync(dpy, False);185 XSync(dpy, False);
165186 gdk_error_trap_pop_with_output("Impossible to reparent dialog");
166 if (int error_code = gdk_error_trap_pop())
167 {
168 gchar tmp[1024];
169 XGetErrorText(dpy, error_code, tmp, sizeof(tmp) - 1);
170 tmp[sizeof(tmp) - 1] = '\0';
171 LOG_ERROR(logger) << "Impossible to reparent dialog: " << tmp;
172 }
173187
174 XChangeProperty(dpy, xid, WM_CLIENT_MACHINE, XA_STRING, 8, PropModeReplace,188 XChangeProperty(dpy, xid, WM_CLIENT_MACHINE, XA_STRING, 8, PropModeReplace,
175 (unsigned char *) parent_hostname.c_str(), parent_hostname.size());189 (unsigned char *) parent_hostname.c_str(), parent_hostname.size());
@@ -227,17 +241,9 @@
227241
228 gdk_error_trap_push();242 gdk_error_trap_push();
229 XSync(dpy, False);243 XSync(dpy, False);
230
231 if (int error_code = gdk_error_trap_pop())
232 {
233 gchar tmp[1024];
234 XGetErrorText(dpy, error_code, tmp, sizeof(tmp) - 1);
235 tmp[sizeof(tmp) - 1] = '\0';
236 LOG_ERROR(logger) << "Impossible to kill window " << parent_xid << ": " << tmp;
237 }
238
239 XKillClient(dpy, parent_xid);244 XKillClient(dpy, parent_xid);
240 XSync(dpy, False);245 XSync(dpy, False);
246 gdk_error_trap_pop_with_output("Impossible to kill window "+std::to_string(parent_xid));
241247
242 if (parent_pid > 0)248 if (parent_pid > 0)
243 kill(parent_pid, 9);249 kill(parent_pid, 9);
244250
=== modified file 'decorations/DecorationsManager.cpp'
--- decorations/DecorationsManager.cpp 2014-10-22 14:38:06 +0000
+++ decorations/DecorationsManager.cpp 2015-01-15 14:44:53 +0000
@@ -58,7 +58,7 @@
58 manager_->inactive_shadow_color.changed.connect(sigc::hide(sigc::bind(rebuild_cb, false)));58 manager_->inactive_shadow_color.changed.connect(sigc::hide(sigc::bind(rebuild_cb, false)));
59 manager_->inactive_shadow_radius.changed.connect(sigc::hide(sigc::bind(rebuild_cb, false)));59 manager_->inactive_shadow_radius.changed.connect(sigc::hide(sigc::bind(rebuild_cb, false)));
60 manager_->shadow_offset.changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::UpdateWindowsExtents)));60 manager_->shadow_offset.changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::UpdateWindowsExtents)));
61 Style::Get()->integrated_menus.changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::SetupIntegratedMenus)));61 menu_manager_->integrated_menus.changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::SetupIntegratedMenus)));
6262
63 BuildInactiveShadowTexture();63 BuildInactiveShadowTexture();
64 BuildActiveShadowTexture();64 BuildActiveShadowTexture();
@@ -110,7 +110,7 @@
110110
111void Manager::Impl::SetupIntegratedMenus()111void Manager::Impl::SetupIntegratedMenus()
112{112{
113 if (!Style::Get()->integrated_menus())113 if (!menu_manager_->integrated_menus())
114 {114 {
115 UnsetAppMenu();115 UnsetAppMenu();
116 menu_connections_.Clear();116 menu_connections_.Clear();
@@ -120,6 +120,7 @@
120 menu_connections_.Add(menu_manager_->appmenu_added.connect(sigc::mem_fun(this, &Impl::SetupAppMenu)));120 menu_connections_.Add(menu_manager_->appmenu_added.connect(sigc::mem_fun(this, &Impl::SetupAppMenu)));
121 menu_connections_.Add(menu_manager_->appmenu_removed.connect(sigc::mem_fun(this, &Impl::UnsetAppMenu)));121 menu_connections_.Add(menu_manager_->appmenu_removed.connect(sigc::mem_fun(this, &Impl::UnsetAppMenu)));
122 menu_connections_.Add(menu_manager_->key_activate_entry.connect(sigc::mem_fun(this, &Impl::OnMenuKeyActivated)));122 menu_connections_.Add(menu_manager_->key_activate_entry.connect(sigc::mem_fun(this, &Impl::OnMenuKeyActivated)));
123 menu_connections_.Add(menu_manager_->always_show_menus.changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::SetupAppMenu))));
123124
124 SetupAppMenu();125 SetupAppMenu();
125}126}
@@ -140,6 +141,8 @@
140 return;141 return;
141 }142 }
142143
144 appmenu->active_window = screen->activeWindow();
145
143 auto setup_active_window = [this] {146 auto setup_active_window = [this] {
144 if (Window::Ptr const& active_win = active_deco_win_.lock())147 if (Window::Ptr const& active_win = active_deco_win_.lock())
145 active_win->impl_->SetupAppMenu();148 active_win->impl_->SetupAppMenu();
@@ -256,11 +259,15 @@
256 if (active_deco_win_)259 if (active_deco_win_)
257 active_deco_win_->impl_->active = false;260 active_deco_win_->impl_->active = false;
258261
259 auto const& new_active = GetWindowByXid(screen->activeWindow());262 auto active_xid = screen->activeWindow();
263 auto const& new_active = GetWindowByXid(active_xid);
260 active_deco_win_ = new_active;264 active_deco_win_ = new_active;
261265
262 if (new_active)266 if (new_active)
263 new_active->impl_->active = true;267 new_active->impl_->active = true;
268
269 if (indicator::AppmenuIndicator::Ptr const& appmenu = menu_manager_->AppMenu())
270 appmenu->active_window = active_xid;
264 }271 }
265 else if (event->xproperty.atom == Atoms::mwmHints ||272 else if (event->xproperty.atom == Atoms::mwmHints ||
266 event->xproperty.atom == Atoms::wmAllowedActions)273 event->xproperty.atom == Atoms::wmAllowedActions)
267274
=== modified file 'decorations/DecorationsSlidingLayout.cpp'
--- decorations/DecorationsSlidingLayout.cpp 2014-02-24 15:50:23 +0000
+++ decorations/DecorationsSlidingLayout.cpp 2015-01-15 14:44:53 +0000
@@ -37,17 +37,13 @@
37SlidingLayout::SlidingLayout()37SlidingLayout::SlidingLayout()
38 : fadein(100)38 : fadein(100)
39 , fadeout(120)39 , fadeout(120)
40 , override_main_item(false)
40 , fade_animator_(fadein())41 , fade_animator_(fadein())
41{42{
42 items_.resize(2);43 items_.resize(2);
43 fade_animator_.updated.connect(sigc::hide(sigc::mem_fun(this, &SlidingLayout::Damage)));44 fade_animator_.updated.connect(sigc::hide(sigc::mem_fun(this, &SlidingLayout::Damage)));
44 mouse_owner.changed.connect([this] (bool owner) {45 mouse_owner.changed.connect(sigc::hide(sigc::mem_fun(this, &SlidingLayout::StartAnimation)));
45 if (items_[ItemRole::INPUT])46 override_main_item.changed.connect(sigc::hide(sigc::mem_fun(this, &SlidingLayout::StartAnimation)));
46 {
47 fade_animator_.SetDuration(owner ? fadein() : fadeout());
48 animation::StartOrReverseIf(fade_animator_, owner);
49 }
50 });
51}47}
5248
53void SlidingLayout::SetMainItem(Item::Ptr const& main)49void SlidingLayout::SetMainItem(Item::Ptr const& main)
@@ -126,6 +122,16 @@
126 rect_.setHeight(contents.height);122 rect_.setHeight(contents.height);
127}123}
128124
125void SlidingLayout::StartAnimation()
126{
127 if (items_[ItemRole::INPUT])
128 {
129 bool show_input = (mouse_owner() || override_main_item());
130 fade_animator_.SetDuration(show_input ? fadein() : fadeout());
131 animation::StartOrReverseIf(fade_animator_, show_input);
132 }
133}
134
129void SlidingLayout::Draw(GLWindow* ctx, GLMatrix const& transformation, GLWindowPaintAttrib const& attrib, CompRegion const& clip, unsigned mask)135void SlidingLayout::Draw(GLWindow* ctx, GLMatrix const& transformation, GLWindowPaintAttrib const& attrib, CompRegion const& clip, unsigned mask)
130{136{
131 auto& main_item_ = items_[ItemRole::MAIN];137 auto& main_item_ = items_[ItemRole::MAIN];
@@ -152,7 +158,7 @@
152 }158 }
153 else159 else
154 {160 {
155 auto const& draw_area = mouse_owner() ? input_item_ : main_item_;161 auto const& draw_area = (mouse_owner() || override_main_item()) ? input_item_ : main_item_;
156 draw_area->Draw(ctx, transformation, attrib, clip, mask);162 draw_area->Draw(ctx, transformation, attrib, clip, mask);
157 }163 }
158}164}
159165
=== modified file 'decorations/DecorationsSlidingLayout.h'
--- decorations/DecorationsSlidingLayout.h 2014-02-13 07:31:31 +0000
+++ decorations/DecorationsSlidingLayout.h 2015-01-15 14:44:53 +0000
@@ -37,6 +37,7 @@
3737
38 nux::Property<unsigned> fadein;38 nux::Property<unsigned> fadein;
39 nux::Property<unsigned> fadeout;39 nux::Property<unsigned> fadeout;
40 nux::Property<bool> override_main_item;
4041
41 void SetMainItem(Item::Ptr const& main);42 void SetMainItem(Item::Ptr const& main);
42 void SetInputItem(Item::Ptr const& input);43 void SetInputItem(Item::Ptr const& input);
@@ -47,6 +48,7 @@
4748
48private:49private:
49 void DoRelayout() override;50 void DoRelayout() override;
51 void StartAnimation();
5052
51 nux::animation::AnimateValue<double> fade_animator_;53 nux::animation::AnimateValue<double> fade_animator_;
52};54};
5355
=== modified file 'panel/PanelMenuView.cpp'
--- panel/PanelMenuView.cpp 2014-10-24 13:57:11 +0000
+++ panel/PanelMenuView.cpp 2015-01-15 14:44:53 +0000
@@ -65,7 +65,7 @@
65 {65 {
66 while (getline(fin, temp))66 while (getline(fin, temp))
67 {67 {
68 if (temp.substr(0,4) == "NAME")68 if (temp.substr(0, 4) == "NAME")
69 {69 {
70 os_release_name = boost::erase_all_copy(temp.substr(temp.find_last_of('=')+1), "\"");70 os_release_name = boost::erase_all_copy(temp.substr(temp.find_last_of('=')+1), "\"");
71 break;71 break;
@@ -98,7 +98,8 @@
98 , we_control_active_(false)98 , we_control_active_(false)
99 , new_app_menu_shown_(false)99 , new_app_menu_shown_(false)
100 , ignore_menu_visibility_(false)100 , ignore_menu_visibility_(false)
101 , integrated_menus_(decoration::Style::Get()->integrated_menus())101 , integrated_menus_(menu_manager_->integrated_menus())
102 , always_show_menus_(menu_manager_->always_show_menus())
102 , active_xid_(0)103 , active_xid_(0)
103 , desktop_name_(get_current_desktop())104 , desktop_name_(get_current_desktop())
104{105{
@@ -154,19 +155,8 @@
154 entry_added.connect(sigc::mem_fun(this, &PanelMenuView::OnEntryViewAdded));155 entry_added.connect(sigc::mem_fun(this, &PanelMenuView::OnEntryViewAdded));
155 Style::Instance().changed.connect(sigc::mem_fun(this, &PanelMenuView::OnStyleChanged));156 Style::Instance().changed.connect(sigc::mem_fun(this, &PanelMenuView::OnStyleChanged));
156157
157 auto const& deco_style = decoration::Style::Get();158 menu_manager_->integrated_menus.changed.connect(sigc::mem_fun(this, &PanelMenuView::OnLIMChanged));
158 lim_changed_connection_ = deco_style->integrated_menus.changed.connect([this] (bool lim) {159 menu_manager_->always_show_menus.changed.connect(sigc::mem_fun(this, &PanelMenuView::OnAlwaysShowMenusChanged));
159 integrated_menus_ = lim;
160 new_application_ = nullptr;
161 if (!integrated_menus_)
162 {
163 auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
164 is_inside_ = GetAbsoluteGeometry().IsInside(mouse);
165 window_buttons_->focused = true;
166 }
167 Refresh(true);
168 FullRedraw();
169 });
170}160}
171161
172void PanelMenuView::SetupWindowButtons()162void PanelMenuView::SetupWindowButtons()
@@ -268,6 +258,31 @@
268 window_buttons_->QueueDraw();258 window_buttons_->QueueDraw();
269}259}
270260
261void PanelMenuView::OnLIMChanged(bool lim)
262{
263 integrated_menus_ = lim;
264 new_application_ = nullptr;
265
266 if (!integrated_menus_)
267 {
268 CheckMouseInside();
269 window_buttons_->focused = true;
270 }
271
272 Refresh(true);
273 FullRedraw();
274}
275
276void PanelMenuView::OnAlwaysShowMenusChanged(bool always_show_menus)
277{
278 always_show_menus_ = always_show_menus;
279
280 if (!always_show_menus_)
281 CheckMouseInside();
282
283 FullRedraw();
284}
285
271nux::Area* PanelMenuView::FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type)286nux::Area* PanelMenuView::FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type)
272{287{
273 bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);288 bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);
@@ -376,7 +391,7 @@
376391
377 if (!wm.IsExpoActive() && !wm.IsScaleActive())392 if (!wm.IsExpoActive() && !wm.IsScaleActive())
378 {393 {
379 if (is_inside_ || last_active_view_ || show_now_activated_ || new_application_)394 if (is_inside_ || last_active_view_ || show_now_activated_ || new_application_ || always_show_menus_)
380 return true;395 return true;
381396
382 if (is_maximized_)397 if (is_maximized_)
@@ -404,7 +419,7 @@
404 {419 {
405 if (!WindowManager::Default().IsExpoActive())420 if (!WindowManager::Default().IsExpoActive())
406 {421 {
407 if (is_inside_ || show_now_activated_ || new_application_)422 if (is_inside_ || show_now_activated_ || new_application_ || always_show_menus_)
408 return true;423 return true;
409424
410 if (window_buttons_->IsMouseOwner() || titlebar_grab_area_->IsMouseOwner())425 if (window_buttons_->IsMouseOwner() || titlebar_grab_area_->IsMouseOwner())
@@ -848,6 +863,9 @@
848863
849std::string PanelMenuView::GetCurrentTitle() const864std::string PanelMenuView::GetCurrentTitle() const
850{865{
866 if (always_show_menus_ && is_maximized_ && we_control_active_)
867 return std::string();
868
851 if (integrated_menus_ || (!switcher_showing_ && !launcher_keynav_))869 if (integrated_menus_ || (!switcher_showing_ && !launcher_keynav_))
852 {870 {
853 std::string new_title;871 std::string new_title;
@@ -958,14 +976,10 @@
958976
959 if (!integrated_menus_ || is_maximized_)977 if (!integrated_menus_ || is_maximized_)
960 {978 {
961 auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();979 bool was_inside = is_inside_;
962 bool inside = GetAbsoluteGeometry().IsInside(mouse);
963980
964 if (is_inside_ != inside)981 if (CheckMouseInside() != was_inside)
965 {
966 is_inside_ = inside;
967 QueueDraw();982 QueueDraw();
968 }
969 }983 }
970}984}
971985
@@ -1065,7 +1079,7 @@
1065 app_name_changed_signal_.Connect(BAMF_VIEW(new_app), "name-changed",1079 app_name_changed_signal_.Connect(BAMF_VIEW(new_app), "name-changed",
1066 sigc::mem_fun(this, &PanelMenuView::OnNameChanged));1080 sigc::mem_fun(this, &PanelMenuView::OnNameChanged));
10671081
1068 if (integrated_menus_)1082 if (integrated_menus_ || always_show_menus_)
1069 return;1083 return;
10701084
1071 if (std::find(new_apps_.begin(), new_apps_.end(), new_app) != new_apps_.end())1085 if (std::find(new_apps_.begin(), new_apps_.end(), new_app) != new_apps_.end())
@@ -1263,8 +1277,7 @@
1263 maximized_wins_.push_front(xid);1277 maximized_wins_.push_front(xid);
12641278
1265 // We need to update the is_inside_ state in the case of maximization by grab1279 // We need to update the is_inside_ state in the case of maximization by grab
1266 auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();1280 CheckMouseInside();
1267 is_inside_ = GetAbsoluteGeometry().IsInside(mouse);
1268 is_maximized_ = true;1281 is_maximized_ = true;
12691282
1270 if (Refresh())1283 if (Refresh())
@@ -1674,6 +1687,7 @@
16741687
1675 introspection1688 introspection
1676 .add("mouse_inside", is_inside_)1689 .add("mouse_inside", is_inside_)
1690 .add("always_show_menus", always_show_menus_)
1677 .add("grabbed", is_grabbed_)1691 .add("grabbed", is_grabbed_)
1678 .add("active_win_maximized", is_maximized_)1692 .add("active_win_maximized", is_maximized_)
1679 .add("active_win_is_desktop", is_desktop_focused_)1693 .add("active_win_is_desktop", is_desktop_focused_)
@@ -1695,7 +1709,7 @@
16951709
1696void PanelMenuView::OnSwitcherShown(GVariant* data)1710void PanelMenuView::OnSwitcherShown(GVariant* data)
1697{1711{
1698 if (!data || integrated_menus_)1712 if (!data || integrated_menus_ || always_show_menus_)
1699 return;1713 return;
17001714
1701 gboolean switcher_shown;1715 gboolean switcher_shown;
@@ -1709,8 +1723,7 @@
17091723
1710 if (!switcher_showing_)1724 if (!switcher_showing_)
1711 {1725 {
1712 auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();1726 CheckMouseInside();
1713 is_inside_ = GetAbsoluteGeometry().IsInside(mouse);
1714 }1727 }
1715 else1728 else
1716 {1729 {
@@ -1738,9 +1751,7 @@
1738 return;1751 return;
17391752
1740 launcher_keynav_ = false;1753 launcher_keynav_ = false;
17411754 CheckMouseInside();
1742 auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
1743 is_inside_ = GetAbsoluteGeometry().IsInside(mouse);
17441755
1745 if (Refresh())1756 if (Refresh())
1746 QueueDraw();1757 QueueDraw();
@@ -1866,8 +1877,22 @@
1866 return we_control_active_;1877 return we_control_active_;
1867}1878}
18681879
1880bool PanelMenuView::CheckMouseInside()
1881{
1882 if (always_show_menus_)
1883 return is_inside_;
1884
1885 auto const& mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
1886 is_inside_ = GetAbsoluteGeometry().IsInside(mouse);
1887
1888 return is_inside_;
1889}
1890
1869void PanelMenuView::OnPanelViewMouseEnter(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)1891void PanelMenuView::OnPanelViewMouseEnter(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
1870{1892{
1893 if (always_show_menus_)
1894 return;
1895
1871 if (!is_inside_)1896 if (!is_inside_)
1872 {1897 {
1873 if (is_grabbed_)1898 if (is_grabbed_)
@@ -1881,6 +1906,9 @@
18811906
1882void PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)1907void PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
1883{1908{
1909 if (always_show_menus_)
1910 return;
1911
1884 if (is_inside_)1912 if (is_inside_)
1885 {1913 {
1886 is_inside_ = false;1914 is_inside_ = false;
@@ -1890,6 +1918,9 @@
18901918
1891void PanelMenuView::SetMousePosition(int x, int y)1919void PanelMenuView::SetMousePosition(int x, int y)
1892{1920{
1921 if (always_show_menus_)
1922 return;
1923
1893 if (last_active_view_ ||1924 if (last_active_view_ ||
1894 (x >= 0 && y >= 0 && GetAbsoluteGeometry().IsPointInside(x, y)))1925 (x >= 0 && y >= 0 && GetAbsoluteGeometry().IsPointInside(x, y)))
1895 {1926 {
18961927
=== modified file 'panel/PanelMenuView.h'
--- panel/PanelMenuView.h 2014-10-23 21:37:23 +0000
+++ panel/PanelMenuView.h 2015-01-15 14:44:53 +0000
@@ -91,6 +91,8 @@
91 void OnActiveAppChanged(BamfMatcher* matcher, BamfApplication* old_app, BamfApplication* new_app);91 void OnActiveAppChanged(BamfMatcher* matcher, BamfApplication* old_app, BamfApplication* new_app);
92 void OnNameChanged(BamfView* bamf_view, gchar* new_name, gchar* old_name);92 void OnNameChanged(BamfView* bamf_view, gchar* new_name, gchar* old_name);
93 void OnStyleChanged();93 void OnStyleChanged();
94 void OnLIMChanged(bool);
95 void OnAlwaysShowMenusChanged(bool);
9496
95 void OnSpreadInitiate();97 void OnSpreadInitiate();
96 void OnSpreadTerminate();98 void OnSpreadTerminate();
@@ -133,6 +135,7 @@
133 void OnLauncherSelectionChanged(GVariant* data);135 void OnLauncherSelectionChanged(GVariant* data);
134136
135 void UpdateShowNow(bool ignore);137 void UpdateShowNow(bool ignore);
138 bool CheckMouseInside();
136139
137 bool UpdateActiveWindowPosition();140 bool UpdateActiveWindowPosition();
138 bool UpdateShowNowWithDelay();141 bool UpdateShowNowWithDelay();
@@ -185,6 +188,7 @@
185 bool new_app_menu_shown_;188 bool new_app_menu_shown_;
186 bool ignore_menu_visibility_;189 bool ignore_menu_visibility_;
187 bool integrated_menus_;190 bool integrated_menus_;
191 bool always_show_menus_;
188192
189 Window active_xid_;193 Window active_xid_;
190 nux::Geometry monitor_geo_;194 nux::Geometry monitor_geo_;
@@ -196,7 +200,6 @@
196 glib::Signal<void, BamfMatcher*, BamfApplication*, BamfApplication*> active_app_changed_signal_;200 glib::Signal<void, BamfMatcher*, BamfApplication*, BamfApplication*> active_app_changed_signal_;
197 glib::Signal<void, BamfView*, gchar*, gchar*> view_name_changed_signal_;201 glib::Signal<void, BamfView*, gchar*, gchar*> view_name_changed_signal_;
198 glib::Signal<void, BamfView*, gchar*, gchar*> app_name_changed_signal_;202 glib::Signal<void, BamfView*, gchar*, gchar*> app_name_changed_signal_;
199 connection::Wrapper lim_changed_connection_;
200203
201 UBusManager ubus_manager_;204 UBusManager ubus_manager_;
202 glib::SourceManager sources_;205 glib::SourceManager sources_;
203206
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2014-12-20 03:12:15 +0000
+++ plugins/unityshell/src/unityshell.cpp 2015-01-15 14:44:53 +0000
@@ -3041,7 +3041,7 @@
3041 }3041 }
3042 }3042 }
3043 }3043 }
3044 else if (decoration::Style::Get()->integrated_menus())3044 else if (uScreen->menus_->integrated_menus())
3045 {3045 {
3046 draw_panel_shadow = DrawPanelShadow::BELOW_WINDOW;3046 draw_panel_shadow = DrawPanelShadow::BELOW_WINDOW;
3047 }3047 }
30483048
=== modified file 'unity-shared/DecorationStyle.cpp'
--- unity-shared/DecorationStyle.cpp 2014-08-07 13:15:17 +0000
+++ unity-shared/DecorationStyle.cpp 2015-01-15 14:44:53 +0000
@@ -157,7 +157,6 @@
157 gtk_widget_path_append_type(widget_path.get(), unity_decoration_get_type());157 gtk_widget_path_append_type(widget_path.get(), unity_decoration_get_type());
158 gtk_style_context_set_path(ctx_, widget_path.get());158 gtk_style_context_set_path(ctx_, widget_path.get());
159159
160 parent_->integrated_menus = false;
161 parent_->theme = glib::String(GetSettingValue<gchar*>("gtk-theme-name")).Str();160 parent_->theme = glib::String(GetSettingValue<gchar*>("gtk-theme-name")).Str();
162 parent_->font = glib::String(GetSettingValue<gchar*>("gtk-font-name")).Str();161 parent_->font = glib::String(GetSettingValue<gchar*>("gtk-font-name")).Str();
163 parent_->font_scale = 1.0;162 parent_->font_scale = 1.0;
164163
=== modified file 'unity-shared/DecorationStyle.h'
--- unity-shared/DecorationStyle.h 2014-04-02 17:05:04 +0000
+++ unity-shared/DecorationStyle.h 2015-01-15 14:44:53 +0000
@@ -118,7 +118,6 @@
118 nux::Property<std::string> theme;118 nux::Property<std::string> theme;
119 nux::Property<std::string> font;119 nux::Property<std::string> font;
120 nux::Property<std::string> title_font;120 nux::Property<std::string> title_font;
121 nux::Property<bool> integrated_menus;
122 nux::Property<unsigned> grab_wait;121 nux::Property<unsigned> grab_wait;
123 nux::Property<double> font_scale;122 nux::Property<double> font_scale;
124123
125124
=== modified file 'unity-shared/MenuManager.cpp'
--- unity-shared/MenuManager.cpp 2014-03-05 14:17:43 +0000
+++ unity-shared/MenuManager.cpp 2015-01-15 14:44:53 +0000
@@ -20,6 +20,7 @@
2020
21#include <gtk/gtk.h>21#include <gtk/gtk.h>
22#include <NuxCore/Logger.h>22#include <NuxCore/Logger.h>
23#include <UnityCore/GLibSignal.h>
23#include <UnityCore/GLibWrapper.h>24#include <UnityCore/GLibWrapper.h>
24#include <UnityCore/DBusIndicators.h>25#include <UnityCore/DBusIndicators.h>
25#include <unordered_map>26#include <unordered_map>
@@ -30,8 +31,15 @@
30{31{
31namespace menu32namespace menu
32{33{
34namespace
35{
33DECLARE_LOGGER(logger, "unity.menu.manager");36DECLARE_LOGGER(logger, "unity.menu.manager");
3437
38const std::string SETTINGS_NAME = "com.canonical.Unity";
39const std::string LIM_KEY = "integrated-menus";
40const std::string ALWAYS_SHOW_MENUS_KEY = "always-show-menus";
41}
42
35using namespace indicator;43using namespace indicator;
3644
37struct Manager::Impl : sigc::trackable45struct Manager::Impl : sigc::trackable
@@ -40,6 +48,7 @@
40 : parent_(parent)48 : parent_(parent)
41 , indicators_(indicators)49 , indicators_(indicators)
42 , key_grabber_(grabber)50 , key_grabber_(grabber)
51 , settings_(g_settings_new(SETTINGS_NAME.c_str()))
43 {52 {
44 for (auto const& indicator : indicators_->GetIndicators())53 for (auto const& indicator : indicators_->GetIndicators())
45 AddIndicator(indicator);54 AddIndicator(indicator);
@@ -49,6 +58,16 @@
49 indicators_->on_object_removed.connect(sigc::mem_fun(this, &Impl::RemoveIndicator));58 indicators_->on_object_removed.connect(sigc::mem_fun(this, &Impl::RemoveIndicator));
50 indicators_->on_entry_activate_request.connect(sigc::mem_fun(this, &Impl::ActivateRequest));59 indicators_->on_entry_activate_request.connect(sigc::mem_fun(this, &Impl::ActivateRequest));
51 indicators_->icon_paths_changed.connect(sigc::mem_fun(this, &Impl::IconPathsChanged));60 indicators_->icon_paths_changed.connect(sigc::mem_fun(this, &Impl::IconPathsChanged));
61
62 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());
63 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());
64
65 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + LIM_KEY, [this] (GSettings*, const gchar*) {
66 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());
67 });
68 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + ALWAYS_SHOW_MENUS_KEY, [this] (GSettings*, const gchar*) {
69 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());
70 });
52 }71 }
5372
54 ~Impl()73 ~Impl()
@@ -63,7 +82,7 @@
63 return;82 return;
6483
65 appmenu_connections_.Clear();84 appmenu_connections_.Clear();
66 appmenu_ = indicator;85 appmenu_ = std::static_pointer_cast<AppmenuIndicator>(indicator);
6786
68 for (auto const& entry : appmenu_->GetEntries())87 for (auto const& entry : appmenu_->GetEntries())
69 GrabEntryMnemonics(entry);88 GrabEntryMnemonics(entry);
@@ -149,14 +168,18 @@
149168
150 Manager* parent_;169 Manager* parent_;
151 Indicators::Ptr indicators_;170 Indicators::Ptr indicators_;
152 Indicator::Ptr appmenu_;171 AppmenuIndicator::Ptr appmenu_;
153 key::Grabber::Ptr key_grabber_;172 key::Grabber::Ptr key_grabber_;
154 connection::Manager appmenu_connections_;173 connection::Manager appmenu_connections_;
174 glib::Object<GSettings> settings_;
175 glib::SignalManager signals_;
155 std::unordered_map<std::string, std::shared_ptr<CompAction>> entry_actions_;176 std::unordered_map<std::string, std::shared_ptr<CompAction>> entry_actions_;
156};177};
157178
158Manager::Manager(Indicators::Ptr const& indicators, key::Grabber::Ptr const& grabber)179Manager::Manager(Indicators::Ptr const& indicators, key::Grabber::Ptr const& grabber)
159 : show_menus_wait(180)180 : integrated_menus(false)
181 , show_menus_wait(180)
182 , always_show_menus(false)
160 , fadein(100)183 , fadein(100)
161 , fadeout(120)184 , fadeout(120)
162 , discovery(2)185 , discovery(2)
@@ -178,7 +201,7 @@
178 return impl_->indicators_;201 return impl_->indicators_;
179}202}
180203
181Indicator::Ptr const& Manager::AppMenu() const204AppmenuIndicator::Ptr const& Manager::AppMenu() const
182{205{
183 return impl_->appmenu_;206 return impl_->appmenu_;
184}207}
185208
=== modified file 'unity-shared/MenuManager.h'
--- unity-shared/MenuManager.h 2014-02-13 05:47:03 +0000
+++ unity-shared/MenuManager.h 2015-01-15 14:44:53 +0000
@@ -22,6 +22,7 @@
2222
23#include <NuxCore/Property.h>23#include <NuxCore/Property.h>
24#include <UnityCore/Indicators.h>24#include <UnityCore/Indicators.h>
25#include <UnityCore/AppmenuIndicator.h>
25#include "KeyGrabber.h"26#include "KeyGrabber.h"
2627
27namespace unity28namespace unity
@@ -45,7 +46,10 @@
45 typedef std::shared_ptr<Manager> Ptr;46 typedef std::shared_ptr<Manager> Ptr;
4647
47 nux::Property<bool> show_menus;48 nux::Property<bool> show_menus;
49
50 nux::Property<bool> integrated_menus;
48 nux::Property<unsigned> show_menus_wait;51 nux::Property<unsigned> show_menus_wait;
52 nux::Property<bool> always_show_menus;
4953
50 nux::Property<unsigned> fadein;54 nux::Property<unsigned> fadein;
51 nux::Property<unsigned> fadeout;55 nux::Property<unsigned> fadeout;
@@ -58,7 +62,7 @@
5862
59 bool HasAppMenu() const;63 bool HasAppMenu() const;
60 indicator::Indicators::Ptr const& Indicators() const;64 indicator::Indicators::Ptr const& Indicators() const;
61 indicator::Indicator::Ptr const& AppMenu() const;65 indicator::AppmenuIndicator::Ptr const& AppMenu() const;
6266
63 key::Grabber::Ptr const& KeyGrabber() const;67 key::Grabber::Ptr const& KeyGrabber() const;
6468
6569
=== modified file 'unity-shared/UScreen.cpp'
--- unity-shared/UScreen.cpp 2014-11-28 12:56:12 +0000
+++ unity-shared/UScreen.cpp 2015-01-15 14:44:53 +0000
@@ -74,13 +74,10 @@
7474
75int UScreen::GetMonitorAtPosition(int x, int y) const75int UScreen::GetMonitorAtPosition(int x, int y) const
76{76{
77 int idx = 0;77 for (unsigned i = 0; i < monitors_.size(); ++i)
78
79 for (auto const& monitor : monitors_)
80 {78 {
81 if (monitor.IsPointInside(x, y))79 if (monitors_[i].IsPointInside(x, y))
82 return idx;80 return i;
83 ++idx;
84 }81 }
8582
86 return gdk_screen_get_monitor_at_point(screen_, x, y);83 return gdk_screen_get_monitor_at_point(screen_, x, y);
8784
=== modified file 'unity-shared/UnitySettings.cpp'
--- unity-shared/UnitySettings.cpp 2014-09-04 16:47:13 +0000
+++ unity-shared/UnitySettings.cpp 2015-01-15 14:44:53 +0000
@@ -38,7 +38,6 @@
38const std::string SETTINGS_NAME = "com.canonical.Unity";38const std::string SETTINGS_NAME = "com.canonical.Unity";
39const std::string FORM_FACTOR = "form-factor";39const std::string FORM_FACTOR = "form-factor";
40const std::string DOUBLE_CLICK_ACTIVATE = "double-click-activate";40const std::string DOUBLE_CLICK_ACTIVATE = "double-click-activate";
41const std::string LIM_KEY = "integrated-menus";
4241
43const std::string LIM_SETTINGS = "com.canonical.Unity.IntegratedMenus";42const std::string LIM_SETTINGS = "com.canonical.Unity.IntegratedMenus";
44const std::string CLICK_MOVEMENT_THRESHOLD = "click-movement-threshold";43const std::string CLICK_MOVEMENT_THRESHOLD = "click-movement-threshold";
@@ -113,10 +112,6 @@
113 parent_->double_click_activate.changed.emit(cached_double_click_activate_);112 parent_->double_click_activate.changed.emit(cached_double_click_activate_);
114 });113 });
115114
116 signals_.Add<void, GSettings*, const gchar*>(usettings_, "changed::" + LIM_KEY, [this] (GSettings*, const gchar*) {
117 UpdateLimSetting();
118 });
119
120 signals_.Add<void, GSettings*, const gchar*>(ubuntu_ui_settings_, "changed::" + SCALE_FACTOR, [this] (GSettings*, const gchar* t) {115 signals_.Add<void, GSettings*, const gchar*>(ubuntu_ui_settings_, "changed::" + SCALE_FACTOR, [this] (GSettings*, const gchar* t) {
121 UpdateDPI();116 UpdateDPI();
122 });117 });
@@ -190,7 +185,6 @@
190185
191 void UpdateLimSetting()186 void UpdateLimSetting()
192 {187 {
193 decoration::Style::Get()->integrated_menus = g_settings_get_boolean(usettings_, LIM_KEY.c_str());
194 parent_->lim_movement_thresold = g_settings_get_uint(lim_settings_, CLICK_MOVEMENT_THRESHOLD.c_str());188 parent_->lim_movement_thresold = g_settings_get_uint(lim_settings_, CLICK_MOVEMENT_THRESHOLD.c_str());
195 parent_->lim_double_click_wait = g_settings_get_uint(lim_settings_, DOUBLE_CLICK_WAIT.c_str());189 parent_->lim_double_click_wait = g_settings_get_uint(lim_settings_, DOUBLE_CLICK_WAIT.c_str());
196 }190 }