Merge lp:~3v1n0/unity/show-shell-on-menu-open into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Superseded
Proposed branch: lp:~3v1n0/unity/show-shell-on-menu-open
Merge into: lp:unity
Diff against target: 468 lines (+109/-28)
17 files modified
UnityCore/Indicators.cpp (+6/-3)
UnityCore/Indicators.h (+1/-0)
panel/PanelMenuView.cpp (+17/-2)
panel/PanelMenuView.h (+2/-0)
plugins/unityshell/src/unityshell.cpp (+22/-9)
tests/autopilot/unity/emulators/launcher.py (+4/-4)
tests/autopilot/unity/tests/launcher/test_icon_behavior.py (+10/-4)
tests/autopilot/unity/tests/test_panel.py (+2/-2)
tests/test_indicators.cpp (+2/-0)
unity-shared/CompizUtils.cpp (+0/-3)
unity-shared/MenuManager.cpp (+7/-0)
unity-shared/MenuManager.h (+1/-0)
unity-shared/PluginAdapter.cpp (+18/-0)
unity-shared/PluginAdapter.h (+1/-0)
unity-shared/StandaloneWindowManager.cpp (+11/-1)
unity-shared/StandaloneWindowManager.h (+2/-0)
unity-shared/WindowManager.h (+3/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/show-shell-on-menu-open
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Christopher Townsend Approve
Review via email: mp+261368@code.launchpad.net

This proposal has been superseded by a proposal from 2015-09-10.

Commit message

UnityScreen: force shell to be on top when there's a window fullscreen and we've a menu open.

This allows to see the panel and control menus properly. Added support for fullscreen
windows to WindowsManager, in order to handle properly the LIM mode.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

This breaks many AP tests:

unity.tests.test_panel.PanelHoverTests.test_hovering_indicators_open_menus(Single Monitor,Global Menus)
unity.tests.test_wm_keybindings.WindowManagerKeybindingsForWindowHandling.test_minimize_restored_window(Restored Window)
unity.tests.test_wm_keybindings.WindowManagerKeybindingsForWindowHandling.test_minimize_restored_window(Maximized Window)
unity.tests.test_panel.PanelMenuTests.test_menus_dont_show_if_a_new_application_window_is_opened(Single Monitor,Global Menus)
unity.tests.test_wm_keybindings.WindowManagerKeybindingsForWindowHandling.test_restore_maximized_window(Restored Window)
unity.tests.test_wm_keybindings.WindowManagerKeybindingsForWindowHandling.test_restore_maximized_window(Maximized Window)
unity.tests.test_panel.PanelKeyNavigationTests.test_panel_menu_accelerators_work(Single Monitor,Global Menus)
unity.tests.test_panel.PanelKeyNavigationTests.test_panel_hold_show_menu_works(Single Monitor,Global Menus)
unity.tests.test_wm_keybindings.WindowManagerKeybindingsForWindowHandling.test_restore_vertically_maximized_window(Restored Window)
unity.tests.test_wm_keybindings.WindowManagerKeybindingsForWindowHandling.test_restore_vertically_maximized_window(Maximized Window)
unity.tests.test_panel.PanelIndicatorEntryTests.test_menu_closes_on_new_focused_application(Single Monitor,Locally Integrated Menus)
unity.tests.test_panel.PanelTitleTests.test_panel_title_doesnt_change_with_switcher(Single Monitor,Locally Integrated Menus)
unity.tests.test_panel.PanelTitleTests.test_panel_title_doesnt_change_with_switcher(Single Monitor,Global Menus)
unity.tests.test_switcher.SwitcherWindowsManagementTests.test_switcher_raises_only_last_focused_window(show_desktop_icon_true)
unity.tests.test_switcher.SwitcherWindowsManagementTests.test_switcher_raises_only_last_focused_window(show_desktop_icon_false)

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

So, I've been trying to run these tests again one-by-one, but None failed, except for:

unity.tests.test_panel.PanelIndicatorEntryTests.test_menu_closes_on_new_focused_application

That I've fixed (in LIM mode should behave differently).

unity.tests.test_switcher.SwitcherWindowsManagementTests.test_switcher_raises_only_last_focused_window

Which failed because after some time, it seems that AP stresses the Alt+F4 keybinding too much and compiz gets confused... But I don't see any of these failures to be related to this branch.

Can you please check if the failures were accidental (or provide me more precise logs)?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

New build failures are caused by new gtk in Wily, I'll fix this in a new branch.

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

Actually, upon further investigation and testing, I had the new bamf from the ci-train silo installed, I'm 99% sure this is what is causing the slew of failures.

I'm going to remove that bamf and rebuild and see if it looks better.

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

Ok, this MP is not the culprit of the AP failures, so going to approve.

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

Setting this to WiP since it doesn't compile.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UnityCore/Indicators.cpp'
2--- UnityCore/Indicators.cpp 2015-01-29 18:23:24 +0000
3+++ UnityCore/Indicators.cpp 2015-09-10 12:07:57 +0000
4@@ -27,9 +27,8 @@
5 namespace indicator
6 {
7
8-class Indicators::Impl
9+struct Indicators::Impl
10 {
11-public:
12 typedef std::unordered_map<std::string, Indicator::Ptr> IndicatorMap;
13
14 Impl(Indicators* owner)
15@@ -49,7 +48,6 @@
16
17 Entry::Ptr GetEntry(std::string const& entry_id);
18
19-private:
20 Indicators* owner_;
21 IndicatorMap indicators_;
22 Entry::Ptr active_entry_;
23@@ -93,6 +91,11 @@
24 return pimpl->RemoveIndicator(name);
25 }
26
27+Entry::Ptr const& Indicators::GetActiveEntry() const
28+{
29+ return pimpl->active_entry_;
30+}
31+
32 void Indicators::Impl::ActivateEntry(std::string const& panel, std::string const& entry_id, nux::Rect const& geometry)
33 {
34 if (active_entry_)
35
36=== modified file 'UnityCore/Indicators.h'
37--- UnityCore/Indicators.h 2014-09-19 18:48:04 +0000
38+++ UnityCore/Indicators.h 2015-09-10 12:07:57 +0000
39@@ -40,6 +40,7 @@
40 virtual ~Indicators();
41
42 IndicatorsList GetIndicators() const;
43+ Entry::Ptr const& GetActiveEntry() const;
44 virtual std::vector<std::string> const& IconPaths() const = 0;
45
46 virtual void SyncGeometries(std::string const& panel, EntryLocationMap const&) = 0;
47
48=== modified file 'panel/PanelMenuView.cpp'
49--- panel/PanelMenuView.cpp 2015-07-07 16:10:29 +0000
50+++ panel/PanelMenuView.cpp 2015-09-10 12:07:57 +0000
51@@ -222,6 +222,8 @@
52 wm.window_unminimized.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnminimized));
53 wm.window_maximized.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMaximized));
54 wm.window_restored.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowRestored));
55+ wm.window_fullscreen.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMaximized));
56+ wm.window_unfullscreen.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnFullscreen));
57 wm.window_unmapped.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnmapped));
58 wm.window_mapped.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMapped));
59 wm.window_moved.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMoved));
60@@ -231,6 +233,7 @@
61 wm.initiate_expo.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));
62 wm.terminate_expo.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));
63 wm.screen_viewport_switch_ended.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));
64+ wm.show_desktop_changed.connect(sigc::mem_fun(this, &PanelMenuView::OnShowDesktopChanged));
65 }
66
67 void PanelMenuView::SetupUBusManagerInterests()
68@@ -1098,7 +1101,8 @@
69 if (new_win)
70 {
71 active_xid = new_win->window_id();
72- is_maximized_ = new_win->maximized();
73+ is_maximized_ = (new_win->maximized() ||
74+ WindowManager::Default().IsWindowFullscreen(active_xid));
75
76 if (new_win->type() == WindowType::DESKTOP)
77 {
78@@ -1254,6 +1258,17 @@
79 }
80 }
81
82+void PanelMenuView::OnWindowUnFullscreen(Window xid)
83+{
84+ if (!WindowManager::Default().IsWindowMaximized(xid))
85+ OnWindowRestored(xid);
86+}
87+
88+void PanelMenuView::OnShowDesktopChanged()
89+{
90+ UpdateMaximizedWindow();
91+}
92+
93 bool PanelMenuView::UpdateActiveWindowPosition()
94 {
95 bool we_control_window = IsWindowUnderOurControl(active_window);
96@@ -1736,7 +1751,7 @@
97 if (win->active())
98 active_window = xid;
99
100- if (win->maximized())
101+ if (win->maximized() || WindowManager::Default().IsWindowFullscreen(xid))
102 {
103 if (win->active())
104 maximized_wins_.push_front(xid);
105
106=== modified file 'panel/PanelMenuView.h'
107--- panel/PanelMenuView.h 2015-07-07 16:10:29 +0000
108+++ panel/PanelMenuView.h 2015-09-10 12:07:57 +0000
109@@ -105,7 +105,9 @@
110 void OnWindowMapped(Window xid);
111 void OnWindowMaximized(Window xid);
112 void OnWindowRestored(Window xid);
113+ void OnWindowUnFullscreen(Window xid);
114 void OnWindowMoved(Window xid);
115+ void OnShowDesktopChanged();
116
117 void OnMaximizedActivate(int x, int y);
118 void OnMaximizedDoubleClicked(int x, int y);
119
120=== modified file 'plugins/unityshell/src/unityshell.cpp'
121--- plugins/unityshell/src/unityshell.cpp 2015-05-22 13:20:44 +0000
122+++ plugins/unityshell/src/unityshell.cpp 2015-09-10 12:07:57 +0000
123@@ -986,14 +986,28 @@
124
125 bool UnityScreen::forcePaintOnTop()
126 {
127- return !allowWindowPaint ||
128- lockscreen_controller_->IsLocked() ||
129- (dash_controller_->IsVisible() && !nux::GetGraphicsDisplay()->PointerIsGrabbed()) ||
130- hud_controller_->IsVisible() ||
131- session_controller_->Visible() ||
132- ((switcher_controller_->Visible() ||
133- WM.IsExpoActive())
134- && !fullscreen_windows_.empty () && (!(screen->grabbed () && !screen->otherGrabExist (NULL))));
135+ if (!allowWindowPaint ||
136+ lockscreen_controller_->IsLocked() ||
137+ (dash_controller_->IsVisible() && !nux::GetGraphicsDisplay()->PointerIsGrabbed()) ||
138+ hud_controller_->IsVisible() ||
139+ session_controller_->Visible())
140+ {
141+ return true;
142+ }
143+
144+ if (!fullscreen_windows_.empty())
145+ {
146+ if (menus_->menu_open())
147+ return true;
148+
149+ if (switcher_controller_->Visible() || WM.IsExpoActive())
150+ {
151+ if (!screen->grabbed() || screen->otherGrabExist(nullptr))
152+ return true;
153+ }
154+ }
155+
156+ return false;
157 }
158
159 void UnityScreen::EnableCancelAction(CancelActionTarget target, bool enabled, int modifiers)
160@@ -1255,7 +1269,6 @@
161
162 window->updateFrameRegionSetCurrentIndex(MAXSHORT);
163 window->updateFrameRegion(region);
164- deco_win_->UpdateFrameRegion(region);
165 window->updateFrameRegionSetCurrentIndex(oldUpdateFrameRegionIndex);
166 }
167
168
169=== modified file 'tests/autopilot/unity/emulators/launcher.py'
170--- tests/autopilot/unity/emulators/launcher.py 2015-08-18 15:07:31 +0000
171+++ tests/autopilot/unity/emulators/launcher.py 2015-09-10 12:07:57 +0000
172@@ -378,11 +378,11 @@
173
174 self.move_mouse_to_icon(icon)
175 self._mouse.press()
176- sleep(2)
177+ sleep(1)
178
179 if drag_type == IconDragType.OUTSIDE:
180 shift_over = self._mouse.x + (icon_height * 2)
181- self._mouse.move(shift_over, self._mouse.y)
182+ self._mouse.move(shift_over, self._mouse.y, rate=20, time_between_events=0.005)
183 sleep(0.5)
184
185 self.move_mouse_to_icon(target)
186@@ -393,8 +393,8 @@
187 if pos == IconDragType.BEFORE:
188 target_y -= icon_height + (icon_height / 2)
189
190- self._mouse.move(self._mouse.x, target_y)
191- sleep(0.5)
192+ self._mouse.move(self._mouse.x, target_y, rate=20, time_between_events=0.005)
193+ sleep(1)
194 self._mouse.release()
195 self.move_mouse_to_right_of_launcher()
196
197
198=== modified file 'tests/autopilot/unity/tests/launcher/test_icon_behavior.py'
199--- tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2015-08-18 10:08:57 +0000
200+++ tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2015-09-10 12:07:57 +0000
201@@ -60,6 +60,11 @@
202 self.assertThat(lambda: self.process_manager.app_is_running("Calculator"), Eventually(Equals(False)))
203 return calc_icon
204
205+ def get_running_application_by_desktop_file(self, desktop_id):
206+ get_app_fn = lambda: self.process_manager.get_running_applications_by_desktop_file(desktop_id)
207+ self.assertThat(lambda: len(get_app_fn()), Eventually(Equals(1)))
208+ return get_app_fn()[0]
209+
210 def test_bfb_tooltip_disappear_when_dash_is_opened(self):
211 """Tests that the bfb tooltip disappear when the dash is opened."""
212 bfb = self.unity.launcher.model.get_bfb_icon()
213@@ -139,7 +144,7 @@
214 self.addCleanup(self.process_manager.close_all_app, "Calculator")
215 self.launcher_instance.click_launcher_icon(calc_icon)
216
217- calc_app = self.process_manager.get_running_applications_by_desktop_file(calc_icon.desktop_id)[0]
218+ calc_app = self.get_running_application_by_desktop_file(calc_icon.desktop_id)
219 calc_window = calc_app.get_windows()[0]
220
221 self.assertThat(lambda: self.get_startup_notification_timestamp(calc_window), Eventually(Equals(calc_icon.startup_notification_timestamp)))
222@@ -197,8 +202,8 @@
223 self.addCleanup(self.launcher_instance.keyboard_unreveal_launcher)
224 self.keyboard.press_and_release("1");
225
226- calc_app = self.process_manager.get_running_applications_by_desktop_file(calc_icon.desktop_id)[0]
227- calc_window = calc_app.get_windows()[0]
228+ calc_app = self.get_running_application_by_desktop_file(calc_icon.desktop_id)
229+ [calc_window] = calc_app.get_windows()
230
231 self.assertThat(lambda: calc_window.is_focused, Eventually(Equals(True)))
232
233@@ -411,7 +416,8 @@
234 self.drag_type)
235
236 # Must be the last bamf icon - not necessarily the third-from-end icon.
237- refresh_fn = lambda: self.unity.launcher.model.get_launcher_icons()[-2].id
238+ expected_pos = -2 if self.workspace.num_workspaces < 2 else -1
239+ refresh_fn = lambda: self.unity.launcher.model.get_launcher_icons()[expected_pos].id
240 self.assertThat(refresh_fn,
241 Eventually(Equals(calc_icon.id)),
242 "Launcher icons are: %r" % self.unity.launcher.model.get_launcher_icons())
243
244=== modified file 'tests/autopilot/unity/tests/test_panel.py'
245--- tests/autopilot/unity/tests/test_panel.py 2015-08-19 11:15:42 +0000
246+++ tests/autopilot/unity/tests/test_panel.py 2015-09-10 12:07:57 +0000
247@@ -1033,7 +1033,7 @@
248 self.assertThat(menu_entry.menu_y, Eventually(Equals(0)))
249
250 def test_menu_closes_on_new_focused_application(self):
251- """Clicking outside an open menu must close it."""
252+ """When a new app is focused, open menu should be closed only when using Global Menus."""
253 menu_entry = self.open_app_and_get_menu_entry()
254 self.mouse_open_indicator(menu_entry)
255
256@@ -1042,7 +1042,7 @@
257
258 self.open_new_application_window("Text Editor")
259 get_active_indicator_fn = lambda: self.unity.panels.get_active_indicator()
260- self.assertThat(get_active_indicator_fn, Eventually(Equals(None)))
261+ self.assertThat(get_active_indicator_fn, Eventually(NotEquals(None) if self.lim else Equals(None)))
262
263 def test_indicator_opens_when_dash_is_open(self):
264 """When the dash is open and a click is on an indicator the dash
265
266=== modified file 'tests/test_indicators.cpp'
267--- tests/test_indicators.cpp 2014-12-19 17:26:43 +0000
268+++ tests/test_indicators.cpp 2015-09-10 12:07:57 +0000
269@@ -216,6 +216,7 @@
270
271 // Activating Entries from the Indicators class to see if they get updated
272 ASSERT_THAT(indicators.GetIndicator("indicator-test-1"), NotNull());
273+ ASSERT_THAT(indicators.GetActiveEntry(), IsNull());
274
275 Entry::Ptr entry12(indicators.GetIndicator("indicator-test-1")->GetEntry("indicator-test-1|entry-2"));
276 ASSERT_THAT(entry12, NotNull());
277@@ -227,6 +228,7 @@
278
279 EXPECT_EQ(entry12->active(), true);
280 EXPECT_EQ(entry12->geometry(), nux::Rect(1, 2, 3, 4));
281+ EXPECT_EQ(indicators.GetActiveEntry(), entry12);
282 }
283
284 TEST_F(TestIndicators, ActivateEntryShouldDisactivatePrevious)
285
286=== modified file 'unity-shared/CompizUtils.cpp'
287--- unity-shared/CompizUtils.cpp 2014-10-22 13:58:46 +0000
288+++ unity-shared/CompizUtils.cpp 2015-09-10 12:07:57 +0000
289@@ -190,9 +190,6 @@
290 if (win->wmType() & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
291 return elements;
292
293- if (win->inShowDesktopMode())
294- return elements;
295-
296 auto const& region = win->region();
297 bool rectangular = (region.numRects() == 1);
298 bool alpha = win->alpha();
299
300=== modified file 'unity-shared/MenuManager.cpp'
301--- unity-shared/MenuManager.cpp 2015-04-20 14:50:48 +0000
302+++ unity-shared/MenuManager.cpp 2015-09-10 12:07:57 +0000
303@@ -61,6 +61,7 @@
304 indicators_->on_object_added.connect(sigc::mem_fun(this, &Impl::AddIndicator));
305 indicators_->on_object_removed.connect(sigc::mem_fun(this, &Impl::RemoveIndicator));
306 indicators_->on_entry_activate_request.connect(sigc::mem_fun(this, &Impl::ActivateRequest));
307+ indicators_->on_entry_activated.connect(sigc::mem_fun(this, &Impl::EntryActivated));
308 indicators_->icon_paths_changed.connect(sigc::mem_fun(this, &Impl::IconPathsChanged));
309 WindowManager::Default().window_focus_changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::GrabMnemonicsForActiveWindow)));
310
311@@ -73,6 +74,7 @@
312
313 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());
314 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());
315+ parent_->menu_open = indicators_->GetActiveEntry() != nullptr;
316 }
317
318 ~Impl()
319@@ -175,6 +177,11 @@
320 parent_->key_activate_entry.emit(entry_id);
321 }
322
323+ void EntryActivated(std::string const&, std::string const&, nux::Rect const& geo)
324+ {
325+ parent_->menu_open = !geo.IsNull();
326+ }
327+
328 void SetShowNowForWindow(Window xid, bool show)
329 {
330 if (!appmenu_)
331
332=== modified file 'unity-shared/MenuManager.h'
333--- unity-shared/MenuManager.h 2014-12-19 13:03:44 +0000
334+++ unity-shared/MenuManager.h 2015-09-10 12:07:57 +0000
335@@ -46,6 +46,7 @@
336 typedef std::shared_ptr<Manager> Ptr;
337
338 nux::Property<bool> show_menus;
339+ nux::Property<bool> menu_open;
340
341 nux::Property<bool> integrated_menus;
342 nux::Property<unsigned> show_menus_wait;
343
344=== modified file 'unity-shared/PluginAdapter.cpp'
345--- unity-shared/PluginAdapter.cpp 2015-05-29 12:30:36 +0000
346+++ unity-shared/PluginAdapter.cpp 2015-09-10 12:07:57 +0000
347@@ -145,6 +145,16 @@
348 {
349 window_restored.emit(window->id());
350 }
351+
352+ if ((state & CompWindowStateFullscreenMask) == CompWindowStateFullscreenMask)
353+ {
354+ window_fullscreen.emit(window->id());
355+ }
356+ else if (((last_state & CompWindowStateFullscreenMask) == CompWindowStateFullscreenMask) &&
357+ !((state & CompWindowStateFullscreenMask) == CompWindowStateFullscreenMask))
358+ {
359+ window_unfullscreen.emit(window->id());
360+ }
361 }
362
363 void PluginAdapter::Notify(CompWindow* window, CompWindowNotify notify)
364@@ -530,6 +540,14 @@
365 return false;
366 }
367
368+bool PluginAdapter::IsWindowFullscreen(Window window_id) const
369+{
370+ if (CompWindow* window = m_Screen->findWindow(window_id))
371+ return ((window->state() & CompWindowStateFullscreenMask) == CompWindowStateFullscreenMask);
372+
373+ return false;
374+}
375+
376 bool PluginAdapter::HasWindowDecorations(Window window_id) const
377 {
378 return compiz_utils::IsWindowFullyDecorable(m_Screen->findWindow(window_id));
379
380=== modified file 'unity-shared/PluginAdapter.h'
381--- unity-shared/PluginAdapter.h 2015-02-03 09:46:48 +0000
382+++ unity-shared/PluginAdapter.h 2015-09-10 12:07:57 +0000
383@@ -122,6 +122,7 @@
384 bool IsWindowMaximized(Window window_id) const;
385 bool IsWindowVerticallyMaximized(Window window_id) const;
386 bool IsWindowHorizontallyMaximized(Window window_id) const;
387+ bool IsWindowFullscreen(Window window_id) const;
388 bool IsWindowDecorated(Window window_id) const;
389 bool IsWindowOnCurrentDesktop(Window window_id) const;
390 bool IsWindowObscured(Window window_id) const;
391
392=== modified file 'unity-shared/StandaloneWindowManager.cpp'
393--- unity-shared/StandaloneWindowManager.cpp 2015-02-27 15:38:11 +0000
394+++ unity-shared/StandaloneWindowManager.cpp 2015-09-10 12:07:57 +0000
395@@ -128,7 +128,7 @@
396
397 return ret;
398 }
399-
400+
401 int StandaloneWindowManager::MonitorGeometryIn(nux::Geometry const& geo) const
402 {
403 // TODO
404@@ -168,6 +168,15 @@
405 return false;
406 }
407
408+bool StandaloneWindowManager::IsWindowFullscreen(Window window_id) const
409+{
410+ auto window = GetWindowByXid(window_id);
411+ if (window)
412+ return window->fullscreen;
413+
414+ return false;
415+}
416+
417 bool StandaloneWindowManager::IsWindowDecorated(Window window_id) const
418 {
419 auto window = GetWindowByXid(window_id);
420@@ -708,6 +717,7 @@
421 window->visible.changed.connect([this, xid] (bool v) {v ? window_shown(xid) : window_hidden(xid);});
422 window->maximized.changed.connect([this, xid] (bool v) {v ? window_maximized(xid) : window_restored(xid);});
423 window->minimized.changed.connect([this, xid] (bool v) {v ? window_minimized(xid) : window_unminimized(xid);});
424+ window->fullscreen.changed.connect([this, xid] (bool v) {v ? window_fullscreen(xid) : window_unfullscreen(xid);});
425 window->geo.changed.connect([this, xid] (nux::Geometry const&) { window_resized(xid); window_moved(xid); });
426 window->resized.connect([this, xid] { window_resized(xid); });
427 window->moved.connect([this, xid] { window_moved(xid); });
428
429=== modified file 'unity-shared/StandaloneWindowManager.h'
430--- unity-shared/StandaloneWindowManager.h 2015-01-21 15:28:59 +0000
431+++ unity-shared/StandaloneWindowManager.h 2015-09-10 12:07:57 +0000
432@@ -51,6 +51,7 @@
433 nux::RWProperty<bool> maximized;
434 nux::Property<bool> v_maximized;
435 nux::Property<bool> h_maximized;
436+ nux::Property<bool> fullscreen;
437 nux::Property<bool> minimized;
438 nux::Property<bool> shaded;
439 nux::Property<bool> decorated;
440@@ -78,6 +79,7 @@
441 virtual bool IsWindowMaximized(Window window_id) const;
442 virtual bool IsWindowVerticallyMaximized(Window window_id) const;
443 virtual bool IsWindowHorizontallyMaximized(Window window_id) const;
444+ virtual bool IsWindowFullscreen(Window window_id) const;
445 virtual bool IsWindowDecorated(Window window_id) const;
446 virtual bool IsWindowOnCurrentDesktop(Window window_id) const;
447 virtual bool IsWindowObscured(Window window_id) const;
448
449=== modified file 'unity-shared/WindowManager.h'
450--- unity-shared/WindowManager.h 2015-01-21 15:28:59 +0000
451+++ unity-shared/WindowManager.h 2015-09-10 12:07:57 +0000
452@@ -83,6 +83,7 @@
453 virtual bool IsWindowMaximized(Window window_id) const = 0;
454 virtual bool IsWindowVerticallyMaximized(Window window_id) const = 0;
455 virtual bool IsWindowHorizontallyMaximized(Window window_id) const = 0;
456+ virtual bool IsWindowFullscreen(Window window_id) const = 0;
457 virtual bool IsWindowDecorated(Window window_id) const = 0;
458 virtual bool IsWindowOnCurrentDesktop(Window window_id) const = 0;
459 virtual bool IsWindowObscured(Window window_id) const = 0;
460@@ -185,6 +186,8 @@
461 sigc::signal<void, Window> window_restored;
462 sigc::signal<void, Window> window_minimized;
463 sigc::signal<void, Window> window_unminimized;
464+ sigc::signal<void, Window> window_fullscreen;
465+ sigc::signal<void, Window> window_unfullscreen;
466 sigc::signal<void, Window> window_shaded;
467 sigc::signal<void, Window> window_unshaded;
468 sigc::signal<void, Window> window_shown;