Merge lp:~om26er/ubuntu/oneiric/unity/unity-fix-840285 into lp:~ubuntu-desktop/unity/ubuntu

Proposed by Omer Akram
Status: Rejected
Rejected by: Didier Roche-Tolomelli
Proposed branch: lp:~om26er/ubuntu/oneiric/unity/unity-fix-840285
Merge into: lp:~ubuntu-desktop/unity/ubuntu
Diff against target: 291 lines (+148/-33)
5 files modified
debian/changelog (+6/-0)
plugins/unityshell/src/compizminimizedwindowhandler.h (+4/-30)
plugins/unityshell/src/inputremover.cpp (+132/-0)
plugins/unityshell/src/inputremover.h (+4/-1)
plugins/unityshell/src/minimizedwindowhandler.cpp (+2/-2)
To merge this branch: bzr merge lp:~om26er/ubuntu/oneiric/unity/unity-fix-840285
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Disapprove
Ubuntu Sponsors Pending
Review via email: mp+74854@code.launchpad.net

Description of the change

Backport a fix from trunk where the titlebar of a window becomes "click through" after its raised from minimize.

This branch was backported: https://code.launchpad.net/~smspillaz/unity/unity.stack_debug_fixed_minimized_windows

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Hey Omer,

Too bad, didn't see that merge proposal as first thing I did today was to push a compiz ABI break with an unity rebuild.
Normally, I don't backcport changes from trunk apart from late beta (it's too much of work for few days and we are not in a SRU process. If we start doing that, we will only do that and nothing else…). However, I backported this one on my own seeing the number of people complaining on the french forum :)

So I backported this one. Please, on things you think that should be backported in trunk, ping me on IRC first, that will be way easier. Have to disapprove as a similar backport is already committed, sorry :/

review: Disapprove
Revision history for this message
Omer Akram (om26er) wrote :

no worries, I'll ping you on IRC the next time if anything needed ;-)

Unmerged revisions

565. By Omer Akram

