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

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
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) Approve
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.
Revision history for this message
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
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2016-05-17 02:56:14 +0000
+++ plugins/unityshell/src/unityshell.cpp 2016-05-31 11:54:24 +0000
@@ -221,6 +221,7 @@
221 , key_nav_mode_requested_(false)221 , key_nav_mode_requested_(false)
222 , big_tick_(0)222 , big_tick_(0)
223 , back_buffer_age_(0)223 , back_buffer_age_(0)
224 , next_active_window_(0)
224{225{
225 Timer timer;226 Timer timer;
226#ifndef USE_GLES227#ifndef USE_GLES
@@ -1214,6 +1215,8 @@
12141215
1215void UnityWindow::activate ()1216void UnityWindow::activate ()
1216{1217{
1218 uScreen->SetNextActiveWindow(window->id());
1219
1217 ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ());1220 ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ());
1218 window->activate ();1221 window->activate ();
1219 ShowdesktopHandler::AllowLeaveShowdesktopMode (window->id ());1222 ShowdesktopHandler::AllowLeaveShowdesktopMode (window->id ());
@@ -4245,6 +4248,16 @@
4245 });4248 });
4246}4249}
42474250
4251Window UnityScreen::GetNextActiveWindow() const
4252{
4253 return next_active_window_;
4254}
4255
4256void UnityScreen::SetNextActiveWindow(Window next_active_window)
4257{
4258 next_active_window_ = next_active_window;
4259}
4260
4248/* Window init */4261/* Window init */
42494262
4250namespace4263namespace
@@ -4604,7 +4617,7 @@
46044617
4605 if (IsInShowdesktopMode())4618 if (IsInShowdesktopMode())
4606 {4619 {
4607 if (!(screen->activeWindow() == window->id()))4620 if (uScreen->GetNextActiveWindow() != window->id())
4608 {4621 {
4609 if (!mShowdesktopHandler)4622 if (!mShowdesktopHandler)
4610 mShowdesktopHandler.reset(new ShowdesktopHandler(static_cast <ShowdesktopHandlerWindowInterface *>(this),4623 mShowdesktopHandler.reset(new ShowdesktopHandler(static_cast <ShowdesktopHandlerWindowInterface *>(this),
46114624
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2016-05-10 23:03:20 +0000
+++ plugins/unityshell/src/unityshell.h 2016-05-31 11:54:24 +0000
@@ -298,6 +298,9 @@
298 void SpreadAppWindows(bool anywhere);298 void SpreadAppWindows(bool anywhere);
299 bool queryForShader();299 bool queryForShader();
300300
301 Window GetNextActiveWindow() const;
302 void SetNextActiveWindow(Window next_active_window);
303
301 /* We store these to avoid unecessary calls to ::get */304 /* We store these to avoid unecessary calls to ::get */
302 CompScreen* screen;305 CompScreen* screen;
303 CompositeScreen* cScreen;306 CompositeScreen* cScreen;
@@ -413,6 +416,8 @@
413 uint64_t big_tick_;416 uint64_t big_tick_;
414 unsigned int back_buffer_age_;417 unsigned int back_buffer_age_;
415418
419 Window next_active_window_;
420
416 friend class UnityWindow;421 friend class UnityWindow;
417 friend class debug::ScreenIntrospection;422 friend class debug::ScreenIntrospection;
418 friend class decoration::Manager;423 friend class decoration::Manager;