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
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2011-09-30 15:55:29 +0000
+++ plugins/unityshell/src/unityshell.cpp 2011-10-02 08:25:28 +0000
@@ -773,8 +773,15 @@
773 mState = UnityShowdesktopHandler::FadeOut;773 mState = UnityShowdesktopHandler::FadeOut;
774 mProgress = 1.0f;774 mProgress = 1.0f;
775775
776 mRemover->save ();776 mWasHidden = mWindow->state () & CompWindowStateHiddenMask;
777 mRemover->remove ();777
778 if (!mWasHidden)
779 {
780 mWindow->changeState (mWindow->state () | CompWindowStateHiddenMask);
781 mWindow->windowNotify (CompWindowNotifyHide);
782 mRemover->save ();
783 mRemover->remove ();
784 }
778785
779 CompositeWindow::get (mWindow)->addDamage ();786 CompositeWindow::get (mWindow)->addDamage ();
780787
@@ -788,7 +795,12 @@
788{795{
789 mState = UnityShowdesktopHandler::FadeIn;796 mState = UnityShowdesktopHandler::FadeIn;
790797
791 mRemover->restore ();798 if (!mWasHidden)
799 {
800 mWindow->changeState (mWindow->state () & ~CompWindowStateHiddenMask);
801 mWindow->windowNotify (CompWindowNotifyShow);
802 mRemover->restore ();
803 }
792804
793 CompositeWindow::get (mWindow)->addDamage ();805 CompositeWindow::get (mWindow)->addDamage ();
794}806}
@@ -850,6 +862,20 @@
850 }862 }
851}863}
852864
865void UnityShowdesktopHandler::windowNotify (CompWindowNotify n)
866{
867 if (n == CompWindowNotifyFocusChange && mWindow->minimized ())
868 {
869 for (CompWindow *w : animating_windows)
870 w->focusSetEnabled (UnityWindow::get (w), false);
871
872 mWindow->moveInputFocusToOtherWindow ();
873
874 for (CompWindow *w : animating_windows)
875 w->focusSetEnabled (UnityWindow::get (w), true);
876 }
877}
878
853void UnityShowdesktopHandler::updateFrameRegion (CompRegion &r)879void UnityShowdesktopHandler::updateFrameRegion (CompRegion &r)
854{880{
855 unsigned int oldUpdateFrameRegionIndex;881 unsigned int oldUpdateFrameRegionIndex;
@@ -1711,6 +1737,10 @@
1711 boost::dynamic_pointer_cast <minimized_window_handler_unity> (mMinimizeHandler);1737 boost::dynamic_pointer_cast <minimized_window_handler_unity> (mMinimizeHandler);
1712 compizMinimizeHandler->windowNotify (n);1738 compizMinimizeHandler->windowNotify (n);
1713 }1739 }
1740 else if (mShowdesktopHandler)
1741 {
1742 mShowdesktopHandler->windowNotify (n);
1743 }
17141744
1715 // We do this after the notify to ensure input focus has actually been moved.1745 // We do this after the notify to ensure input focus has actually been moved.
1716 if (n == CompWindowNotifyFocusChange)1746 if (n == CompWindowNotifyFocusChange)
17171747
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2011-09-30 15:55:29 +0000
+++ plugins/unityshell/src/unityshell.h 2011-10-02 08:25:28 +0000
@@ -100,6 +100,7 @@
100 void paintAttrib (GLWindowPaintAttrib &attrib);100 void paintAttrib (GLWindowPaintAttrib &attrib);
101 unsigned int getPaintMask ();101 unsigned int getPaintMask ();
102 void handleEvent (XEvent *);102 void handleEvent (XEvent *);
103 void windowNotify (CompWindowNotify n);
103 void updateFrameRegion (CompRegion &r);104 void updateFrameRegion (CompRegion &r);
104105
105 UnityShowdesktopHandler::State state ();106 UnityShowdesktopHandler::State state ();
@@ -114,6 +115,7 @@
114 compiz::WindowInputRemover *mRemover;115 compiz::WindowInputRemover *mRemover;
115 UnityShowdesktopHandler::State mState;116 UnityShowdesktopHandler::State mState;
116 float mProgress;117 float mProgress;
118 bool mWasHidden;
117};119};
118 120
119121