Titlebar is click through after raising a minimized window. (LP: #840285)

564. By Didier Roche-Tolomelli

releasing version 4.14.2-0ubuntu1

563. By Didier Roche-Tolomelli

build-dep on latest libunity-dev for ABI/API break, nux

562. By Didier Roche-Tolomelli

  - unity crashed with AttributeError in reset_unity_compiz_profile(): 'str'
    object has no attribute 'get_string' (LP: #809378)
  - Trying to minimize Unity Dash to make it fit on a 1024x768 screen makes
    Unity freeze and then, after I log out by killing X, never start again
    (LP: #839200)
  - unity-panel-service crashed with SIGSEGV in main_arena() (LP: #817477)
  - UIFe: Panel - Indicators should be orderable regardless of their parent
    IndicatorObject (LP: #823061)
  - 'Show Desktop' fails to hand focus to desktop (LP: #836315)
  - Dash - Functionality of top left close, minimise and maximise/restore
    window decorations is confused (LP: #838875)
  - unity-panel-service Leaks Memory (LP: #779185)
  - Missing lens shortcuts (Super-A, Super-F) (LP: #834078)
  - Unity window switcher takes over <alt> key (LP: #835699)
  - update assets for window buttons (topleft) with dash opened
    (LP: #836655)
  - Where the average background colour is either very light or dark, adjust
    this value to darken/lighten in order to preserve readability
    (LP: #837993)
  - Applications don't have priority over other results (LP: #839518)
  - task tray icons are misaligned and badly sized (LP: #839354)
  - UIFe: Dash - Shape and positioning of most of the elements in the Dash
    need adjustment (LP: #841945)
  - Cannot drag applications from dash to desktop (LP: #756614)
  - systray icons still visible on each desktop in expo mode (LP: #759129)
  - transparency on unity panel broken (LP: #827012)
  - Window buttons and application menu don't autohide if left edge is
    touched (LP: #835637)
  - 'Filter results' should be right indented as in the mockups(and unity-
    2d) (LP: #838118)
  - window title should not appear until cursor leaves the menubar
    (LP: #838759)
  - Window title is not redrawn on leaving global-menu from buttons
    (LP: #839488)
  - In the dash, main text field can not be edited, except at the end
    (LP: #840862)
  - Quicklist can't be correctly hidden (LP: #843425)
  - After double clicking on the panel to restore a window, the menus won't
    be hidden on mouse-out (LP: #838021)
  - After restoring a window the application title doesn't fade-out and it
    goes below the menus (LP: #838479)

561. By Didier Roche-Tolomelli

* debian/rules:
  - bump shlibs, remove tweak for garantuing the version as the ABI
    is considered stable until finale now.

560. By Didier Roche-Tolomelli

build-dep on latest libunity-dev, nux

559. By Didier Roche-Tolomelli

* debian/control:
  - build-dep on latest libunity-dev

558. By Didier Roche-Tolomelli

New upstream release.

557. By Didier Roche-Tolomelli

releasing version 4.12.0-0ubuntu2

556. By Didier Roche-Tolomelli

releasing version 4.12.0-0ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-09-08 18:07:52 +0000
3+++ debian/changelog 2011-09-09 18:34:27 +0000
4@@ -1,3 +1,9 @@
5+unity (4.14.2-0ubuntu2) oneiric; urgency=low
6+
7+ * Titlebar is click through after raising a minimized window. (LP: #840285)
8+
9+ -- Omer Akram <om26er@ubuntu.com> Fri, 09 Sep 2011 23:18:27 +0500
10+
11 unity (4.14.2-0ubuntu1) oneiric; urgency=low
12
13 * New upstream release.
14
15=== modified file 'plugins/unityshell/src/compizminimizedwindowhandler.h'
16--- plugins/unityshell/src/compizminimizedwindowhandler.h 2011-09-02 14:32:40 +0000
17+++ plugins/unityshell/src/compizminimizedwindowhandler.h 2011-09-09 18:34:27 +0000
18@@ -37,7 +37,6 @@
19 PrivateCompizMinimizedWindowHandler () {};
20
21 CompWindow *mWindow;
22- WindowInputRemover *clientInputRemover;
23 };
24
25 template <typename Screen, typename Window>
26@@ -87,7 +86,6 @@
27 priv = new PrivateCompizMinimizedWindowHandler ();
28
29 priv->mWindow = w;
30- priv->clientInputRemover = NULL;
31
32 }
33
34@@ -115,33 +113,7 @@
35 void
36 compiz::CompizMinimizedWindowHandler<Screen, Window>::setVisibility (bool visible)
37 {
38- CompWindow::Geometry gm = priv->mWindow->geometry ();
39- MinimizedWindowHandler::setVisibility (visible, ROOTPARENT (priv->mWindow));
40-
41- if (!visible && !priv->clientInputRemover)
42- {
43- priv->clientInputRemover = new compiz::WindowInputRemover (screen->dpy (), priv->mWindow->id ());
44- if (!priv->clientInputRemover)
45- return;
46-
47- if (priv->clientInputRemover->save ())
48- priv->clientInputRemover->remove ();
49- }
50- else if (visible && priv->clientInputRemover)
51- {
52- priv->clientInputRemover->restore ();
53-
54- delete priv->clientInputRemover;
55- priv->clientInputRemover = NULL;
56- }
57-
58- /* This is a little hack to ensure that the window region gets updated,
59- * because there's no API in core to do that */
60-
61- gm.setBorder (gm.border () + 1);
62- priv->mWindow->resize (gm);
63- gm.setBorder (gm.border () - 1);
64- priv->mWindow->resize (gm);
65+ MinimizedWindowHandler::setVisibility (visible, priv->mWindow->id ());
66
67 CompositeWindow::get (priv->mWindow)->addDamage ();
68 GLWindow::get (priv->mWindow)->glPaintSetEnabled (Window::get (priv->mWindow), !visible);
69@@ -285,8 +257,10 @@
70 void
71 compiz::CompizMinimizedWindowHandler<Screen, Window>::handleEvent (XEvent *event)
72 {
73+ /* Ignore sent events from the InputRemover */
74 if (screen->XShape () && event->type ==
75- screen->shapeEvent () + ShapeNotify)
76+ screen->shapeEvent () + ShapeNotify &&
77+ !event->xany.send_event)
78 {
79 CompWindow *w = screen->findWindow (((XShapeEvent *) event)->window);
80
81
82=== modified file 'plugins/unityshell/src/inputremover.cpp'
83--- plugins/unityshell/src/inputremover.cpp 2011-09-02 14:32:40 +0000
84+++ plugins/unityshell/src/inputremover.cpp 2011-09-09 18:34:27 +0000
85@@ -20,6 +20,7 @@
86 */
87
88 #include "inputremover.h"
89+#include <X11/Xregion.h>
90 #include <cstdio>
91
92 compiz::WindowInputRemover::WindowInputRemover (Display *dpy,
93@@ -43,6 +44,132 @@
94 restore ();
95 }
96
97+void
98+compiz::WindowInputRemover::sendShapeNotify ()
99+{
100+ /* Send a synthetic ShapeNotify event to the root window
101+ * since we ignored shape events when setting visibility
102+ * in order to avoid cycling in the shape handling code -
103+ * ignore the sent shape notify event since that will
104+ * be send_event = true */
105+
106+ XShapeEvent xsev;
107+ XEvent *xev = (XEvent *) &xsev;
108+ Window rootReturn, parentReturn;
109+ Window childReturn;
110+ Window *children;
111+ int x, y, xOffset, yOffset;
112+ unsigned int width, height, depth, border, nchildren;
113+ int shapeEvent, shapeError, shapeMask;
114+
115+ /* FIXME: roundtrip */
116+ XShapeQueryExtension (mDpy, &shapeEvent, &shapeError);
117+ shapeMask = XShapeInputSelected (mDpy, mShapeWindow);
118+
119+ xev->type = shapeEvent + ShapeNotify;
120+ xsev.window = mShapeWindow;
121+
122+ if (!mRemoved)
123+ {
124+ /* FIXME: these roundtrips suck */
125+ XGetGeometry (mDpy, mShapeWindow, &rootReturn, &x, &y, &width, &height, &depth, &border);
126+ XQueryTree (mDpy, mShapeWindow, &rootReturn, &parentReturn, &children, &nchildren);
127+
128+ /* We need to translate the co-ordinates of the origin to the
129+ * client window to its parent to find out the offset of its
130+ * position so that we can subtract that from the final bounding
131+ * rect of the window shape according to the Shape extension
132+ * specification */
133+
134+ XTranslateCoordinates (mDpy, mShapeWindow, parentReturn, 0, 0, &xOffset, &yOffset, &childReturn);
135+
136+ xev->type = ShapeBounding;
137+
138+ /* Calculate extents of the bounding shape */
139+ if (!mNBoundingRects)
140+ {
141+ /* No set input shape, we must use the client geometry */
142+ xsev.x = x - xOffset;
143+ xsev.y = y - yOffset;
144+ xsev.width = width;
145+ xsev.height = height;
146+ xsev.shaped = false;
147+ }
148+ else
149+ {
150+ Region boundingRegion = XCreateRegion ();
151+
152+ for (int i = 0; i < mNBoundingRects; i++)
153+ XUnionRectWithRegion (&(mBoundingRects[i]), boundingRegion, boundingRegion);
154+
155+ xsev.x = boundingRegion->extents.x1 - xOffset;
156+ xsev.y = boundingRegion->extents.y1 - yOffset;
157+ xsev.width = boundingRegion->extents.x2 - boundingRegion->extents.x1;
158+ xsev.height = boundingRegion->extents.y2 - boundingRegion->extents.y1;
159+ xsev.shaped = true;
160+
161+ XDestroyRegion (boundingRegion);
162+ }
163+
164+ xsev.time = CurrentTime;
165+ XSendEvent (mDpy, DefaultRootWindow (mDpy), false, shapeMask, xev);
166+
167+ xev->type = ShapeInput;
168+
169+ /* Calculate extents of the bounding shape */
170+ if (!mNInputRects)
171+ {
172+ /* No set input shape, we must use the client geometry */
173+ xsev.x = x - xOffset;
174+ xsev.y = y - yOffset;
175+ xsev.width = width;
176+ xsev.height = height;
177+ xsev.shaped = false;
178+ }
179+ else
180+ {
181+ Region inputRegion = XCreateRegion ();
182+
183+ for (int i = 0; i < mNInputRects; i++)
184+ XUnionRectWithRegion (&(mInputRects[i]), inputRegion, inputRegion);
185+
186+ xsev.x = inputRegion->extents.x1 - xOffset;
187+ xsev.y = inputRegion->extents.y1 - yOffset;
188+ xsev.width = inputRegion->extents.x2 - inputRegion->extents.x1;
189+ xsev.height = inputRegion->extents.y2 - inputRegion->extents.y1;
190+ xsev.shaped = true;
191+
192+ XDestroyRegion (inputRegion);
193+ }
194+
195+ xsev.time = CurrentTime;
196+ XSendEvent (mDpy, DefaultRootWindow (mDpy), false, shapeMask, xev);
197+
198+ if (children)
199+ XFree (children);
200+ }
201+ else
202+ {
203+ xev->type = ShapeBounding;
204+
205+ xsev.x = 0;
206+ xsev.y = 0;
207+ xsev.width = 0;
208+ xsev.height = 0;
209+ xsev.shaped = true;
210+
211+ xsev.time = CurrentTime;
212+ XSendEvent (mDpy, DefaultRootWindow (mDpy), false, shapeMask, xev);
213+
214+ xev->type = ShapeInput;
215+
216+ /* Both ShapeBounding and ShapeInput are null */
217+
218+ xsev.time = CurrentTime;
219+ XSendEvent (mDpy, DefaultRootWindow (mDpy), false, shapeMask, xev);
220+ }
221+}
222+
223 bool
224 compiz::WindowInputRemover::save ()
225 {
226@@ -111,6 +238,8 @@
227
228 XShapeSelectInput (mDpy, mShapeWindow, ShapeNotify);
229
230+ sendShapeNotify ();
231+
232 mRemoved = true;
233 return true;
234 }
235@@ -125,6 +254,7 @@
236 XShapeCombineRectangles (mDpy, mShapeWindow, ShapeInput, 0, 0,
237 mInputRects, mNInputRects,
238 ShapeSet, mInputRectOrdering);
239+
240 }
241 else
242 {
243@@ -153,6 +283,8 @@
244
245 XShapeSelectInput (mDpy, mShapeWindow, mShapeMask);
246
247+ sendShapeNotify ();
248+
249 mRemoved = false;
250 mNInputRects = 0;
251 mInputRects = NULL;
252
253=== modified file 'plugins/unityshell/src/inputremover.h'
254--- plugins/unityshell/src/inputremover.h 2011-09-01 17:18:02 +0000
255+++ plugins/unityshell/src/inputremover.h 2011-09-09 18:34:27 +0000
256@@ -41,6 +41,9 @@
257 bool restore ();
258
259 private:
260+
261+ void sendShapeNotify ();
262+
263 Display *mDpy;
264 Window mShapeWindow;
265 unsigned long mShapeMask;
266@@ -52,7 +55,7 @@
267 XRectangle *mBoundingRects;
268 int mNBoundingRects;
269 int mBoundingRectOrdering;
270- bool mRemoved;
271+ bool mRemoved;
272
273 };
274 }
275
276=== modified file 'plugins/unityshell/src/minimizedwindowhandler.cpp'
277--- plugins/unityshell/src/minimizedwindowhandler.cpp 2011-08-26 10:37:35 +0000
278+++ plugins/unityshell/src/minimizedwindowhandler.cpp 2011-09-09 18:34:27 +0000
279@@ -58,10 +58,10 @@
280 {
281 priv->mRemover = new compiz::WindowInputRemover (priv->mDpy, shapeWin);
282 if (!priv->mRemover)
283- return;
284+ return;
285
286 if (priv->mRemover->save ())
287- priv->mRemover->remove ();
288+ priv->mRemover->remove ();
289 }
290 else if (visible && priv->mRemover)
291 {

Subscribers

People subscribed via source and target branches

to all changes: