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

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 1652
Proposed branch: lp:~smspillaz/unity/unity.fix_851472
Merge into: lp:unity
Diff against target: 141 lines (+22/-14)
3 files modified
plugins/unityshell/src/compizminimizedwindowhandler.h (+0/-1)
plugins/unityshell/src/inputremover.cpp (+16/-10)
plugins/unityshell/src/unityshell.cpp (+6/-3)
To merge this branch: bzr merge lp:~smspillaz/unity/unity.fix_851472
Reviewer Review Type Date Requested Status
Robert Carr (community) Approve
Review via email: mp+77362@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Robert Carr (robertcarr) 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/compizminimizedwindowhandler.h'
2--- plugins/unityshell/src/compizminimizedwindowhandler.h 2011-09-20 20:53:38 +0000
3+++ plugins/unityshell/src/compizminimizedwindowhandler.h 2011-09-28 16:34:19 +0000
4@@ -116,7 +116,6 @@
5 MinimizedWindowHandler::setVisibility (visible, priv->mWindow->id ());
6
7 CompositeWindow::get (priv->mWindow)->addDamage ();
8- GLWindow::get (priv->mWindow)->glPaintSetEnabled (Window::get (priv->mWindow), !visible);
9 }
10
11 template <typename Screen, typename Window>
12
13=== modified file 'plugins/unityshell/src/inputremover.cpp'
14--- plugins/unityshell/src/inputremover.cpp 2011-09-13 13:32:06 +0000
15+++ plugins/unityshell/src/inputremover.cpp 2011-09-28 16:34:19 +0000
16@@ -91,8 +91,10 @@
17 if (!mRemoved)
18 {
19 /* FIXME: these roundtrips suck */
20- XGetGeometry (mDpy, mShapeWindow, &rootReturn, &x, &y, &width, &height, &depth, &border);
21- XQueryTree (mDpy, mShapeWindow, &rootReturn, &parentReturn, &children, &nchildren);
22+ if (!XGetGeometry (mDpy, mShapeWindow, &rootReturn, &x, &y, &width, &height, &depth, &border))
23+ return;
24+ if (!XQueryTree (mDpy, mShapeWindow, &rootReturn, &parentReturn, &children, &nchildren))
25+ return;
26
27 /* We need to translate the co-ordinates of the origin to the
28 * client window to its parent to find out the offset of its
29@@ -120,7 +122,7 @@
30 Region boundingRegion = XCreateRegion ();
31
32 for (int i = 0; i < mNBoundingRects; i++)
33- XUnionRectWithRegion (&(mBoundingRects[i]), boundingRegion, boundingRegion);
34+ XUnionRectWithRegion (&(mBoundingRects[i]), boundingRegion, boundingRegion);
35
36 xsev.x = boundingRegion->extents.x1 - xOffset;
37 xsev.y = boundingRegion->extents.y1 - yOffset;
38@@ -152,7 +154,7 @@
39 Region inputRegion = XCreateRegion ();
40
41 for (int i = 0; i < mNInputRects; i++)
42- XUnionRectWithRegion (&(mInputRects[i]), inputRegion, inputRegion);
43+ XUnionRectWithRegion (&(mInputRects[i]), inputRegion, inputRegion);
44
45 xsev.x = inputRegion->extents.x1 - xOffset;
46 xsev.y = inputRegion->extents.y1 - yOffset;
47@@ -268,7 +270,8 @@
48 compiz::WindowInputRemover::remove ()
49 {
50 if (!mNInputRects)
51- save ();
52+ if (!save ())
53+ return false;
54
55 XShapeSelectInput (mDpy, mShapeWindow, NoEventMask);
56
57@@ -289,7 +292,6 @@
58 bool
59 compiz::WindowInputRemover::restore ()
60 {
61-
62 XShapeSelectInput (mDpy, mShapeWindow, NoEventMask);
63
64 if (mRemoved)
65@@ -308,7 +310,11 @@
66 }
67
68 if (mInputRects)
69+ {
70 XFree (mInputRects);
71+ mInputRects = NULL;
72+ mNInputRects = 0;
73+ }
74
75 if (mNBoundingRects)
76 {
77@@ -323,7 +329,11 @@
78 }
79
80 if (mBoundingRects)
81+ {
82 XFree (mBoundingRects);
83+ mBoundingRects = NULL;
84+ mNBoundingRects = 0;
85+ }
86 }
87
88 XShapeSelectInput (mDpy, mShapeWindow, mShapeMask);
89@@ -332,9 +342,5 @@
90
91 sendShapeNotify ();
92
93- mNInputRects = 0;
94- mInputRects = NULL;
95- mNBoundingRects = 0;
96- mBoundingRects = NULL;
97 return true;
98 }
99
100=== modified file 'plugins/unityshell/src/unityshell.cpp'
101--- plugins/unityshell/src/unityshell.cpp 2011-09-28 01:43:32 +0000
102+++ plugins/unityshell/src/unityshell.cpp 2011-09-28 16:34:19 +0000
103@@ -270,9 +270,10 @@
104
105 optionSetAltTabLeftInitiate (boost::bind (&UnityScreen::altTabPrevInitiate, this, _1, _2, _3));
106 optionSetAltTabRightInitiate (boost::bind (&UnityScreen::altTabForwardInitiate, this, _1, _2, _3));
107+ optionSetShowMinimizedWindowsNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
108
109 for (unsigned int i = 0; i < G_N_ELEMENTS(_ubus_handles); i++)
110- _ubus_handles[i] = 0;
111+ _ubus_handles[i] = 0;
112
113 UBusServer* ubus = ubus_server_get_default();
114 _ubus_handles[0] = ubus_server_register_interest(ubus,
115@@ -741,7 +742,7 @@
116
117 if (w->wmType () & (CompWindowTypeDesktopMask |
118 CompWindowTypeDockMask))
119- return false;
120+ return false;
121
122 if (w->state () & CompWindowStateSkipPagerMask)
123 return false;
124@@ -822,7 +823,7 @@
125
126 void UnityShowdesktopHandler::paintAttrib (GLWindowPaintAttrib &attrib)
127 {
128- attrib.opacity = attrib.opacity * mProgress;
129+ attrib.opacity = static_cast <int> (static_cast <float> (attrib.opacity) * mProgress);
130 }
131
132 unsigned int UnityShowdesktopHandler::getPaintMask ()
133@@ -1889,6 +1890,8 @@
134 break;
135 case UnityshellOptions::ShowMinimizedWindows:
136 compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>::setFunctions (optionGetShowMinimizedWindows ());
137+ screen->enterShowDesktopModeSetEnabled (this, optionGetShowMinimizedWindows ());
138+ screen->leaveShowDesktopModeSetEnabled (this, optionGetShowMinimizedWindows ());
139 break;
140 default:
141 break;