Merge lp:~azzar1/unity/fix-scale-activation-show-desktop into lp:unity

Proposed by Andrea Azzarone on 2016-05-31
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2016-05-31
Approved revision: 4123
Merged at revision: 4123
Proposed branch: lp:~azzar1/unity/fix-scale-activation-show-desktop
Merge into: lp:unity
Diff against target: 69 lines (+19/-1)
2 files modified
plugins/unityshell/src/unityshell.cpp (+14/-1)
plugins/unityshell/src/unityshell.h (+5/-0)
To merge this branch: bzr merge lp:~azzar1/unity/fix-scale-activation-show-desktop
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2016-05-31 Approve on 2016-05-31
PS Jenkins bot continuous-integration Pending
Review via email: mp+296101@code.launchpad.net

Commit message

Fix scale window activation if in show desktop mode.

Description of the change

Fix scale window activation if in show desktop mode.

To post a comment you must log in.
4122. By Andrea Azzarone on 2016-05-31

Fix scale window activation if in show desktop mode.

4123. By Andrea Azzarone on 2016-05-31

Fix case.

Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2016-05-17 02:56:14 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2016-05-31 11:54:24 +0000
4@@ -221,6 +221,7 @@
5 , key_nav_mode_requested_(false)
6 , big_tick_(0)
7 , back_buffer_age_(0)
8+ , next_active_window_(0)
9 {
10 Timer timer;
11 #ifndef USE_GLES
12@@ -1214,6 +1215,8 @@
13
14 void UnityWindow::activate ()
15 {
16+ uScreen->SetNextActiveWindow(window->id());
17+
18 ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ());
19 window->activate ();
20 ShowdesktopHandler::AllowLeaveShowdesktopMode (window->id ());
21@@ -4245,6 +4248,16 @@
22 });
23 }
24
25+Window UnityScreen::GetNextActiveWindow() const
26+{
27+ return next_active_window_;
28+}
29+
30+void UnityScreen::SetNextActiveWindow(Window next_active_window)
31+{
32+ next_active_window_ = next_active_window;
33+}
34+
35 /* Window init */
36
37 namespace
38@@ -4604,7 +4617,7 @@
39
40 if (IsInShowdesktopMode())
41 {
42- if (!(screen->activeWindow() == window->id()))
43+ if (uScreen->GetNextActiveWindow() != window->id())
44 {
45 if (!mShowdesktopHandler)
46 mShowdesktopHandler.reset(new ShowdesktopHandler(static_cast <ShowdesktopHandlerWindowInterface *>(this),
47
48=== modified file 'plugins/unityshell/src/unityshell.h'
49--- plugins/unityshell/src/unityshell.h 2016-05-10 23:03:20 +0000
50+++ plugins/unityshell/src/unityshell.h 2016-05-31 11:54:24 +0000
51@@ -298,6 +298,9 @@
52 void SpreadAppWindows(bool anywhere);
53 bool queryForShader();
54
55+ Window GetNextActiveWindow() const;
56+ void SetNextActiveWindow(Window next_active_window);
57+
58 /* We store these to avoid unecessary calls to ::get */
59 CompScreen* screen;
60 CompositeScreen* cScreen;
61@@ -413,6 +416,8 @@
62 uint64_t big_tick_;
63 unsigned int back_buffer_age_;
64
65+ Window next_active_window_;
66+
67 friend class UnityWindow;
68 friend class debug::ScreenIntrospection;
69 friend class decoration::Manager;