Merge lp://qastaging/~smspillaz/unity/unity.fix_851964 into lp://qastaging/unity

Proposed by Sam Spilsbury
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 3161
Proposed branch: lp://qastaging/~smspillaz/unity/unity.fix_851964
Merge into: lp://qastaging/unity
Diff against target: 774 lines (+520/-77)
6 files modified
plugins/unityshell/src/inputremover.cpp (+422/-59)
plugins/unityshell/src/inputremover.h (+48/-1)
plugins/unityshell/src/minimizedwindowhandler.cpp (+1/-0)
plugins/unityshell/src/unityshell.cpp (+35/-4)
tests/test-input-remover/test-input-remover.cpp (+1/-1)
tests/test-minimize-window-handler/test-minimize-handler.cpp (+13/-12)
To merge this branch: bzr merge lp://qastaging/~smspillaz/unity/unity.fix_851964
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
PS Jenkins bot continuous-integration Pending
Unity Team Pending
Review via email: mp+147510@code.qastaging.launchpad.net

Commit message

Save the saved input shape to a window property, so if compiz crashes
we can still recover the minimized window.

Also fixed a crash in the tests.

(LP: #851964)

Description of the change

Save the saved input shape to a window property, so if compiz crashe
we can still recover the minimized window.

Also fixed a crash in the tests.

(LP: #851964)

Unfortunately I'm not able to provide a set of tests for this change, my time is quite limited and the amount of effort required to get the relevant codebase under automated test would be quite large. Given the current circumstances, its not worth doing that.

The code can be checked for regressions by running the test-minimize-handler and test-input-remover tools provided in tests/ already. They don't use an xUnit framework at the moment, so there isn't much of a chance to integrate them into our broader check targets.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Ok I'm testing it using these branches:

branches["unity"]="lp:~smspillaz/unity/unity.fix_851964"
branches["compiz"]="lp:~compiz-team/compiz/compiz.fix_729979.1"

And I see two main issues here:
[a] Initially minimized windows fail to unminimize at first click. A second click fix the issue.
[b] When I close a window the launcher pip that indicate the focused window does not go away.

Can you reproduce these problems too?

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

On Mon, Feb 11, 2013 at 10:17 PM, Andrea Azzarone <email address hidden> wrote:
> Ok I'm testing it using these branches:
>
> branches["unity"]="lp:~smspillaz/unity/unity.fix_851964"
> branches["compiz"]="lp:~compiz-team/compiz/compiz.fix_729979.1"
>
> And I see two main issues here:
> [a] Initially minimized windows fail to unminimize at first click. A second click fix the issue.
> [b] When I close a window the launcher pip that indicate the focused window does not go away.
>
> Can you reproduce these problems too?

You need to use unity.fix_1091600 in combination with
compiz.fix_729979.1, otherwise you'll get wrong behaviour in relation
to how bounding shapes are handled.

Needless to say the problems you are experiencing don't seem related
to what these branches are doing. I can recompile and check, but that
will take me about three or four hours because of the slow compile
time and my (lack of) disk space. These sound like trunk problems to
me - can you check?

> --
> https://code.launchpad.net/~smspillaz/unity/unity.fix_851964/+merge/147510
> You are the owner of lp:~smspillaz/unity/unity.fix_851964.

--
Sam Spilsbury

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Hey Andrea,

I've tested this again for the two things you identified. As far as I can tell, they aren't problems until unity is restarted (eg xterm -iconic) works fine. After unity is restarted, I can reproduce [a], but not [b].

I've put a check in place to ensure that we only temporarily re-minimize the window in case we were recovering from an unexpected exit.

To be honest, I think [a] is not really worth looking into. I think it is outside the scope of this proposal (as it goes into the fake minimization code, and not the input shape handling code), and it is a very small edge case with a mostly insignificant effect.

The best approach really would be to change the "unity" shellscript to not kill compiz on --replace. That way, you'll only ever run into this behaviour if we're recovering from a crash.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

15 +namespace
16 +{
17 +const unsigned int propVersion = 1;
18 +
19 +void CheckRectanglesCount(XRectangle *rects,
20 + int *count,
21 + unsigned int width,
22 + unsigned int height,
23 + unsigned int border)

Why about using c++ references for count (I mean int& count)?

97 + if (queryProperty(&iRects, &iCount, &iOrdering,
98 + &bRects, &bCount, &bOrdering))
99 + {
100 + bool rectangles_restored = false;
101 + unsigned int width, height, border;
102 +
103 + if (CheckWindowExists(mDpy, mShapeWindow, &width, &height, &border))
104 + if (checkRectangles(iRects, &iCount, iOrdering,
105 + bRects, &bCount, bOrdering,
106 + width, height, border))
107 + if (saveRectangles(iRects, iCount, iOrdering,
108 + bRects, bCount, bOrdering))
109 + {
110 + /* Tell the shape restore engine that we've got a removed
111 + * input shape here */
112 + mRemoved = true;
113 + if (restoreInput())
114 + rectangles_restored = true;
115 + }
116 +
117 + /* Something failed and we couldn't restore the
118 + * rectangles. Don't leak them */
119 + if (!rectangles_restored)
120 + {
121 + free (iRects);d
122 + free (bRects);
123 + }
124 + }

Using more braces should improve readability here.

Also code does not respect our style guide but it's not blocking for me.

Still have problem [a] but in this case trunk just draws a blank window (or fails to un-minimize the window). So +1 from me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.