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
=== modified file 'UnityCore/Indicators.cpp'
--- UnityCore/Indicators.cpp 2015-01-29 18:23:24 +0000
+++ UnityCore/Indicators.cpp 2015-09-10 12:07:57 +0000
@@ -27,9 +27,8 @@
27namespace indicator27namespace indicator
28{28{
2929
30class Indicators::Impl30struct Indicators::Impl
31{31{
32public:
33 typedef std::unordered_map<std::string, Indicator::Ptr> IndicatorMap;32 typedef std::unordered_map<std::string, Indicator::Ptr> IndicatorMap;
3433
35 Impl(Indicators* owner)34 Impl(Indicators* owner)
@@ -49,7 +48,6 @@
4948
50 Entry::Ptr GetEntry(std::string const& entry_id);49 Entry::Ptr GetEntry(std::string const& entry_id);
5150
52private:
53 Indicators* owner_;51 Indicators* owner_;
54 IndicatorMap indicators_;52 IndicatorMap indicators_;
55 Entry::Ptr active_entry_;53 Entry::Ptr active_entry_;
@@ -93,6 +91,11 @@
93 return pimpl->RemoveIndicator(name);91 return pimpl->RemoveIndicator(name);
94}92}
9593
94Entry::Ptr const& Indicators::GetActiveEntry() const
95{
96 return pimpl->active_entry_;
97}
98
96void Indicators::Impl::ActivateEntry(std::string const& panel, std::string const& entry_id, nux::Rect const& geometry)99void Indicators::Impl::ActivateEntry(std::string const& panel, std::string const& entry_id, nux::Rect const& geometry)
97{100{
98 if (active_entry_)101 if (active_entry_)
99102
=== modified file 'UnityCore/Indicators.h'
--- UnityCore/Indicators.h 2014-09-19 18:48:04 +0000
+++ UnityCore/Indicators.h 2015-09-10 12:07:57 +0000
@@ -40,6 +40,7 @@
40 virtual ~Indicators();40 virtual ~Indicators();
4141
42 IndicatorsList GetIndicators() const;42 IndicatorsList GetIndicators() const;
43 Entry::Ptr const& GetActiveEntry() const;
43 virtual std::vector<std::string> const& IconPaths() const = 0;44 virtual std::vector<std::string> const& IconPaths() const = 0;
4445
45 virtual void SyncGeometries(std::string const& panel, EntryLocationMap const&) = 0;46 virtual void SyncGeometries(std::string const& panel, EntryLocationMap const&) = 0;
4647
=== modified file 'panel/PanelMenuView.cpp'
--- panel/PanelMenuView.cpp 2015-07-07 16:10:29 +0000
+++ panel/PanelMenuView.cpp 2015-09-10 12:07:57 +0000
@@ -222,6 +222,8 @@
222 wm.window_unminimized.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnminimized));222 wm.window_unminimized.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnminimized));
223 wm.window_maximized.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMaximized));223 wm.window_maximized.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMaximized));
224 wm.window_restored.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowRestored));224 wm.window_restored.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowRestored));
225 wm.window_fullscreen.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMaximized));
226 wm.window_unfullscreen.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnFullscreen));
225 wm.window_unmapped.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnmapped));227 wm.window_unmapped.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowUnmapped));
226 wm.window_mapped.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMapped));228 wm.window_mapped.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMapped));
227 wm.window_moved.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMoved));229 wm.window_moved.connect(sigc::mem_fun(this, &PanelMenuView::OnWindowMoved));
@@ -231,6 +233,7 @@
231 wm.initiate_expo.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));233 wm.initiate_expo.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));
232 wm.terminate_expo.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));234 wm.terminate_expo.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));
233 wm.screen_viewport_switch_ended.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));235 wm.screen_viewport_switch_ended.connect(sigc::mem_fun(this, &PanelMenuView::RefreshAndRedraw));
236 wm.show_desktop_changed.connect(sigc::mem_fun(this, &PanelMenuView::OnShowDesktopChanged));
234}237}
235238
236void PanelMenuView::SetupUBusManagerInterests()239void PanelMenuView::SetupUBusManagerInterests()
@@ -1098,7 +1101,8 @@
1098 if (new_win)1101 if (new_win)
1099 {1102 {
1100 active_xid = new_win->window_id();1103 active_xid = new_win->window_id();
1101 is_maximized_ = new_win->maximized();1104 is_maximized_ = (new_win->maximized() ||
1105 WindowManager::Default().IsWindowFullscreen(active_xid));
11021106
1103 if (new_win->type() == WindowType::DESKTOP)1107 if (new_win->type() == WindowType::DESKTOP)
1104 {1108 {
@@ -1254,6 +1258,17 @@
1254 }1258 }
1255}1259}
12561260
1261void PanelMenuView::OnWindowUnFullscreen(Window xid)
1262{
1263 if (!WindowManager::Default().IsWindowMaximized(xid))
1264 OnWindowRestored(xid);
1265}
1266
1267void PanelMenuView::OnShowDesktopChanged()
1268{
1269 UpdateMaximizedWindow();
1270}
1271
1257bool PanelMenuView::UpdateActiveWindowPosition()1272bool PanelMenuView::UpdateActiveWindowPosition()
1258{1273{
1259 bool we_control_window = IsWindowUnderOurControl(active_window);1274 bool we_control_window = IsWindowUnderOurControl(active_window);
@@ -1736,7 +1751,7 @@
1736 if (win->active())1751 if (win->active())
1737 active_window = xid;1752 active_window = xid;
17381753
1739 if (win->maximized())1754 if (win->maximized() || WindowManager::Default().IsWindowFullscreen(xid))
1740 {1755 {
1741 if (win->active())1756 if (win->active())
1742 maximized_wins_.push_front(xid);1757 maximized_wins_.push_front(xid);
17431758
=== modified file 'panel/PanelMenuView.h'
--- panel/PanelMenuView.h 2015-07-07 16:10:29 +0000
+++ panel/PanelMenuView.h 2015-09-10 12:07:57 +0000
@@ -105,7 +105,9 @@
105 void OnWindowMapped(Window xid);105 void OnWindowMapped(Window xid);
106 void OnWindowMaximized(Window xid);106 void OnWindowMaximized(Window xid);
107 void OnWindowRestored(Window xid);107 void OnWindowRestored(Window xid);
108 void OnWindowUnFullscreen(Window xid);
108 void OnWindowMoved(Window xid);109 void OnWindowMoved(Window xid);
110 void OnShowDesktopChanged();
109111
110 void OnMaximizedActivate(int x, int y);112 void OnMaximizedActivate(int x, int y);
111 void OnMaximizedDoubleClicked(int x, int y);113 void OnMaximizedDoubleClicked(int x, int y);
112114
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2015-05-22 13:20:44 +0000
+++ plugins/unityshell/src/unityshell.cpp 2015-09-10 12:07:57 +0000
@@ -986,14 +986,28 @@
986986
987bool UnityScreen::forcePaintOnTop()987bool UnityScreen::forcePaintOnTop()
988{988{
989 return !allowWindowPaint ||989 if (!allowWindowPaint ||
990 lockscreen_controller_->IsLocked() ||990 lockscreen_controller_->IsLocked() ||
991 (dash_controller_->IsVisible() && !nux::GetGraphicsDisplay()->PointerIsGrabbed()) ||991 (dash_controller_->IsVisible() && !nux::GetGraphicsDisplay()->PointerIsGrabbed()) ||
992 hud_controller_->IsVisible() ||992 hud_controller_->IsVisible() ||
993 session_controller_->Visible() ||993 session_controller_->Visible())
994 ((switcher_controller_->Visible() ||994 {
995 WM.IsExpoActive())995 return true;
996 && !fullscreen_windows_.empty () && (!(screen->grabbed () && !screen->otherGrabExist (NULL))));996 }
997
998 if (!fullscreen_windows_.empty())
999 {
1000 if (menus_->menu_open())
1001 return true;
1002
1003 if (switcher_controller_->Visible() || WM.IsExpoActive())
1004 {
1005 if (!screen->grabbed() || screen->otherGrabExist(nullptr))
1006 return true;
1007 }
1008 }
1009
1010 return false;
997}1011}
9981012
999void UnityScreen::EnableCancelAction(CancelActionTarget target, bool enabled, int modifiers)1013void UnityScreen::EnableCancelAction(CancelActionTarget target, bool enabled, int modifiers)
@@ -1255,7 +1269,6 @@
12551269
1256 window->updateFrameRegionSetCurrentIndex(MAXSHORT);1270 window->updateFrameRegionSetCurrentIndex(MAXSHORT);
1257 window->updateFrameRegion(region);1271 window->updateFrameRegion(region);
1258 deco_win_->UpdateFrameRegion(region);
1259 window->updateFrameRegionSetCurrentIndex(oldUpdateFrameRegionIndex);1272 window->updateFrameRegionSetCurrentIndex(oldUpdateFrameRegionIndex);
1260}1273}
12611274
12621275
=== modified file 'tests/autopilot/unity/emulators/launcher.py'
--- tests/autopilot/unity/emulators/launcher.py 2015-08-18 15:07:31 +0000
+++ tests/autopilot/unity/emulators/launcher.py 2015-09-10 12:07:57 +0000
@@ -378,11 +378,11 @@
378378
379 self.move_mouse_to_icon(icon)379 self.move_mouse_to_icon(icon)
380 self._mouse.press()380 self._mouse.press()
381 sleep(2)381 sleep(1)
382382
383 if drag_type == IconDragType.OUTSIDE:383 if drag_type == IconDragType.OUTSIDE:
384 shift_over = self._mouse.x + (icon_height * 2)384 shift_over = self._mouse.x + (icon_height * 2)
385 self._mouse.move(shift_over, self._mouse.y)385 self._mouse.move(shift_over, self._mouse.y, rate=20, time_between_events=0.005)
386 sleep(0.5)386 sleep(0.5)
387387
388 self.move_mouse_to_icon(target)388 self.move_mouse_to_icon(target)
@@ -393,8 +393,8 @@
393 if pos == IconDragType.BEFORE:393 if pos == IconDragType.BEFORE:
394 target_y -= icon_height + (icon_height / 2)394 target_y -= icon_height + (icon_height / 2)
395395
396 self._mouse.move(self._mouse.x, target_y)396 self._mouse.move(self._mouse.x, target_y, rate=20, time_between_events=0.005)
397 sleep(0.5)397 sleep(1)
398 self._mouse.release()398 self._mouse.release()
399 self.move_mouse_to_right_of_launcher()399 self.move_mouse_to_right_of_launcher()
400400
401401
=== modified file 'tests/autopilot/unity/tests/launcher/test_icon_behavior.py'
--- tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2015-08-18 10:08:57 +0000
+++ tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2015-09-10 12:07:57 +0000
@@ -60,6 +60,11 @@
60 self.assertThat(lambda: self.process_manager.app_is_running("Calculator"), Eventually(Equals(False)))60 self.assertThat(lambda: self.process_manager.app_is_running("Calculator"), Eventually(Equals(False)))
61 return calc_icon61 return calc_icon
6262
63 def get_running_application_by_desktop_file(self, desktop_id):
64 get_app_fn = lambda: self.process_manager.get_running_applications_by_desktop_file(desktop_id)
65 self.assertThat(lambda: len(get_app_fn()), Eventually(Equals(1)))
66 return get_app_fn()[0]
67
63 def test_bfb_tooltip_disappear_when_dash_is_opened(self):68 def test_bfb_tooltip_disappear_when_dash_is_opened(self):
64 """Tests that the bfb tooltip disappear when the dash is opened."""69 """Tests that the bfb tooltip disappear when the dash is opened."""
65 bfb = self.unity.launcher.model.get_bfb_icon()70 bfb = self.unity.launcher.model.get_bfb_icon()
@@ -139,7 +144,7 @@
139 self.addCleanup(self.process_manager.close_all_app, "Calculator")144 self.addCleanup(self.process_manager.close_all_app, "Calculator")
140 self.launcher_instance.click_launcher_icon(calc_icon)145 self.launcher_instance.click_launcher_icon(calc_icon)
141146
142 calc_app = self.process_manager.get_running_applications_by_desktop_file(calc_icon.desktop_id)[0]147 calc_app = self.get_running_application_by_desktop_file(calc_icon.desktop_id)
143 calc_window = calc_app.get_windows()[0]148 calc_window = calc_app.get_windows()[0]
144149
145 self.assertThat(lambda: self.get_startup_notification_timestamp(calc_window), Eventually(Equals(calc_icon.startup_notification_timestamp)))150 self.assertThat(lambda: self.get_startup_notification_timestamp(calc_window), Eventually(Equals(calc_icon.startup_notification_timestamp)))
@@ -197,8 +202,8 @@
197 self.addCleanup(self.launcher_instance.keyboard_unreveal_launcher)202 self.addCleanup(self.launcher_instance.keyboard_unreveal_launcher)
198 self.keyboard.press_and_release("1");203 self.keyboard.press_and_release("1");
199204
200 calc_app = self.process_manager.get_running_applications_by_desktop_file(calc_icon.desktop_id)[0]205 calc_app = self.get_running_application_by_desktop_file(calc_icon.desktop_id)
201 calc_window = calc_app.get_windows()[0]206 [calc_window] = calc_app.get_windows()
202207
203 self.assertThat(lambda: calc_window.is_focused, Eventually(Equals(True)))208 self.assertThat(lambda: calc_window.is_focused, Eventually(Equals(True)))
204209
@@ -411,7 +416,8 @@
411 self.drag_type)416 self.drag_type)
412417
413 # Must be the last bamf icon - not necessarily the third-from-end icon.418 # Must be the last bamf icon - not necessarily the third-from-end icon.
414 refresh_fn = lambda: self.unity.launcher.model.get_launcher_icons()[-2].id419 expected_pos = -2 if self.workspace.num_workspaces < 2 else -1
420 refresh_fn = lambda: self.unity.launcher.model.get_launcher_icons()[expected_pos].id
415 self.assertThat(refresh_fn,421 self.assertThat(refresh_fn,
416 Eventually(Equals(calc_icon.id)),422 Eventually(Equals(calc_icon.id)),
417 "Launcher icons are: %r" % self.unity.launcher.model.get_launcher_icons())423 "Launcher icons are: %r" % self.unity.launcher.model.get_launcher_icons())
418424
=== modified file 'tests/autopilot/unity/tests/test_panel.py'
--- tests/autopilot/unity/tests/test_panel.py 2015-08-19 11:15:42 +0000
+++ tests/autopilot/unity/tests/test_panel.py 2015-09-10 12:07:57 +0000
@@ -1033,7 +1033,7 @@
1033 self.assertThat(menu_entry.menu_y, Eventually(Equals(0)))1033 self.assertThat(menu_entry.menu_y, Eventually(Equals(0)))
10341034
1035 def test_menu_closes_on_new_focused_application(self):1035 def test_menu_closes_on_new_focused_application(self):
1036 """Clicking outside an open menu must close it."""1036 """When a new app is focused, open menu should be closed only when using Global Menus."""
1037 menu_entry = self.open_app_and_get_menu_entry()1037 menu_entry = self.open_app_and_get_menu_entry()
1038 self.mouse_open_indicator(menu_entry)1038 self.mouse_open_indicator(menu_entry)
10391039
@@ -1042,7 +1042,7 @@
10421042
1043 self.open_new_application_window("Text Editor")1043 self.open_new_application_window("Text Editor")
1044 get_active_indicator_fn = lambda: self.unity.panels.get_active_indicator()1044 get_active_indicator_fn = lambda: self.unity.panels.get_active_indicator()
1045 self.assertThat(get_active_indicator_fn, Eventually(Equals(None)))1045 self.assertThat(get_active_indicator_fn, Eventually(NotEquals(None) if self.lim else Equals(None)))
10461046
1047 def test_indicator_opens_when_dash_is_open(self):1047 def test_indicator_opens_when_dash_is_open(self):
1048 """When the dash is open and a click is on an indicator the dash1048 """When the dash is open and a click is on an indicator the dash
10491049
=== modified file 'tests/test_indicators.cpp'
--- tests/test_indicators.cpp 2014-12-19 17:26:43 +0000
+++ tests/test_indicators.cpp 2015-09-10 12:07:57 +0000
@@ -216,6 +216,7 @@
216216
217 // Activating Entries from the Indicators class to see if they get updated217 // Activating Entries from the Indicators class to see if they get updated
218 ASSERT_THAT(indicators.GetIndicator("indicator-test-1"), NotNull());218 ASSERT_THAT(indicators.GetIndicator("indicator-test-1"), NotNull());
219 ASSERT_THAT(indicators.GetActiveEntry(), IsNull());
219220
220 Entry::Ptr entry12(indicators.GetIndicator("indicator-test-1")->GetEntry("indicator-test-1|entry-2"));221 Entry::Ptr entry12(indicators.GetIndicator("indicator-test-1")->GetEntry("indicator-test-1|entry-2"));
221 ASSERT_THAT(entry12, NotNull());222 ASSERT_THAT(entry12, NotNull());
@@ -227,6 +228,7 @@
227228
228 EXPECT_EQ(entry12->active(), true);229 EXPECT_EQ(entry12->active(), true);
229 EXPECT_EQ(entry12->geometry(), nux::Rect(1, 2, 3, 4));230 EXPECT_EQ(entry12->geometry(), nux::Rect(1, 2, 3, 4));
231 EXPECT_EQ(indicators.GetActiveEntry(), entry12);
230}232}
231233
232TEST_F(TestIndicators, ActivateEntryShouldDisactivatePrevious)234TEST_F(TestIndicators, ActivateEntryShouldDisactivatePrevious)
233235
=== modified file 'unity-shared/CompizUtils.cpp'
--- unity-shared/CompizUtils.cpp 2014-10-22 13:58:46 +0000
+++ unity-shared/CompizUtils.cpp 2015-09-10 12:07:57 +0000
@@ -190,9 +190,6 @@
190 if (win->wmType() & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))190 if (win->wmType() & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
191 return elements;191 return elements;
192192
193 if (win->inShowDesktopMode())
194 return elements;
195
196 auto const& region = win->region();193 auto const& region = win->region();
197 bool rectangular = (region.numRects() == 1);194 bool rectangular = (region.numRects() == 1);
198 bool alpha = win->alpha();195 bool alpha = win->alpha();
199196
=== modified file 'unity-shared/MenuManager.cpp'
--- unity-shared/MenuManager.cpp 2015-04-20 14:50:48 +0000
+++ unity-shared/MenuManager.cpp 2015-09-10 12:07:57 +0000
@@ -61,6 +61,7 @@
61 indicators_->on_object_added.connect(sigc::mem_fun(this, &Impl::AddIndicator));61 indicators_->on_object_added.connect(sigc::mem_fun(this, &Impl::AddIndicator));
62 indicators_->on_object_removed.connect(sigc::mem_fun(this, &Impl::RemoveIndicator));62 indicators_->on_object_removed.connect(sigc::mem_fun(this, &Impl::RemoveIndicator));
63 indicators_->on_entry_activate_request.connect(sigc::mem_fun(this, &Impl::ActivateRequest));63 indicators_->on_entry_activate_request.connect(sigc::mem_fun(this, &Impl::ActivateRequest));
64 indicators_->on_entry_activated.connect(sigc::mem_fun(this, &Impl::EntryActivated));
64 indicators_->icon_paths_changed.connect(sigc::mem_fun(this, &Impl::IconPathsChanged));65 indicators_->icon_paths_changed.connect(sigc::mem_fun(this, &Impl::IconPathsChanged));
65 WindowManager::Default().window_focus_changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::GrabMnemonicsForActiveWindow)));66 WindowManager::Default().window_focus_changed.connect(sigc::hide(sigc::mem_fun(this, &Impl::GrabMnemonicsForActiveWindow)));
6667
@@ -73,6 +74,7 @@
7374
74 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());75 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());
75 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());76 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());
77 parent_->menu_open = indicators_->GetActiveEntry() != nullptr;
76 }78 }
7779
78 ~Impl()80 ~Impl()
@@ -175,6 +177,11 @@
175 parent_->key_activate_entry.emit(entry_id);177 parent_->key_activate_entry.emit(entry_id);
176 }178 }
177179
180 void EntryActivated(std::string const&, std::string const&, nux::Rect const& geo)
181 {
182 parent_->menu_open = !geo.IsNull();
183 }
184
178 void SetShowNowForWindow(Window xid, bool show)185 void SetShowNowForWindow(Window xid, bool show)
179 {186 {
180 if (!appmenu_)187 if (!appmenu_)
181188
=== modified file 'unity-shared/MenuManager.h'
--- unity-shared/MenuManager.h 2014-12-19 13:03:44 +0000
+++ unity-shared/MenuManager.h 2015-09-10 12:07:57 +0000
@@ -46,6 +46,7 @@
46 typedef std::shared_ptr<Manager> Ptr;46 typedef std::shared_ptr<Manager> Ptr;
4747
48 nux::Property<bool> show_menus;48 nux::Property<bool> show_menus;
49 nux::Property<bool> menu_open;
4950
50 nux::Property<bool> integrated_menus;51 nux::Property<bool> integrated_menus;
51 nux::Property<unsigned> show_menus_wait;52 nux::Property<unsigned> show_menus_wait;
5253
=== modified file 'unity-shared/PluginAdapter.cpp'
--- unity-shared/PluginAdapter.cpp 2015-05-29 12:30:36 +0000
+++ unity-shared/PluginAdapter.cpp 2015-09-10 12:07:57 +0000
@@ -145,6 +145,16 @@
145 {145 {
146 window_restored.emit(window->id());146 window_restored.emit(window->id());
147 }147 }
148
149 if ((state & CompWindowStateFullscreenMask) == CompWindowStateFullscreenMask)
150 {
151 window_fullscreen.emit(window->id());
152 }
153 else if (((last_state & CompWindowStateFullscreenMask) == CompWindowStateFullscreenMask) &&
154 !((state & CompWindowStateFullscreenMask) == CompWindowStateFullscreenMask))
155 {
156 window_unfullscreen.emit(window->id());
157 }
148}158}
149159
150void PluginAdapter::Notify(CompWindow* window, CompWindowNotify notify)160void PluginAdapter::Notify(CompWindow* window, CompWindowNotify notify)
@@ -530,6 +540,14 @@
530 return false;540 return false;
531}541}
532542
543bool PluginAdapter::IsWindowFullscreen(Window window_id) const
544{
545 if (CompWindow* window = m_Screen->findWindow(window_id))
546 return ((window->state() & CompWindowStateFullscreenMask) == CompWindowStateFullscreenMask);
547
548 return false;
549}
550
533bool PluginAdapter::HasWindowDecorations(Window window_id) const551bool PluginAdapter::HasWindowDecorations(Window window_id) const
534{552{
535 return compiz_utils::IsWindowFullyDecorable(m_Screen->findWindow(window_id));553 return compiz_utils::IsWindowFullyDecorable(m_Screen->findWindow(window_id));
536554
=== modified file 'unity-shared/PluginAdapter.h'
--- unity-shared/PluginAdapter.h 2015-02-03 09:46:48 +0000
+++ unity-shared/PluginAdapter.h 2015-09-10 12:07:57 +0000
@@ -122,6 +122,7 @@
122 bool IsWindowMaximized(Window window_id) const;122 bool IsWindowMaximized(Window window_id) const;
123 bool IsWindowVerticallyMaximized(Window window_id) const;123 bool IsWindowVerticallyMaximized(Window window_id) const;
124 bool IsWindowHorizontallyMaximized(Window window_id) const;124 bool IsWindowHorizontallyMaximized(Window window_id) const;
125 bool IsWindowFullscreen(Window window_id) const;
125 bool IsWindowDecorated(Window window_id) const;126 bool IsWindowDecorated(Window window_id) const;
126 bool IsWindowOnCurrentDesktop(Window window_id) const;127 bool IsWindowOnCurrentDesktop(Window window_id) const;
127 bool IsWindowObscured(Window window_id) const;128 bool IsWindowObscured(Window window_id) const;
128129
=== modified file 'unity-shared/StandaloneWindowManager.cpp'
--- unity-shared/StandaloneWindowManager.cpp 2015-02-27 15:38:11 +0000
+++ unity-shared/StandaloneWindowManager.cpp 2015-09-10 12:07:57 +0000
@@ -128,7 +128,7 @@
128128
129 return ret;129 return ret;
130}130}
131 131
132int StandaloneWindowManager::MonitorGeometryIn(nux::Geometry const& geo) const132int StandaloneWindowManager::MonitorGeometryIn(nux::Geometry const& geo) const
133{133{
134 // TODO134 // TODO
@@ -168,6 +168,15 @@
168 return false;168 return false;
169}169}
170170
171bool StandaloneWindowManager::IsWindowFullscreen(Window window_id) const
172{
173 auto window = GetWindowByXid(window_id);
174 if (window)
175 return window->fullscreen;
176
177 return false;
178}
179
171bool StandaloneWindowManager::IsWindowDecorated(Window window_id) const180bool StandaloneWindowManager::IsWindowDecorated(Window window_id) const
172{181{
173 auto window = GetWindowByXid(window_id);182 auto window = GetWindowByXid(window_id);
@@ -708,6 +717,7 @@
708 window->visible.changed.connect([this, xid] (bool v) {v ? window_shown(xid) : window_hidden(xid);});717 window->visible.changed.connect([this, xid] (bool v) {v ? window_shown(xid) : window_hidden(xid);});
709 window->maximized.changed.connect([this, xid] (bool v) {v ? window_maximized(xid) : window_restored(xid);});718 window->maximized.changed.connect([this, xid] (bool v) {v ? window_maximized(xid) : window_restored(xid);});
710 window->minimized.changed.connect([this, xid] (bool v) {v ? window_minimized(xid) : window_unminimized(xid);});719 window->minimized.changed.connect([this, xid] (bool v) {v ? window_minimized(xid) : window_unminimized(xid);});
720 window->fullscreen.changed.connect([this, xid] (bool v) {v ? window_fullscreen(xid) : window_unfullscreen(xid);});
711 window->geo.changed.connect([this, xid] (nux::Geometry const&) { window_resized(xid); window_moved(xid); });721 window->geo.changed.connect([this, xid] (nux::Geometry const&) { window_resized(xid); window_moved(xid); });
712 window->resized.connect([this, xid] { window_resized(xid); });722 window->resized.connect([this, xid] { window_resized(xid); });
713 window->moved.connect([this, xid] { window_moved(xid); });723 window->moved.connect([this, xid] { window_moved(xid); });
714724
=== modified file 'unity-shared/StandaloneWindowManager.h'
--- unity-shared/StandaloneWindowManager.h 2015-01-21 15:28:59 +0000
+++ unity-shared/StandaloneWindowManager.h 2015-09-10 12:07:57 +0000
@@ -51,6 +51,7 @@
51 nux::RWProperty<bool> maximized;51 nux::RWProperty<bool> maximized;
52 nux::Property<bool> v_maximized;52 nux::Property<bool> v_maximized;
53 nux::Property<bool> h_maximized;53 nux::Property<bool> h_maximized;
54 nux::Property<bool> fullscreen;
54 nux::Property<bool> minimized;55 nux::Property<bool> minimized;
55 nux::Property<bool> shaded;56 nux::Property<bool> shaded;
56 nux::Property<bool> decorated;57 nux::Property<bool> decorated;
@@ -78,6 +79,7 @@
78 virtual bool IsWindowMaximized(Window window_id) const;79 virtual bool IsWindowMaximized(Window window_id) const;
79 virtual bool IsWindowVerticallyMaximized(Window window_id) const;80 virtual bool IsWindowVerticallyMaximized(Window window_id) const;
80 virtual bool IsWindowHorizontallyMaximized(Window window_id) const;81 virtual bool IsWindowHorizontallyMaximized(Window window_id) const;
82 virtual bool IsWindowFullscreen(Window window_id) const;
81 virtual bool IsWindowDecorated(Window window_id) const;83 virtual bool IsWindowDecorated(Window window_id) const;
82 virtual bool IsWindowOnCurrentDesktop(Window window_id) const;84 virtual bool IsWindowOnCurrentDesktop(Window window_id) const;
83 virtual bool IsWindowObscured(Window window_id) const;85 virtual bool IsWindowObscured(Window window_id) const;
8486
=== modified file 'unity-shared/WindowManager.h'
--- unity-shared/WindowManager.h 2015-01-21 15:28:59 +0000
+++ unity-shared/WindowManager.h 2015-09-10 12:07:57 +0000
@@ -83,6 +83,7 @@
83 virtual bool IsWindowMaximized(Window window_id) const = 0;83 virtual bool IsWindowMaximized(Window window_id) const = 0;
84 virtual bool IsWindowVerticallyMaximized(Window window_id) const = 0;84 virtual bool IsWindowVerticallyMaximized(Window window_id) const = 0;
85 virtual bool IsWindowHorizontallyMaximized(Window window_id) const = 0;85 virtual bool IsWindowHorizontallyMaximized(Window window_id) const = 0;
86 virtual bool IsWindowFullscreen(Window window_id) const = 0;
86 virtual bool IsWindowDecorated(Window window_id) const = 0;87 virtual bool IsWindowDecorated(Window window_id) const = 0;
87 virtual bool IsWindowOnCurrentDesktop(Window window_id) const = 0;88 virtual bool IsWindowOnCurrentDesktop(Window window_id) const = 0;
88 virtual bool IsWindowObscured(Window window_id) const = 0;89 virtual bool IsWindowObscured(Window window_id) const = 0;
@@ -185,6 +186,8 @@
185 sigc::signal<void, Window> window_restored;186 sigc::signal<void, Window> window_restored;
186 sigc::signal<void, Window> window_minimized;187 sigc::signal<void, Window> window_minimized;
187 sigc::signal<void, Window> window_unminimized;188 sigc::signal<void, Window> window_unminimized;
189 sigc::signal<void, Window> window_fullscreen;
190 sigc::signal<void, Window> window_unfullscreen;
188 sigc::signal<void, Window> window_shaded;191 sigc::signal<void, Window> window_shaded;
189 sigc::signal<void, Window> window_unshaded;192 sigc::signal<void, Window> window_unshaded;
190 sigc::signal<void, Window> window_shown;193 sigc::signal<void, Window> window_shown;