Merge lp:~3v1n0/unity/lim-visibility-fixes into lp:unity
- lim-visibility-fixes
- Merge into trunk
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 |
Related bugs: |
|
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
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3899
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3899
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:3899
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Stephen M. Webb (bregma) wrote : | # |
Builds OK (thanks for nothing, Jenkins).
Will do more rigourous testing from the landing silo.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:3900
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Christopher Townsend (townsend) wrote : | # |
lol, I meant to approve the SRU branch. My Firefox tabs got me confused:)
Preview Diff
1 | === modified file 'UnityCore/AppmenuIndicator.cpp' | |||
2 | --- UnityCore/AppmenuIndicator.cpp 2012-12-04 00:33:18 +0000 | |||
3 | +++ UnityCore/AppmenuIndicator.cpp 2015-01-15 14:44:53 +0000 | |||
4 | @@ -17,6 +17,7 @@ | |||
5 | 17 | * Authored by: Marco Trevisan (Treviño) <3v1n0@ubuntu.com> | 17 | * Authored by: Marco Trevisan (Treviño) <3v1n0@ubuntu.com> |
6 | 18 | */ | 18 | */ |
7 | 19 | 19 | ||
8 | 20 | #include "GLibSource.h" | ||
9 | 20 | #include "AppmenuIndicator.h" | 21 | #include "AppmenuIndicator.h" |
10 | 21 | 22 | ||
11 | 22 | namespace unity | 23 | namespace unity |
12 | @@ -24,8 +25,31 @@ | |||
13 | 24 | namespace indicator | 25 | namespace indicator |
14 | 25 | { | 26 | { |
15 | 26 | 27 | ||
16 | 28 | struct AppmenuIndicator::Impl | ||
17 | 29 | { | ||
18 | 30 | Impl(AppmenuIndicator* parent) | ||
19 | 31 | { | ||
20 | 32 | // When the active window has changed we might need to emit an updated signal | ||
21 | 33 | parent->active_window.changed.connect([this, parent] (unsigned long) { | ||
22 | 34 | update_wait_.reset(new glib::Timeout(250, [parent] { | ||
23 | 35 | parent->updated.emit(); | ||
24 | 36 | return false; | ||
25 | 37 | })); | ||
26 | 38 | }); | ||
27 | 39 | |||
28 | 40 | parent->updated.connect([this] { update_wait_.reset(); }); | ||
29 | 41 | } | ||
30 | 42 | |||
31 | 43 | glib::Source::UniquePtr update_wait_; | ||
32 | 44 | }; | ||
33 | 45 | |||
34 | 27 | AppmenuIndicator::AppmenuIndicator(std::string const& name) | 46 | AppmenuIndicator::AppmenuIndicator(std::string const& name) |
35 | 28 | : Indicator(name) | 47 | : Indicator(name) |
36 | 48 | , active_window(0) | ||
37 | 49 | , impl_(new AppmenuIndicator::Impl(this)) | ||
38 | 50 | {} | ||
39 | 51 | |||
40 | 52 | AppmenuIndicator::~AppmenuIndicator() | ||
41 | 29 | {} | 53 | {} |
42 | 30 | 54 | ||
43 | 31 | void AppmenuIndicator::ShowAppmenu(unsigned int xid, int x, int y) const | 55 | void AppmenuIndicator::ShowAppmenu(unsigned int xid, int x, int y) const |
44 | 32 | 56 | ||
45 | === modified file 'UnityCore/AppmenuIndicator.h' | |||
46 | --- UnityCore/AppmenuIndicator.h 2014-02-12 00:51:09 +0000 | |||
47 | +++ UnityCore/AppmenuIndicator.h 2015-01-15 14:44:53 +0000 | |||
48 | @@ -20,6 +20,7 @@ | |||
49 | 20 | #ifndef UNITY_APPMENU_INDICATOR_H | 20 | #ifndef UNITY_APPMENU_INDICATOR_H |
50 | 21 | #define UNITY_APPMENU_INDICATOR_H | 21 | #define UNITY_APPMENU_INDICATOR_H |
51 | 22 | 22 | ||
52 | 23 | #include <NuxCore/Property.h> | ||
53 | 23 | #include "Indicator.h" | 24 | #include "Indicator.h" |
54 | 24 | 25 | ||
55 | 25 | namespace unity | 26 | namespace unity |
56 | @@ -33,12 +34,19 @@ | |||
57 | 33 | typedef std::shared_ptr<AppmenuIndicator> Ptr; | 34 | typedef std::shared_ptr<AppmenuIndicator> Ptr; |
58 | 34 | 35 | ||
59 | 35 | AppmenuIndicator(std::string const& name); | 36 | AppmenuIndicator(std::string const& name); |
60 | 37 | ~AppmenuIndicator(); | ||
61 | 38 | |||
62 | 39 | nux::Property<unsigned> active_window; | ||
63 | 36 | 40 | ||
64 | 37 | virtual bool IsAppmenu() const { return true; } | 41 | virtual bool IsAppmenu() const { return true; } |
65 | 38 | 42 | ||
66 | 39 | void ShowAppmenu(unsigned xid, int x, int y) const; | 43 | void ShowAppmenu(unsigned xid, int x, int y) const; |
67 | 40 | 44 | ||
68 | 41 | sigc::signal<void, unsigned, int, int> on_show_appmenu; | 45 | sigc::signal<void, unsigned, int, int> on_show_appmenu; |
69 | 46 | |||
70 | 47 | private: | ||
71 | 48 | struct Impl; | ||
72 | 49 | std::unique_ptr<Impl> impl_; | ||
73 | 42 | }; | 50 | }; |
74 | 43 | 51 | ||
75 | 44 | } | 52 | } |
76 | 45 | 53 | ||
77 | === modified file 'com.canonical.Unity.gschema.xml' | |||
78 | --- com.canonical.Unity.gschema.xml 2014-09-10 12:48:03 +0000 | |||
79 | +++ com.canonical.Unity.gschema.xml 2015-01-15 14:44:53 +0000 | |||
80 | @@ -53,6 +53,14 @@ | |||
81 | 53 | on the window decoration, otherwise they will be always shown on the | 53 | on the window decoration, otherwise they will be always shown on the |
82 | 54 | unity top panel</description> | 54 | unity top panel</description> |
83 | 55 | </key> | 55 | </key> |
84 | 56 | <key type="b" name="always-show-menus"> | ||
85 | 57 | <default>false</default> | ||
86 | 58 | <summary>Toggle the menu visibility based on mouse hovering.</summary> | ||
87 | 59 | <description>When this is enabled, the application menus will be always | ||
88 | 60 | shown (on the window decoration or in the unity panel, depending whether | ||
89 | 61 | integrated menus are enabled), otherwise they will be shown only when | ||
90 | 62 | the mouse cursor is over the relative mouse area.</description> | ||
91 | 63 | </key> | ||
92 | 56 | </schema> | 64 | </schema> |
93 | 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"> |
94 | 58 | <key type="d" name="text-scale-factor"> | 66 | <key type="d" name="text-scale-factor"> |
95 | 59 | 67 | ||
96 | === modified file 'decorations/DecoratedWindow.cpp' | |||
97 | --- decorations/DecoratedWindow.cpp 2014-11-28 12:55:13 +0000 | |||
98 | +++ decorations/DecoratedWindow.cpp 2015-01-15 14:44:53 +0000 | |||
99 | @@ -708,16 +708,14 @@ | |||
100 | 708 | auto const& sliding_layout = sliding_layout_.lock(); | 708 | auto const& sliding_layout = sliding_layout_.lock(); |
101 | 709 | sliding_layout->SetInputItem(nullptr); | 709 | sliding_layout->SetInputItem(nullptr); |
102 | 710 | sliding_layout->mouse_owner = false; | 710 | sliding_layout->mouse_owner = false; |
103 | 711 | sliding_layout->override_main_item = false; | ||
104 | 712 | grab_mouse_changed_->disconnect(); | ||
105 | 711 | 713 | ||
107 | 712 | if (!menu_manager->HasAppMenu() || !Style::Get()->integrated_menus()) | 714 | if (!menu_manager->HasAppMenu() || !menu_manager->integrated_menus()) |
108 | 713 | return; | 715 | return; |
109 | 714 | 716 | ||
110 | 715 | auto visibility_cb = sigc::hide(sigc::mem_fun(this, &Impl::UpdateAppMenuVisibility)); | ||
111 | 716 | auto menus = std::make_shared<MenuLayout>(menu_manager, win_); | 717 | auto menus = std::make_shared<MenuLayout>(menu_manager, win_); |
112 | 717 | menus->Setup(); | 718 | menus->Setup(); |
113 | 718 | menus->active.changed.connect(visibility_cb); | ||
114 | 719 | menus->show_now.changed.connect(visibility_cb); | ||
115 | 720 | menus->mouse_owner.changed.connect(visibility_cb); | ||
116 | 721 | menus_ = menus; | 719 | menus_ = menus; |
117 | 722 | 720 | ||
118 | 723 | auto const& grab_edge = grab_edge_.lock(); | 721 | auto const& grab_edge = grab_edge_.lock(); |
119 | @@ -725,15 +723,27 @@ | |||
120 | 725 | sliding_layout->fadein = menu_manager->fadein(); | 723 | sliding_layout->fadein = menu_manager->fadein(); |
121 | 726 | sliding_layout->fadeout = menu_manager->fadeout(); | 724 | sliding_layout->fadeout = menu_manager->fadeout(); |
122 | 727 | 725 | ||
132 | 728 | if (grab_edge->mouse_owner() || grab_edge->Geometry().contains(CompPoint(pointerX, pointerY))) | 726 | if (menu_manager->always_show_menus()) |
133 | 729 | sliding_layout->mouse_owner = true; | 727 | { |
134 | 730 | 728 | sliding_layout->override_main_item = true; | |
135 | 731 | grab_mouse_changed_ = grab_edge->mouse_owner.changed.connect([this] (bool owner) { | 729 | } |
136 | 732 | sliding_layout_->mouse_owner = owner; | 730 | else |
137 | 733 | }); | 731 | { |
138 | 734 | 732 | auto visibility_cb = sigc::hide(sigc::mem_fun(this, &Impl::UpdateAppMenuVisibility)); | |
139 | 735 | if (sliding_layout->mouse_owner()) | 733 | menus->active.changed.connect(visibility_cb); |
140 | 736 | input_mixer_->ForceMouseOwnerCheck(); | 734 | menus->show_now.changed.connect(visibility_cb); |
141 | 735 | menus->mouse_owner.changed.connect(visibility_cb); | ||
142 | 736 | |||
143 | 737 | if (grab_edge->mouse_owner() || grab_edge->Geometry().contains(CompPoint(pointerX, pointerY))) | ||
144 | 738 | sliding_layout->mouse_owner = true; | ||
145 | 739 | |||
146 | 740 | grab_mouse_changed_ = grab_edge->mouse_owner.changed.connect([this] (bool owner) { | ||
147 | 741 | sliding_layout_->mouse_owner = owner || menus_->show_now(); | ||
148 | 742 | }); | ||
149 | 743 | |||
150 | 744 | if (sliding_layout->mouse_owner()) | ||
151 | 745 | input_mixer_->ForceMouseOwnerCheck(); | ||
152 | 746 | } | ||
153 | 737 | 747 | ||
154 | 738 | SyncMenusGeometries(); | 748 | SyncMenusGeometries(); |
155 | 739 | } | 749 | } |
156 | 740 | 750 | ||
157 | === modified file 'decorations/DecorationsForceQuitDialog.cpp' | |||
158 | --- decorations/DecorationsForceQuitDialog.cpp 2015-01-12 18:30:09 +0000 | |||
159 | +++ decorations/DecorationsForceQuitDialog.cpp 2015-01-15 14:44:53 +0000 | |||
160 | @@ -97,6 +97,20 @@ | |||
161 | 97 | static void close_button_init(CloseButton*); | 97 | static void close_button_init(CloseButton*); |
162 | 98 | static void close_button_class_init(CloseButtonClass*); | 98 | static void close_button_class_init(CloseButtonClass*); |
163 | 99 | 99 | ||
164 | 100 | bool gdk_error_trap_pop_with_output(std::string const& prefix) | ||
165 | 101 | { | ||
166 | 102 | if (int error_code = gdk_error_trap_pop()) | ||
167 | 103 | { | ||
168 | 104 | gchar tmp[1024]; | ||
169 | 105 | XGetErrorText(gdk_x11_get_default_xdisplay(), error_code, tmp, sizeof(tmp) - 1); | ||
170 | 106 | tmp[sizeof(tmp) - 1] = '\0'; | ||
171 | 107 | LOG_ERROR(logger) << (prefix.empty() ? "X error: " : prefix+": ") << tmp; | ||
172 | 108 | return true; | ||
173 | 109 | } | ||
174 | 110 | |||
175 | 111 | return false; | ||
176 | 112 | } | ||
177 | 113 | |||
178 | 100 | // Window implementation | 114 | // Window implementation |
179 | 101 | GtkWidget* sheet_style_window_new(ForceQuitDialog* main_dialog, Window parent_xid) | 115 | GtkWidget* sheet_style_window_new(ForceQuitDialog* main_dialog, Window parent_xid) |
180 | 102 | { | 116 | { |
181 | @@ -112,15 +126,20 @@ | |||
182 | 112 | gtk_window_set_deletable(self, FALSE); | 126 | gtk_window_set_deletable(self, FALSE); |
183 | 113 | gtk_window_set_title(self, "Force Quit Dialog"); | 127 | gtk_window_set_title(self, "Force Quit Dialog"); |
184 | 114 | 128 | ||
185 | 129 | gdk_error_trap_push(); | ||
186 | 115 | XClassHint parent_class = {nullptr, nullptr}; | 130 | XClassHint parent_class = {nullptr, nullptr}; |
187 | 116 | XGetClassHint(dpy, parent_xid, &parent_class); | 131 | XGetClassHint(dpy, parent_xid, &parent_class); |
189 | 117 | gtk_window_set_wmclass(self, parent_class.res_name, parent_class.res_class); | 132 | |
190 | 133 | if (!gdk_error_trap_pop_with_output("Impossible to get window class")) | ||
191 | 134 | gtk_window_set_wmclass(self, parent_class.res_name, parent_class.res_class); | ||
192 | 135 | |||
193 | 118 | XFree(parent_class.res_class); | 136 | XFree(parent_class.res_class); |
194 | 119 | XFree(parent_class.res_name); | 137 | XFree(parent_class.res_name); |
195 | 120 | 138 | ||
196 | 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"); |
197 | 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"); |
198 | 123 | 141 | ||
199 | 142 | gdk_error_trap_push(); | ||
200 | 124 | auto& wm = WindowManager::Default(); | 143 | auto& wm = WindowManager::Default(); |
201 | 125 | auto parent_hostname = wm.GetStringProperty(parent_xid, WM_CLIENT_MACHINE); | 144 | auto parent_hostname = wm.GetStringProperty(parent_xid, WM_CLIENT_MACHINE); |
202 | 126 | long parent_pid = 0; | 145 | long parent_pid = 0; |
203 | @@ -139,6 +158,8 @@ | |||
204 | 139 | } | 158 | } |
205 | 140 | } | 159 | } |
206 | 141 | 160 | ||
207 | 161 | gdk_error_trap_pop_with_output("Impossible to get window client machine and PID"); | ||
208 | 162 | |||
209 | 142 | auto const& deco_style = decoration::Style::Get(); | 163 | auto const& deco_style = decoration::Style::Get(); |
210 | 143 | auto const& offset = deco_style->ShadowOffset(); | 164 | auto const& offset = deco_style->ShadowOffset(); |
211 | 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)); |
212 | @@ -162,14 +183,7 @@ | |||
213 | 162 | auto xid = gdk_x11_window_get_xid(gwindow); | 183 | auto xid = gdk_x11_window_get_xid(gwindow); |
214 | 163 | XSetTransientForHint(dpy, xid, parent_xid); | 184 | XSetTransientForHint(dpy, xid, parent_xid); |
215 | 164 | XSync(dpy, False); | 185 | XSync(dpy, False); |
224 | 165 | 186 | gdk_error_trap_pop_with_output("Impossible to reparent dialog"); | |
217 | 166 | if (int error_code = gdk_error_trap_pop()) | ||
218 | 167 | { | ||
219 | 168 | gchar tmp[1024]; | ||
220 | 169 | XGetErrorText(dpy, error_code, tmp, sizeof(tmp) - 1); | ||
221 | 170 | tmp[sizeof(tmp) - 1] = '\0'; | ||
222 | 171 | LOG_ERROR(logger) << "Impossible to reparent dialog: " << tmp; | ||
223 | 172 | } | ||
225 | 173 | 187 | ||
226 | 174 | XChangeProperty(dpy, xid, WM_CLIENT_MACHINE, XA_STRING, 8, PropModeReplace, | 188 | XChangeProperty(dpy, xid, WM_CLIENT_MACHINE, XA_STRING, 8, PropModeReplace, |
227 | 175 | (unsigned char *) parent_hostname.c_str(), parent_hostname.size()); | 189 | (unsigned char *) parent_hostname.c_str(), parent_hostname.size()); |
228 | @@ -227,17 +241,9 @@ | |||
229 | 227 | 241 | ||
230 | 228 | gdk_error_trap_push(); | 242 | gdk_error_trap_push(); |
231 | 229 | XSync(dpy, False); | 243 | XSync(dpy, False); |
232 | 230 | |||
233 | 231 | if (int error_code = gdk_error_trap_pop()) | ||
234 | 232 | { | ||
235 | 233 | gchar tmp[1024]; | ||
236 | 234 | XGetErrorText(dpy, error_code, tmp, sizeof(tmp) - 1); | ||
237 | 235 | tmp[sizeof(tmp) - 1] = '\0'; | ||
238 | 236 | LOG_ERROR(logger) << "Impossible to kill window " << parent_xid << ": " << tmp; | ||
239 | 237 | } | ||
240 | 238 | |||
241 | 239 | XKillClient(dpy, parent_xid); | 244 | XKillClient(dpy, parent_xid); |
242 | 240 | XSync(dpy, False); | 245 | XSync(dpy, False); |
243 | 246 | gdk_error_trap_pop_with_output("Impossible to kill window "+std::to_string(parent_xid)); | ||
244 | 241 | 247 | ||
245 | 242 | if (parent_pid > 0) | 248 | if (parent_pid > 0) |
246 | 243 | kill(parent_pid, 9); | 249 | kill(parent_pid, 9); |
247 | 244 | 250 | ||
248 | === modified file 'decorations/DecorationsManager.cpp' | |||
249 | --- decorations/DecorationsManager.cpp 2014-10-22 14:38:06 +0000 | |||
250 | +++ decorations/DecorationsManager.cpp 2015-01-15 14:44:53 +0000 | |||
251 | @@ -58,7 +58,7 @@ | |||
252 | 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))); |
253 | 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))); |
254 | 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))); |
256 | 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))); |
257 | 62 | 62 | ||
258 | 63 | BuildInactiveShadowTexture(); | 63 | BuildInactiveShadowTexture(); |
259 | 64 | BuildActiveShadowTexture(); | 64 | BuildActiveShadowTexture(); |
260 | @@ -110,7 +110,7 @@ | |||
261 | 110 | 110 | ||
262 | 111 | void Manager::Impl::SetupIntegratedMenus() | 111 | void Manager::Impl::SetupIntegratedMenus() |
263 | 112 | { | 112 | { |
265 | 113 | if (!Style::Get()->integrated_menus()) | 113 | if (!menu_manager_->integrated_menus()) |
266 | 114 | { | 114 | { |
267 | 115 | UnsetAppMenu(); | 115 | UnsetAppMenu(); |
268 | 116 | menu_connections_.Clear(); | 116 | menu_connections_.Clear(); |
269 | @@ -120,6 +120,7 @@ | |||
270 | 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))); |
271 | 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))); |
272 | 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))); |
273 | 123 | menu_connections_.Add(menu_manager_->always_show_menus.changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::SetupAppMenu)))); | ||
274 | 123 | 124 | ||
275 | 124 | SetupAppMenu(); | 125 | SetupAppMenu(); |
276 | 125 | } | 126 | } |
277 | @@ -140,6 +141,8 @@ | |||
278 | 140 | return; | 141 | return; |
279 | 141 | } | 142 | } |
280 | 142 | 143 | ||
281 | 144 | appmenu->active_window = screen->activeWindow(); | ||
282 | 145 | |||
283 | 143 | auto setup_active_window = [this] { | 146 | auto setup_active_window = [this] { |
284 | 144 | if (Window::Ptr const& active_win = active_deco_win_.lock()) | 147 | if (Window::Ptr const& active_win = active_deco_win_.lock()) |
285 | 145 | active_win->impl_->SetupAppMenu(); | 148 | active_win->impl_->SetupAppMenu(); |
286 | @@ -256,11 +259,15 @@ | |||
287 | 256 | if (active_deco_win_) | 259 | if (active_deco_win_) |
288 | 257 | active_deco_win_->impl_->active = false; | 260 | active_deco_win_->impl_->active = false; |
289 | 258 | 261 | ||
291 | 259 | auto const& new_active = GetWindowByXid(screen->activeWindow()); | 262 | auto active_xid = screen->activeWindow(); |
292 | 263 | auto const& new_active = GetWindowByXid(active_xid); | ||
293 | 260 | active_deco_win_ = new_active; | 264 | active_deco_win_ = new_active; |
294 | 261 | 265 | ||
295 | 262 | if (new_active) | 266 | if (new_active) |
296 | 263 | new_active->impl_->active = true; | 267 | new_active->impl_->active = true; |
297 | 268 | |||
298 | 269 | if (indicator::AppmenuIndicator::Ptr const& appmenu = menu_manager_->AppMenu()) | ||
299 | 270 | appmenu->active_window = active_xid; | ||
300 | 264 | } | 271 | } |
301 | 265 | else if (event->xproperty.atom == Atoms::mwmHints || | 272 | else if (event->xproperty.atom == Atoms::mwmHints || |
302 | 266 | event->xproperty.atom == Atoms::wmAllowedActions) | 273 | event->xproperty.atom == Atoms::wmAllowedActions) |
303 | 267 | 274 | ||
304 | === modified file 'decorations/DecorationsSlidingLayout.cpp' | |||
305 | --- decorations/DecorationsSlidingLayout.cpp 2014-02-24 15:50:23 +0000 | |||
306 | +++ decorations/DecorationsSlidingLayout.cpp 2015-01-15 14:44:53 +0000 | |||
307 | @@ -37,17 +37,13 @@ | |||
308 | 37 | SlidingLayout::SlidingLayout() | 37 | SlidingLayout::SlidingLayout() |
309 | 38 | : fadein(100) | 38 | : fadein(100) |
310 | 39 | , fadeout(120) | 39 | , fadeout(120) |
311 | 40 | , override_main_item(false) | ||
312 | 40 | , fade_animator_(fadein()) | 41 | , fade_animator_(fadein()) |
313 | 41 | { | 42 | { |
314 | 42 | items_.resize(2); | 43 | items_.resize(2); |
315 | 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))); |
323 | 44 | mouse_owner.changed.connect([this] (bool owner) { | 45 | mouse_owner.changed.connect(sigc::hide(sigc::mem_fun(this, &SlidingLayout::StartAnimation))); |
324 | 45 | if (items_[ItemRole::INPUT]) | 46 | override_main_item.changed.connect(sigc::hide(sigc::mem_fun(this, &SlidingLayout::StartAnimation))); |
318 | 46 | { | ||
319 | 47 | fade_animator_.SetDuration(owner ? fadein() : fadeout()); | ||
320 | 48 | animation::StartOrReverseIf(fade_animator_, owner); | ||
321 | 49 | } | ||
322 | 50 | }); | ||
325 | 51 | } | 47 | } |
326 | 52 | 48 | ||
327 | 53 | void SlidingLayout::SetMainItem(Item::Ptr const& main) | 49 | void SlidingLayout::SetMainItem(Item::Ptr const& main) |
328 | @@ -126,6 +122,16 @@ | |||
329 | 126 | rect_.setHeight(contents.height); | 122 | rect_.setHeight(contents.height); |
330 | 127 | } | 123 | } |
331 | 128 | 124 | ||
332 | 125 | void SlidingLayout::StartAnimation() | ||
333 | 126 | { | ||
334 | 127 | if (items_[ItemRole::INPUT]) | ||
335 | 128 | { | ||
336 | 129 | bool show_input = (mouse_owner() || override_main_item()); | ||
337 | 130 | fade_animator_.SetDuration(show_input ? fadein() : fadeout()); | ||
338 | 131 | animation::StartOrReverseIf(fade_animator_, show_input); | ||
339 | 132 | } | ||
340 | 133 | } | ||
341 | 134 | |||
342 | 129 | void SlidingLayout::Draw(GLWindow* ctx, GLMatrix const& transformation, GLWindowPaintAttrib const& attrib, CompRegion const& clip, unsigned mask) | 135 | void SlidingLayout::Draw(GLWindow* ctx, GLMatrix const& transformation, GLWindowPaintAttrib const& attrib, CompRegion const& clip, unsigned mask) |
343 | 130 | { | 136 | { |
344 | 131 | auto& main_item_ = items_[ItemRole::MAIN]; | 137 | auto& main_item_ = items_[ItemRole::MAIN]; |
345 | @@ -152,7 +158,7 @@ | |||
346 | 152 | } | 158 | } |
347 | 153 | else | 159 | else |
348 | 154 | { | 160 | { |
350 | 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_; |
351 | 156 | draw_area->Draw(ctx, transformation, attrib, clip, mask); | 162 | draw_area->Draw(ctx, transformation, attrib, clip, mask); |
352 | 157 | } | 163 | } |
353 | 158 | } | 164 | } |
354 | 159 | 165 | ||
355 | === modified file 'decorations/DecorationsSlidingLayout.h' | |||
356 | --- decorations/DecorationsSlidingLayout.h 2014-02-13 07:31:31 +0000 | |||
357 | +++ decorations/DecorationsSlidingLayout.h 2015-01-15 14:44:53 +0000 | |||
358 | @@ -37,6 +37,7 @@ | |||
359 | 37 | 37 | ||
360 | 38 | nux::Property<unsigned> fadein; | 38 | nux::Property<unsigned> fadein; |
361 | 39 | nux::Property<unsigned> fadeout; | 39 | nux::Property<unsigned> fadeout; |
362 | 40 | nux::Property<bool> override_main_item; | ||
363 | 40 | 41 | ||
364 | 41 | void SetMainItem(Item::Ptr const& main); | 42 | void SetMainItem(Item::Ptr const& main); |
365 | 42 | void SetInputItem(Item::Ptr const& input); | 43 | void SetInputItem(Item::Ptr const& input); |
366 | @@ -47,6 +48,7 @@ | |||
367 | 47 | 48 | ||
368 | 48 | private: | 49 | private: |
369 | 49 | void DoRelayout() override; | 50 | void DoRelayout() override; |
370 | 51 | void StartAnimation(); | ||
371 | 50 | 52 | ||
372 | 51 | nux::animation::AnimateValue<double> fade_animator_; | 53 | nux::animation::AnimateValue<double> fade_animator_; |
373 | 52 | }; | 54 | }; |
374 | 53 | 55 | ||
375 | === modified file 'panel/PanelMenuView.cpp' | |||
376 | --- panel/PanelMenuView.cpp 2014-10-24 13:57:11 +0000 | |||
377 | +++ panel/PanelMenuView.cpp 2015-01-15 14:44:53 +0000 | |||
378 | @@ -65,7 +65,7 @@ | |||
379 | 65 | { | 65 | { |
380 | 66 | while (getline(fin, temp)) | 66 | while (getline(fin, temp)) |
381 | 67 | { | 67 | { |
383 | 68 | if (temp.substr(0,4) == "NAME") | 68 | if (temp.substr(0, 4) == "NAME") |
384 | 69 | { | 69 | { |
385 | 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), "\""); |
386 | 71 | break; | 71 | break; |
387 | @@ -98,7 +98,8 @@ | |||
388 | 98 | , we_control_active_(false) | 98 | , we_control_active_(false) |
389 | 99 | , new_app_menu_shown_(false) | 99 | , new_app_menu_shown_(false) |
390 | 100 | , ignore_menu_visibility_(false) | 100 | , ignore_menu_visibility_(false) |
392 | 101 | , integrated_menus_(decoration::Style::Get()->integrated_menus()) | 101 | , integrated_menus_(menu_manager_->integrated_menus()) |
393 | 102 | , always_show_menus_(menu_manager_->always_show_menus()) | ||
394 | 102 | , active_xid_(0) | 103 | , active_xid_(0) |
395 | 103 | , desktop_name_(get_current_desktop()) | 104 | , desktop_name_(get_current_desktop()) |
396 | 104 | { | 105 | { |
397 | @@ -154,19 +155,8 @@ | |||
398 | 154 | entry_added.connect(sigc::mem_fun(this, &PanelMenuView::OnEntryViewAdded)); | 155 | entry_added.connect(sigc::mem_fun(this, &PanelMenuView::OnEntryViewAdded)); |
399 | 155 | Style::Instance().changed.connect(sigc::mem_fun(this, &PanelMenuView::OnStyleChanged)); | 156 | Style::Instance().changed.connect(sigc::mem_fun(this, &PanelMenuView::OnStyleChanged)); |
400 | 156 | 157 | ||
414 | 157 | auto const& deco_style = decoration::Style::Get(); | 158 | menu_manager_->integrated_menus.changed.connect(sigc::mem_fun(this, &PanelMenuView::OnLIMChanged)); |
415 | 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)); |
403 | 159 | integrated_menus_ = lim; | ||
404 | 160 | new_application_ = nullptr; | ||
405 | 161 | if (!integrated_menus_) | ||
406 | 162 | { | ||
407 | 163 | auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord(); | ||
408 | 164 | is_inside_ = GetAbsoluteGeometry().IsInside(mouse); | ||
409 | 165 | window_buttons_->focused = true; | ||
410 | 166 | } | ||
411 | 167 | Refresh(true); | ||
412 | 168 | FullRedraw(); | ||
413 | 169 | }); | ||
416 | 170 | } | 160 | } |
417 | 171 | 161 | ||
418 | 172 | void PanelMenuView::SetupWindowButtons() | 162 | void PanelMenuView::SetupWindowButtons() |
419 | @@ -268,6 +258,31 @@ | |||
420 | 268 | window_buttons_->QueueDraw(); | 258 | window_buttons_->QueueDraw(); |
421 | 269 | } | 259 | } |
422 | 270 | 260 | ||
423 | 261 | void PanelMenuView::OnLIMChanged(bool lim) | ||
424 | 262 | { | ||
425 | 263 | integrated_menus_ = lim; | ||
426 | 264 | new_application_ = nullptr; | ||
427 | 265 | |||
428 | 266 | if (!integrated_menus_) | ||
429 | 267 | { | ||
430 | 268 | CheckMouseInside(); | ||
431 | 269 | window_buttons_->focused = true; | ||
432 | 270 | } | ||
433 | 271 | |||
434 | 272 | Refresh(true); | ||
435 | 273 | FullRedraw(); | ||
436 | 274 | } | ||
437 | 275 | |||
438 | 276 | void PanelMenuView::OnAlwaysShowMenusChanged(bool always_show_menus) | ||
439 | 277 | { | ||
440 | 278 | always_show_menus_ = always_show_menus; | ||
441 | 279 | |||
442 | 280 | if (!always_show_menus_) | ||
443 | 281 | CheckMouseInside(); | ||
444 | 282 | |||
445 | 283 | FullRedraw(); | ||
446 | 284 | } | ||
447 | 285 | |||
448 | 271 | nux::Area* PanelMenuView::FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type) | 286 | nux::Area* PanelMenuView::FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type) |
449 | 272 | { | 287 | { |
450 | 273 | bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type); | 288 | bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type); |
451 | @@ -376,7 +391,7 @@ | |||
452 | 376 | 391 | ||
453 | 377 | if (!wm.IsExpoActive() && !wm.IsScaleActive()) | 392 | if (!wm.IsExpoActive() && !wm.IsScaleActive()) |
454 | 378 | { | 393 | { |
456 | 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_) |
457 | 380 | return true; | 395 | return true; |
458 | 381 | 396 | ||
459 | 382 | if (is_maximized_) | 397 | if (is_maximized_) |
460 | @@ -404,7 +419,7 @@ | |||
461 | 404 | { | 419 | { |
462 | 405 | if (!WindowManager::Default().IsExpoActive()) | 420 | if (!WindowManager::Default().IsExpoActive()) |
463 | 406 | { | 421 | { |
465 | 407 | if (is_inside_ || show_now_activated_ || new_application_) | 422 | if (is_inside_ || show_now_activated_ || new_application_ || always_show_menus_) |
466 | 408 | return true; | 423 | return true; |
467 | 409 | 424 | ||
468 | 410 | if (window_buttons_->IsMouseOwner() || titlebar_grab_area_->IsMouseOwner()) | 425 | if (window_buttons_->IsMouseOwner() || titlebar_grab_area_->IsMouseOwner()) |
469 | @@ -848,6 +863,9 @@ | |||
470 | 848 | 863 | ||
471 | 849 | std::string PanelMenuView::GetCurrentTitle() const | 864 | std::string PanelMenuView::GetCurrentTitle() const |
472 | 850 | { | 865 | { |
473 | 866 | if (always_show_menus_ && is_maximized_ && we_control_active_) | ||
474 | 867 | return std::string(); | ||
475 | 868 | |||
476 | 851 | if (integrated_menus_ || (!switcher_showing_ && !launcher_keynav_)) | 869 | if (integrated_menus_ || (!switcher_showing_ && !launcher_keynav_)) |
477 | 852 | { | 870 | { |
478 | 853 | std::string new_title; | 871 | std::string new_title; |
479 | @@ -958,14 +976,10 @@ | |||
480 | 958 | 976 | ||
481 | 959 | if (!integrated_menus_ || is_maximized_) | 977 | if (!integrated_menus_ || is_maximized_) |
482 | 960 | { | 978 | { |
485 | 961 | auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord(); | 979 | bool was_inside = is_inside_; |
484 | 962 | bool inside = GetAbsoluteGeometry().IsInside(mouse); | ||
486 | 963 | 980 | ||
490 | 964 | if (is_inside_ != inside) | 981 | if (CheckMouseInside() != was_inside) |
488 | 965 | { | ||
489 | 966 | is_inside_ = inside; | ||
491 | 967 | QueueDraw(); | 982 | QueueDraw(); |
492 | 968 | } | ||
493 | 969 | } | 983 | } |
494 | 970 | } | 984 | } |
495 | 971 | 985 | ||
496 | @@ -1065,7 +1079,7 @@ | |||
497 | 1065 | app_name_changed_signal_.Connect(BAMF_VIEW(new_app), "name-changed", | 1079 | app_name_changed_signal_.Connect(BAMF_VIEW(new_app), "name-changed", |
498 | 1066 | sigc::mem_fun(this, &PanelMenuView::OnNameChanged)); | 1080 | sigc::mem_fun(this, &PanelMenuView::OnNameChanged)); |
499 | 1067 | 1081 | ||
501 | 1068 | if (integrated_menus_) | 1082 | if (integrated_menus_ || always_show_menus_) |
502 | 1069 | return; | 1083 | return; |
503 | 1070 | 1084 | ||
504 | 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()) |
505 | @@ -1263,8 +1277,7 @@ | |||
506 | 1263 | maximized_wins_.push_front(xid); | 1277 | maximized_wins_.push_front(xid); |
507 | 1264 | 1278 | ||
508 | 1265 | // We need to update the is_inside_ state in the case of maximization by grab | 1279 | // We need to update the is_inside_ state in the case of maximization by grab |
511 | 1266 | auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord(); | 1280 | CheckMouseInside(); |
510 | 1267 | is_inside_ = GetAbsoluteGeometry().IsInside(mouse); | ||
512 | 1268 | is_maximized_ = true; | 1281 | is_maximized_ = true; |
513 | 1269 | 1282 | ||
514 | 1270 | if (Refresh()) | 1283 | if (Refresh()) |
515 | @@ -1674,6 +1687,7 @@ | |||
516 | 1674 | 1687 | ||
517 | 1675 | introspection | 1688 | introspection |
518 | 1676 | .add("mouse_inside", is_inside_) | 1689 | .add("mouse_inside", is_inside_) |
519 | 1690 | .add("always_show_menus", always_show_menus_) | ||
520 | 1677 | .add("grabbed", is_grabbed_) | 1691 | .add("grabbed", is_grabbed_) |
521 | 1678 | .add("active_win_maximized", is_maximized_) | 1692 | .add("active_win_maximized", is_maximized_) |
522 | 1679 | .add("active_win_is_desktop", is_desktop_focused_) | 1693 | .add("active_win_is_desktop", is_desktop_focused_) |
523 | @@ -1695,7 +1709,7 @@ | |||
524 | 1695 | 1709 | ||
525 | 1696 | void PanelMenuView::OnSwitcherShown(GVariant* data) | 1710 | void PanelMenuView::OnSwitcherShown(GVariant* data) |
526 | 1697 | { | 1711 | { |
528 | 1698 | if (!data || integrated_menus_) | 1712 | if (!data || integrated_menus_ || always_show_menus_) |
529 | 1699 | return; | 1713 | return; |
530 | 1700 | 1714 | ||
531 | 1701 | gboolean switcher_shown; | 1715 | gboolean switcher_shown; |
532 | @@ -1709,8 +1723,7 @@ | |||
533 | 1709 | 1723 | ||
534 | 1710 | if (!switcher_showing_) | 1724 | if (!switcher_showing_) |
535 | 1711 | { | 1725 | { |
538 | 1712 | auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord(); | 1726 | CheckMouseInside(); |
537 | 1713 | is_inside_ = GetAbsoluteGeometry().IsInside(mouse); | ||
539 | 1714 | } | 1727 | } |
540 | 1715 | else | 1728 | else |
541 | 1716 | { | 1729 | { |
542 | @@ -1738,9 +1751,7 @@ | |||
543 | 1738 | return; | 1751 | return; |
544 | 1739 | 1752 | ||
545 | 1740 | launcher_keynav_ = false; | 1753 | launcher_keynav_ = false; |
549 | 1741 | 1754 | CheckMouseInside(); | |
547 | 1742 | auto mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord(); | ||
548 | 1743 | is_inside_ = GetAbsoluteGeometry().IsInside(mouse); | ||
550 | 1744 | 1755 | ||
551 | 1745 | if (Refresh()) | 1756 | if (Refresh()) |
552 | 1746 | QueueDraw(); | 1757 | QueueDraw(); |
553 | @@ -1866,8 +1877,22 @@ | |||
554 | 1866 | return we_control_active_; | 1877 | return we_control_active_; |
555 | 1867 | } | 1878 | } |
556 | 1868 | 1879 | ||
557 | 1880 | bool PanelMenuView::CheckMouseInside() | ||
558 | 1881 | { | ||
559 | 1882 | if (always_show_menus_) | ||
560 | 1883 | return is_inside_; | ||
561 | 1884 | |||
562 | 1885 | auto const& mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord(); | ||
563 | 1886 | is_inside_ = GetAbsoluteGeometry().IsInside(mouse); | ||
564 | 1887 | |||
565 | 1888 | return is_inside_; | ||
566 | 1889 | } | ||
567 | 1890 | |||
568 | 1869 | void PanelMenuView::OnPanelViewMouseEnter(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state) | 1891 | void PanelMenuView::OnPanelViewMouseEnter(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state) |
569 | 1870 | { | 1892 | { |
570 | 1893 | if (always_show_menus_) | ||
571 | 1894 | return; | ||
572 | 1895 | |||
573 | 1871 | if (!is_inside_) | 1896 | if (!is_inside_) |
574 | 1872 | { | 1897 | { |
575 | 1873 | if (is_grabbed_) | 1898 | if (is_grabbed_) |
576 | @@ -1881,6 +1906,9 @@ | |||
577 | 1881 | 1906 | ||
578 | 1882 | void PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state) | 1907 | void PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state) |
579 | 1883 | { | 1908 | { |
580 | 1909 | if (always_show_menus_) | ||
581 | 1910 | return; | ||
582 | 1911 | |||
583 | 1884 | if (is_inside_) | 1912 | if (is_inside_) |
584 | 1885 | { | 1913 | { |
585 | 1886 | is_inside_ = false; | 1914 | is_inside_ = false; |
586 | @@ -1890,6 +1918,9 @@ | |||
587 | 1890 | 1918 | ||
588 | 1891 | void PanelMenuView::SetMousePosition(int x, int y) | 1919 | void PanelMenuView::SetMousePosition(int x, int y) |
589 | 1892 | { | 1920 | { |
590 | 1921 | if (always_show_menus_) | ||
591 | 1922 | return; | ||
592 | 1923 | |||
593 | 1893 | if (last_active_view_ || | 1924 | if (last_active_view_ || |
594 | 1894 | (x >= 0 && y >= 0 && GetAbsoluteGeometry().IsPointInside(x, y))) | 1925 | (x >= 0 && y >= 0 && GetAbsoluteGeometry().IsPointInside(x, y))) |
595 | 1895 | { | 1926 | { |
596 | 1896 | 1927 | ||
597 | === modified file 'panel/PanelMenuView.h' | |||
598 | --- panel/PanelMenuView.h 2014-10-23 21:37:23 +0000 | |||
599 | +++ panel/PanelMenuView.h 2015-01-15 14:44:53 +0000 | |||
600 | @@ -91,6 +91,8 @@ | |||
601 | 91 | void OnActiveAppChanged(BamfMatcher* matcher, BamfApplication* old_app, BamfApplication* new_app); | 91 | void OnActiveAppChanged(BamfMatcher* matcher, BamfApplication* old_app, BamfApplication* new_app); |
602 | 92 | void OnNameChanged(BamfView* bamf_view, gchar* new_name, gchar* old_name); | 92 | void OnNameChanged(BamfView* bamf_view, gchar* new_name, gchar* old_name); |
603 | 93 | void OnStyleChanged(); | 93 | void OnStyleChanged(); |
604 | 94 | void OnLIMChanged(bool); | ||
605 | 95 | void OnAlwaysShowMenusChanged(bool); | ||
606 | 94 | 96 | ||
607 | 95 | void OnSpreadInitiate(); | 97 | void OnSpreadInitiate(); |
608 | 96 | void OnSpreadTerminate(); | 98 | void OnSpreadTerminate(); |
609 | @@ -133,6 +135,7 @@ | |||
610 | 133 | void OnLauncherSelectionChanged(GVariant* data); | 135 | void OnLauncherSelectionChanged(GVariant* data); |
611 | 134 | 136 | ||
612 | 135 | void UpdateShowNow(bool ignore); | 137 | void UpdateShowNow(bool ignore); |
613 | 138 | bool CheckMouseInside(); | ||
614 | 136 | 139 | ||
615 | 137 | bool UpdateActiveWindowPosition(); | 140 | bool UpdateActiveWindowPosition(); |
616 | 138 | bool UpdateShowNowWithDelay(); | 141 | bool UpdateShowNowWithDelay(); |
617 | @@ -185,6 +188,7 @@ | |||
618 | 185 | bool new_app_menu_shown_; | 188 | bool new_app_menu_shown_; |
619 | 186 | bool ignore_menu_visibility_; | 189 | bool ignore_menu_visibility_; |
620 | 187 | bool integrated_menus_; | 190 | bool integrated_menus_; |
621 | 191 | bool always_show_menus_; | ||
622 | 188 | 192 | ||
623 | 189 | Window active_xid_; | 193 | Window active_xid_; |
624 | 190 | nux::Geometry monitor_geo_; | 194 | nux::Geometry monitor_geo_; |
625 | @@ -196,7 +200,6 @@ | |||
626 | 196 | glib::Signal<void, BamfMatcher*, BamfApplication*, BamfApplication*> active_app_changed_signal_; | 200 | glib::Signal<void, BamfMatcher*, BamfApplication*, BamfApplication*> active_app_changed_signal_; |
627 | 197 | glib::Signal<void, BamfView*, gchar*, gchar*> view_name_changed_signal_; | 201 | glib::Signal<void, BamfView*, gchar*, gchar*> view_name_changed_signal_; |
628 | 198 | glib::Signal<void, BamfView*, gchar*, gchar*> app_name_changed_signal_; | 202 | glib::Signal<void, BamfView*, gchar*, gchar*> app_name_changed_signal_; |
629 | 199 | connection::Wrapper lim_changed_connection_; | ||
630 | 200 | 203 | ||
631 | 201 | UBusManager ubus_manager_; | 204 | UBusManager ubus_manager_; |
632 | 202 | glib::SourceManager sources_; | 205 | glib::SourceManager sources_; |
633 | 203 | 206 | ||
634 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
635 | --- plugins/unityshell/src/unityshell.cpp 2014-12-20 03:12:15 +0000 | |||
636 | +++ plugins/unityshell/src/unityshell.cpp 2015-01-15 14:44:53 +0000 | |||
637 | @@ -3041,7 +3041,7 @@ | |||
638 | 3041 | } | 3041 | } |
639 | 3042 | } | 3042 | } |
640 | 3043 | } | 3043 | } |
642 | 3044 | else if (decoration::Style::Get()->integrated_menus()) | 3044 | else if (uScreen->menus_->integrated_menus()) |
643 | 3045 | { | 3045 | { |
644 | 3046 | draw_panel_shadow = DrawPanelShadow::BELOW_WINDOW; | 3046 | draw_panel_shadow = DrawPanelShadow::BELOW_WINDOW; |
645 | 3047 | } | 3047 | } |
646 | 3048 | 3048 | ||
647 | === modified file 'unity-shared/DecorationStyle.cpp' | |||
648 | --- unity-shared/DecorationStyle.cpp 2014-08-07 13:15:17 +0000 | |||
649 | +++ unity-shared/DecorationStyle.cpp 2015-01-15 14:44:53 +0000 | |||
650 | @@ -157,7 +157,6 @@ | |||
651 | 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()); |
652 | 158 | gtk_style_context_set_path(ctx_, widget_path.get()); | 158 | gtk_style_context_set_path(ctx_, widget_path.get()); |
653 | 159 | 159 | ||
654 | 160 | parent_->integrated_menus = false; | ||
655 | 161 | parent_->theme = glib::String(GetSettingValue<gchar*>("gtk-theme-name")).Str(); | 160 | parent_->theme = glib::String(GetSettingValue<gchar*>("gtk-theme-name")).Str(); |
656 | 162 | parent_->font = glib::String(GetSettingValue<gchar*>("gtk-font-name")).Str(); | 161 | parent_->font = glib::String(GetSettingValue<gchar*>("gtk-font-name")).Str(); |
657 | 163 | parent_->font_scale = 1.0; | 162 | parent_->font_scale = 1.0; |
658 | 164 | 163 | ||
659 | === modified file 'unity-shared/DecorationStyle.h' | |||
660 | --- unity-shared/DecorationStyle.h 2014-04-02 17:05:04 +0000 | |||
661 | +++ unity-shared/DecorationStyle.h 2015-01-15 14:44:53 +0000 | |||
662 | @@ -118,7 +118,6 @@ | |||
663 | 118 | nux::Property<std::string> theme; | 118 | nux::Property<std::string> theme; |
664 | 119 | nux::Property<std::string> font; | 119 | nux::Property<std::string> font; |
665 | 120 | nux::Property<std::string> title_font; | 120 | nux::Property<std::string> title_font; |
666 | 121 | nux::Property<bool> integrated_menus; | ||
667 | 122 | nux::Property<unsigned> grab_wait; | 121 | nux::Property<unsigned> grab_wait; |
668 | 123 | nux::Property<double> font_scale; | 122 | nux::Property<double> font_scale; |
669 | 124 | 123 | ||
670 | 125 | 124 | ||
671 | === modified file 'unity-shared/MenuManager.cpp' | |||
672 | --- unity-shared/MenuManager.cpp 2014-03-05 14:17:43 +0000 | |||
673 | +++ unity-shared/MenuManager.cpp 2015-01-15 14:44:53 +0000 | |||
674 | @@ -20,6 +20,7 @@ | |||
675 | 20 | 20 | ||
676 | 21 | #include <gtk/gtk.h> | 21 | #include <gtk/gtk.h> |
677 | 22 | #include <NuxCore/Logger.h> | 22 | #include <NuxCore/Logger.h> |
678 | 23 | #include <UnityCore/GLibSignal.h> | ||
679 | 23 | #include <UnityCore/GLibWrapper.h> | 24 | #include <UnityCore/GLibWrapper.h> |
680 | 24 | #include <UnityCore/DBusIndicators.h> | 25 | #include <UnityCore/DBusIndicators.h> |
681 | 25 | #include <unordered_map> | 26 | #include <unordered_map> |
682 | @@ -30,8 +31,15 @@ | |||
683 | 30 | { | 31 | { |
684 | 31 | namespace menu | 32 | namespace menu |
685 | 32 | { | 33 | { |
686 | 34 | namespace | ||
687 | 35 | { | ||
688 | 33 | DECLARE_LOGGER(logger, "unity.menu.manager"); | 36 | DECLARE_LOGGER(logger, "unity.menu.manager"); |
689 | 34 | 37 | ||
690 | 38 | const std::string SETTINGS_NAME = "com.canonical.Unity"; | ||
691 | 39 | const std::string LIM_KEY = "integrated-menus"; | ||
692 | 40 | const std::string ALWAYS_SHOW_MENUS_KEY = "always-show-menus"; | ||
693 | 41 | } | ||
694 | 42 | |||
695 | 35 | using namespace indicator; | 43 | using namespace indicator; |
696 | 36 | 44 | ||
697 | 37 | struct Manager::Impl : sigc::trackable | 45 | struct Manager::Impl : sigc::trackable |
698 | @@ -40,6 +48,7 @@ | |||
699 | 40 | : parent_(parent) | 48 | : parent_(parent) |
700 | 41 | , indicators_(indicators) | 49 | , indicators_(indicators) |
701 | 42 | , key_grabber_(grabber) | 50 | , key_grabber_(grabber) |
702 | 51 | , settings_(g_settings_new(SETTINGS_NAME.c_str())) | ||
703 | 43 | { | 52 | { |
704 | 44 | for (auto const& indicator : indicators_->GetIndicators()) | 53 | for (auto const& indicator : indicators_->GetIndicators()) |
705 | 45 | AddIndicator(indicator); | 54 | AddIndicator(indicator); |
706 | @@ -49,6 +58,16 @@ | |||
707 | 49 | indicators_->on_object_removed.connect(sigc::mem_fun(this, &Impl::RemoveIndicator)); | 58 | indicators_->on_object_removed.connect(sigc::mem_fun(this, &Impl::RemoveIndicator)); |
708 | 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)); |
709 | 51 | indicators_->icon_paths_changed.connect(sigc::mem_fun(this, &Impl::IconPathsChanged)); | 60 | indicators_->icon_paths_changed.connect(sigc::mem_fun(this, &Impl::IconPathsChanged)); |
710 | 61 | |||
711 | 62 | parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str()); | ||
712 | 63 | parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str()); | ||
713 | 64 | |||
714 | 65 | signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + LIM_KEY, [this] (GSettings*, const gchar*) { | ||
715 | 66 | parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str()); | ||
716 | 67 | }); | ||
717 | 68 | signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + ALWAYS_SHOW_MENUS_KEY, [this] (GSettings*, const gchar*) { | ||
718 | 69 | parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str()); | ||
719 | 70 | }); | ||
720 | 52 | } | 71 | } |
721 | 53 | 72 | ||
722 | 54 | ~Impl() | 73 | ~Impl() |
723 | @@ -63,7 +82,7 @@ | |||
724 | 63 | return; | 82 | return; |
725 | 64 | 83 | ||
726 | 65 | appmenu_connections_.Clear(); | 84 | appmenu_connections_.Clear(); |
728 | 66 | appmenu_ = indicator; | 85 | appmenu_ = std::static_pointer_cast<AppmenuIndicator>(indicator); |
729 | 67 | 86 | ||
730 | 68 | for (auto const& entry : appmenu_->GetEntries()) | 87 | for (auto const& entry : appmenu_->GetEntries()) |
731 | 69 | GrabEntryMnemonics(entry); | 88 | GrabEntryMnemonics(entry); |
732 | @@ -149,14 +168,18 @@ | |||
733 | 149 | 168 | ||
734 | 150 | Manager* parent_; | 169 | Manager* parent_; |
735 | 151 | Indicators::Ptr indicators_; | 170 | Indicators::Ptr indicators_; |
737 | 152 | Indicator::Ptr appmenu_; | 171 | AppmenuIndicator::Ptr appmenu_; |
738 | 153 | key::Grabber::Ptr key_grabber_; | 172 | key::Grabber::Ptr key_grabber_; |
739 | 154 | connection::Manager appmenu_connections_; | 173 | connection::Manager appmenu_connections_; |
740 | 174 | glib::Object<GSettings> settings_; | ||
741 | 175 | glib::SignalManager signals_; | ||
742 | 155 | std::unordered_map<std::string, std::shared_ptr<CompAction>> entry_actions_; | 176 | std::unordered_map<std::string, std::shared_ptr<CompAction>> entry_actions_; |
743 | 156 | }; | 177 | }; |
744 | 157 | 178 | ||
745 | 158 | Manager::Manager(Indicators::Ptr const& indicators, key::Grabber::Ptr const& grabber) | 179 | Manager::Manager(Indicators::Ptr const& indicators, key::Grabber::Ptr const& grabber) |
747 | 159 | : show_menus_wait(180) | 180 | : integrated_menus(false) |
748 | 181 | , show_menus_wait(180) | ||
749 | 182 | , always_show_menus(false) | ||
750 | 160 | , fadein(100) | 183 | , fadein(100) |
751 | 161 | , fadeout(120) | 184 | , fadeout(120) |
752 | 162 | , discovery(2) | 185 | , discovery(2) |
753 | @@ -178,7 +201,7 @@ | |||
754 | 178 | return impl_->indicators_; | 201 | return impl_->indicators_; |
755 | 179 | } | 202 | } |
756 | 180 | 203 | ||
758 | 181 | Indicator::Ptr const& Manager::AppMenu() const | 204 | AppmenuIndicator::Ptr const& Manager::AppMenu() const |
759 | 182 | { | 205 | { |
760 | 183 | return impl_->appmenu_; | 206 | return impl_->appmenu_; |
761 | 184 | } | 207 | } |
762 | 185 | 208 | ||
763 | === modified file 'unity-shared/MenuManager.h' | |||
764 | --- unity-shared/MenuManager.h 2014-02-13 05:47:03 +0000 | |||
765 | +++ unity-shared/MenuManager.h 2015-01-15 14:44:53 +0000 | |||
766 | @@ -22,6 +22,7 @@ | |||
767 | 22 | 22 | ||
768 | 23 | #include <NuxCore/Property.h> | 23 | #include <NuxCore/Property.h> |
769 | 24 | #include <UnityCore/Indicators.h> | 24 | #include <UnityCore/Indicators.h> |
770 | 25 | #include <UnityCore/AppmenuIndicator.h> | ||
771 | 25 | #include "KeyGrabber.h" | 26 | #include "KeyGrabber.h" |
772 | 26 | 27 | ||
773 | 27 | namespace unity | 28 | namespace unity |
774 | @@ -45,7 +46,10 @@ | |||
775 | 45 | typedef std::shared_ptr<Manager> Ptr; | 46 | typedef std::shared_ptr<Manager> Ptr; |
776 | 46 | 47 | ||
777 | 47 | nux::Property<bool> show_menus; | 48 | nux::Property<bool> show_menus; |
778 | 49 | |||
779 | 50 | nux::Property<bool> integrated_menus; | ||
780 | 48 | nux::Property<unsigned> show_menus_wait; | 51 | nux::Property<unsigned> show_menus_wait; |
781 | 52 | nux::Property<bool> always_show_menus; | ||
782 | 49 | 53 | ||
783 | 50 | nux::Property<unsigned> fadein; | 54 | nux::Property<unsigned> fadein; |
784 | 51 | nux::Property<unsigned> fadeout; | 55 | nux::Property<unsigned> fadeout; |
785 | @@ -58,7 +62,7 @@ | |||
786 | 58 | 62 | ||
787 | 59 | bool HasAppMenu() const; | 63 | bool HasAppMenu() const; |
788 | 60 | indicator::Indicators::Ptr const& Indicators() const; | 64 | indicator::Indicators::Ptr const& Indicators() const; |
790 | 61 | indicator::Indicator::Ptr const& AppMenu() const; | 65 | indicator::AppmenuIndicator::Ptr const& AppMenu() const; |
791 | 62 | 66 | ||
792 | 63 | key::Grabber::Ptr const& KeyGrabber() const; | 67 | key::Grabber::Ptr const& KeyGrabber() const; |
793 | 64 | 68 | ||
794 | 65 | 69 | ||
795 | === modified file 'unity-shared/UScreen.cpp' | |||
796 | --- unity-shared/UScreen.cpp 2014-11-28 12:56:12 +0000 | |||
797 | +++ unity-shared/UScreen.cpp 2015-01-15 14:44:53 +0000 | |||
798 | @@ -74,13 +74,10 @@ | |||
799 | 74 | 74 | ||
800 | 75 | int UScreen::GetMonitorAtPosition(int x, int y) const | 75 | int UScreen::GetMonitorAtPosition(int x, int y) const |
801 | 76 | { | 76 | { |
805 | 77 | int idx = 0; | 77 | for (unsigned i = 0; i < monitors_.size(); ++i) |
803 | 78 | |||
804 | 79 | for (auto const& monitor : monitors_) | ||
806 | 80 | { | 78 | { |
810 | 81 | if (monitor.IsPointInside(x, y)) | 79 | if (monitors_[i].IsPointInside(x, y)) |
811 | 82 | return idx; | 80 | return i; |
809 | 83 | ++idx; | ||
812 | 84 | } | 81 | } |
813 | 85 | 82 | ||
814 | 86 | return gdk_screen_get_monitor_at_point(screen_, x, y); | 83 | return gdk_screen_get_monitor_at_point(screen_, x, y); |
815 | 87 | 84 | ||
816 | === modified file 'unity-shared/UnitySettings.cpp' | |||
817 | --- unity-shared/UnitySettings.cpp 2014-09-04 16:47:13 +0000 | |||
818 | +++ unity-shared/UnitySettings.cpp 2015-01-15 14:44:53 +0000 | |||
819 | @@ -38,7 +38,6 @@ | |||
820 | 38 | const std::string SETTINGS_NAME = "com.canonical.Unity"; | 38 | const std::string SETTINGS_NAME = "com.canonical.Unity"; |
821 | 39 | const std::string FORM_FACTOR = "form-factor"; | 39 | const std::string FORM_FACTOR = "form-factor"; |
822 | 40 | const std::string DOUBLE_CLICK_ACTIVATE = "double-click-activate"; | 40 | const std::string DOUBLE_CLICK_ACTIVATE = "double-click-activate"; |
823 | 41 | const std::string LIM_KEY = "integrated-menus"; | ||
824 | 42 | 41 | ||
825 | 43 | const std::string LIM_SETTINGS = "com.canonical.Unity.IntegratedMenus"; | 42 | const std::string LIM_SETTINGS = "com.canonical.Unity.IntegratedMenus"; |
826 | 44 | const std::string CLICK_MOVEMENT_THRESHOLD = "click-movement-threshold"; | 43 | const std::string CLICK_MOVEMENT_THRESHOLD = "click-movement-threshold"; |
827 | @@ -113,10 +112,6 @@ | |||
828 | 113 | parent_->double_click_activate.changed.emit(cached_double_click_activate_); | 112 | parent_->double_click_activate.changed.emit(cached_double_click_activate_); |
829 | 114 | }); | 113 | }); |
830 | 115 | 114 | ||
831 | 116 | signals_.Add<void, GSettings*, const gchar*>(usettings_, "changed::" + LIM_KEY, [this] (GSettings*, const gchar*) { | ||
832 | 117 | UpdateLimSetting(); | ||
833 | 118 | }); | ||
834 | 119 | |||
835 | 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) { |
836 | 121 | UpdateDPI(); | 116 | UpdateDPI(); |
837 | 122 | }); | 117 | }); |
838 | @@ -190,7 +185,6 @@ | |||
839 | 190 | 185 | ||
840 | 191 | void UpdateLimSetting() | 186 | void UpdateLimSetting() |
841 | 192 | { | 187 | { |
842 | 193 | decoration::Style::Get()->integrated_menus = g_settings_get_boolean(usettings_, LIM_KEY.c_str()); | ||
843 | 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()); |
844 | 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()); |
845 | 196 | } | 190 | } |
FAILED: Continuous integration, rev:3899 jenkins. qa.ubuntu. com/job/ unity-ci/ 1128/ jenkins. qa.ubuntu. com/job/ unity-vivid- amd64-ci/ 15/console jenkins. qa.ubuntu. com/job/ unity-vivid- armhf-ci/ 15/console jenkins. qa.ubuntu. com/job/ unity-vivid- i386-ci/ 15/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- ci/1128/ rebuild
http://