Merge lp:~smspillaz/unity/unity.fix_864503 into lp:unity

Proposed by Sam Spilsbury
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 1687
Proposed branch: lp:~smspillaz/unity/unity.fix_864503
Merge into: lp:unity
Diff against target: 85 lines (+35/-3)
2 files modified
plugins/unityshell/src/unityshell.cpp (+33/-3)
plugins/unityshell/src/unityshell.h (+2/-0)
To merge this branch: bzr merge lp:~smspillaz/unity/unity.fix_864503
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+77813@code.launchpad.net

Description of the change

Mark hidden showdesktop'd windows as "hidden"

To post a comment you must log in.

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 2011-09-30 15:55:29 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2011-10-02 08:25:28 +0000
4@@ -773,8 +773,15 @@
5 mState = UnityShowdesktopHandler::FadeOut;
6 mProgress = 1.0f;
7
8- mRemover->save ();
9- mRemover->remove ();
10+ mWasHidden = mWindow->state () & CompWindowStateHiddenMask;
11+
12+ if (!mWasHidden)
13+ {
14+ mWindow->changeState (mWindow->state () | CompWindowStateHiddenMask);
15+ mWindow->windowNotify (CompWindowNotifyHide);
16+ mRemover->save ();
17+ mRemover->remove ();
18+ }
19
20 CompositeWindow::get (mWindow)->addDamage ();
21
22@@ -788,7 +795,12 @@
23 {
24 mState = UnityShowdesktopHandler::FadeIn;
25
26- mRemover->restore ();
27+ if (!mWasHidden)
28+ {
29+ mWindow->changeState (mWindow->state () & ~CompWindowStateHiddenMask);
30+ mWindow->windowNotify (CompWindowNotifyShow);
31+ mRemover->restore ();
32+ }
33
34 CompositeWindow::get (mWindow)->addDamage ();
35 }
36@@ -850,6 +862,20 @@
37 }
38 }
39
40+void UnityShowdesktopHandler::windowNotify (CompWindowNotify n)
41+{
42+ if (n == CompWindowNotifyFocusChange && mWindow->minimized ())
43+ {
44+ for (CompWindow *w : animating_windows)
45+ w->focusSetEnabled (UnityWindow::get (w), false);
46+
47+ mWindow->moveInputFocusToOtherWindow ();
48+
49+ for (CompWindow *w : animating_windows)
50+ w->focusSetEnabled (UnityWindow::get (w), true);
51+ }
52+}
53+
54 void UnityShowdesktopHandler::updateFrameRegion (CompRegion &r)
55 {
56 unsigned int oldUpdateFrameRegionIndex;
57@@ -1711,6 +1737,10 @@
58 boost::dynamic_pointer_cast <minimized_window_handler_unity> (mMinimizeHandler);
59 compizMinimizeHandler->windowNotify (n);
60 }
61+ else if (mShowdesktopHandler)
62+ {
63+ mShowdesktopHandler->windowNotify (n);
64+ }
65
66 // We do this after the notify to ensure input focus has actually been moved.
67 if (n == CompWindowNotifyFocusChange)
68
69=== modified file 'plugins/unityshell/src/unityshell.h'
70--- plugins/unityshell/src/unityshell.h 2011-09-30 15:55:29 +0000
71+++ plugins/unityshell/src/unityshell.h 2011-10-02 08:25:28 +0000
72@@ -100,6 +100,7 @@
73 void paintAttrib (GLWindowPaintAttrib &attrib);
74 unsigned int getPaintMask ();
75 void handleEvent (XEvent *);
76+ void windowNotify (CompWindowNotify n);
77 void updateFrameRegion (CompRegion &r);
78
79 UnityShowdesktopHandler::State state ();
80@@ -114,6 +115,7 @@
81 compiz::WindowInputRemover *mRemover;
82 UnityShowdesktopHandler::State mState;
83 float mProgress;
84+ bool mWasHidden;
85 };
86
87