Merge lp:~mar-kolya/compiz/fix-for-1158267 into lp:compiz/0.9.10

Proposed by kolya
Status: Rejected
Rejected by: Christopher Townsend
Proposed branch: lp:~mar-kolya/compiz/fix-for-1158267
Merge into: lp:compiz/0.9.10
Diff against target: 37 lines (+10/-10)
1 file modified
plugins/decor/src/decor.cpp (+10/-10)
To merge this branch: bzr merge lp:~mar-kolya/compiz/fix-for-1158267
Reviewer Review Type Date Requested Status
Christopher Townsend Disapprove
Strelok (community) Needs Fixing
Review via email: mp+167596@code.launchpad.net

Commit message

DecorWindow::update: always initialize wd field if decoration is known. This partly reverts change occured in rev 3633. This seems to fix LP #1158267

Description of the change

It looks like rev 3363 introduced a regression described in LP #1158267. The problem seems to be that DecorWindow::update doesn't always initialize DecorWindow::wd and this seems to be breaking decoration header initialization. This patch fixes the problem.

To post a comment you must log in.
Revision history for this message
Strelok (who-) wrote :

This patch seems to fix LP #1158267, but after that menu shadow disappears in gtk3 applications (Rhythmbox, Zim, gnome-terminal, gedit...)

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

At the moment, I'd prefer to hold any further fixes to the decor plugin until we can get a proper testsuite in place. Unfortunately this code has proven to be ... tricky and regression prone because of very tight behavioral coupling with the rest of compiz. Once the testsuite is in place we'll be able to fix stuff and not worry about missing some other corner case (of which there appear to be *plenty*).

I'm guessing its going to take me about a week before I'm able to start writing it, but I should be able to finish it the day I start it.

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

(So watch this space, but to the other maintainers - please wait about a week before merging this, thanks).

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Will do :), but I think you just got some decor testing into place. Lets revisit this once you've some time and hopefully get some testing around this!

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

Hey kolya,

Thanks for the hints with this one. I figured out that this problem actually occurs for a variety of reasons:

1. Where the WindowDecoration member is reset for windows that already have one set but are temporarily unable to have a WindowDecoration on update for whatever reason (perhaps due to a frame extents request but I'm not sure). The fix for that was similar - just throw out the old WindowDecoration as soon as we figure out that we can allocate a new one or we really want to get rid of it (eg, a null decoration)
2. Where the window was just decorated and the border shape is effectively the same as the
input frame shape. In that case we should just update the frame shape immediately as opposed to going through the server which may not send an event back if there was no effective change.

You can follow the process here:

https://code.launchpad.net/~compiz-team/compiz/compiz.fix_1158267.update-tests/+merge/174661

Revision history for this message
Christopher Townsend (townsend) wrote :

Hi koyla,

Thanks for the work you did on this. However, Sam's branch listed in the last comment is what we are going to use for this bug.

That said, I'm going to reject this branch, but if you ever feel you want to contribute to Compiz (or any other project for that matter), please don't hesitate.

review: Disapprove
Revision history for this message
kolya (mar-kolya) wrote :

I'm glad that this bug is finally getting proper fix! :)

Unmerged revisions

3734. By kolya

DecorWindow::update: always initialize wd field if decoration is known. This partly reverts change occured in rev 3633. This seems to fix LP #1158267

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/decor/src/decor.cpp'
2--- plugins/decor/src/decor.cpp 2013-05-20 15:26:11 +0000
3+++ plugins/decor/src/decor.cpp 2013-06-05 16:31:41 +0000
4@@ -1707,6 +1707,16 @@
5 */
6 if (decoration)
7 {
8+ wd = WindowDecoration::create (decoration);
9+ if (!wd)
10+ {
11+ /* Error condition, reset frame extents */
12+ CompWindowExtents emptyExtents;
13+ memset (&emptyExtents, 0, sizeof (CompWindowExtents));
14+ window->setWindowFrameExtents (&emptyExtents, &emptyExtents);
15+ return false;
16+ }
17+
18 /* Set extents based on maximize/unmaximize state
19 * FIXME: With the new type system, this should be
20 * removed */
21@@ -1721,16 +1731,6 @@
22 if (decorate ||
23 shadowOnly)
24 {
25- wd = WindowDecoration::create (decoration);
26- if (!wd)
27- {
28- /* Error condition, reset frame extents */
29- CompWindowExtents emptyExtents;
30- memset (&emptyExtents, 0, sizeof (CompWindowExtents));
31- window->setWindowFrameExtents (&emptyExtents, &emptyExtents);
32- return false;
33- }
34-
35 movement = cwe::shift (window->border (), window->sizeHints ().win_gravity);
36
37 sizeDelta = CompSize (-(window->border ().left +

Subscribers

People subscribed via source and target branches