Merge lp:~smspillaz/compiz-core/compiz-core.fix_924736.2 into lp:compiz-core

Proposed by Sam Spilsbury
Status: Rejected
Rejected by: Sam Spilsbury
Proposed branch: lp:~smspillaz/compiz-core/compiz-core.fix_924736.2
Merge into: lp:compiz-core
Diff against target: 122 lines (+50/-7)
4 files modified
gtk/window-decorator/decorator.c (+1/-1)
gtk/window-decorator/events.c (+4/-0)
gtk/window-decorator/settings.c (+10/-3)
plugins/decor/src/decor.cpp (+35/-3)
To merge this branch: bzr merge lp:~smspillaz/compiz-core/compiz-core.fix_924736.2
Reviewer Review Type Date Requested Status
Daniel van Vugt Needs Fixing
Review via email: mp+92727@code.launchpad.net

Description of the change

Only clip shadows based on windows underneath and only clip if the window is adjacent
and not overlapping (this way you can have two semi maximized windows right next to each
other and not have them cast shadows)

Also update the window decoration state and actions when the window is redecorated

Fix typo that would cause active maximized windows to not get shadows

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The shadows seem fixed. However the window borders are still lost when semi-maximized as described in the bug;
"Semi-maximized windows also seem to not have any border (as if they think they are fully maximized)."

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

> The shadows seem fixed. However the window borders are still lost when semi-
> maximized as described in the bug;
> "Semi-maximized windows also seem to not have any border (as if they think
> they are fully maximized)."

Does this only happen with the unity plugin enabled or does it happen without? I have an impression
that this might be a recent regression in the unity plugin. (Can't test right now, am out)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm not testing with Unity at all. It happens with just plain old lp:compiz-core.

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

hmmm....

Are you running a custom theme or something? What happens when you run ./gtk-window-decorator --metacity-theme (some-garbage) to force the cairo mode?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm using the standard theme (Ambiance) in a standard oneiric installation. I haven't changed any defaults.

Sorry, I can't test --metacity-theme right now. Too much other building/testing to do.

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

ok.

2999. By Sam Spilsbury

Use a default value for the draggable border width if the mutter key doesn't exist

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

Took me ages to figure out what people meant when they talked about "borders". I usually think in terms of "invisible grab area" or the like.

The draggable border seems to work fine, actually, on semi maximized windows, but it would have been disabled by default if you didn't have mutter installed since we integrate with those keys. I've detected that case and added a default for now. Please test.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sorry I didn't notice the new revision 3 hours ago. Probably because it wasn't resubmitted formally and I didn't get a review-request email at all. Now testing...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Still not fixed in r2999. The 1-pixel border is still missing when semi-maximized:
https://launchpadlibrarian.net/92797648/semi-maximized.png

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Hmm, hang on. You're talking about the 1px border for semi-maximized windows.

They're supposed to use the maximized window decorations iirc. I'll double check with John today. In that case the lack of the 1px border would be a light-themes thing.

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

(Incidentally, we actually tried a while ago to remove all visible side borders from all windows, but this obviously didn't fly in the case of, eg, metacity, which doesn't support this feature)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I understand why design might want to remove visible borders (like OSX?). But to only do so for semi-maximized windows is certainly a bug. That's what is fixed here:
https://code.launchpad.net/~vanvugt/compiz-core/fix-924736/+merge/93342

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

> I understand why design might want to remove visible borders (like OSX?). But
> to only do so for semi-maximized windows is certainly a bug. That's what is
> fixed here:
> https://code.launchpad.net/~vanvugt/compiz-core/fix-924736/+merge/93342

It is possible to re-size the window still using the invisible border :)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Well if it's not a bug then that should be stated here --> bug 924736
and this branch should have been merged already :)

If you want it to look like oneiric however (which I think is right) then use this instead:
https://code.launchpad.net/~vanvugt/compiz-core/fix-924736/+merge/93342

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

Alright the verdict is in.

1. Should show rounded corners (but ideally square corners on monitor edges and rounded corners in the middle)
2. Should show restore button on semi maximized windows
3. Should not cast shadows on to each other

So needs work for now. I'll roll your changes into mine and that will tackle item 1, I have a rough idea about item 2, item 3 is done.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

No shadows for a window that is not fully maximized and can be stacked any-which-way? Sounds like a misunderstanding.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

How about we fix the simple bug, and make it look like oneiric with this:
   https://code.launchpad.net/~vanvugt/compiz-core/fix-924736/+merge/93342
then worry about the new look as dictated by design separately?

Anyway, I'm logging off now. Trying to avoid working 4 nights in a row.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Do we still need this branch given bug 924736 is already fixed?

If so, could you please provide a pointer to the new design spec/bug (other than #924736) that this change is related to?

Revision history for this message
Daniel van Vugt (vanvugt) :
review: Needs Information
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

<JohnLea> to answer the 2nd question first, no, semi-maximised windows should not cast shadows
                on each other
<JohnLea> also both maximised and semi-maximised windows should not cast shadows on to
                adjacent monitors

As for the other stuff -

8 - &frame->max_border_shadow_inactive,
9 + &frame->max_border_shadow_active,

That is a typo that needs to be fixed

21 + update_window_decoration_state (win);
22 + update_window_decoration_actions (win);
23 + update_window_decoration_icon (win);

That was causing quickly demaximized windows to retain maximized decorations

40 + if (gconf_client_dir_exists (client, "/apps/mutter/general", NULL))
41 + {
42 + new_width = gconf_client_get_int (client,
43 + MUTTER_DRAGGABLE_BORDER_WIDTH_KEY,
44 + NULL);
45 + }
46 + else
47 + {
48 + new_width = 7;
49 + }

That was causing no draggable border

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, I have re-tested this branch and compared it to lp:compiz-core. There are a few problems however, with at least 2 regressions introduced by this branch...

1. The fix to make semi-maximized windows not cast shadows on each other mostly works, but causes shadow-like artifacts appear when you slowly hover the mouse over the common border between the windows.

2. Using lp:compiz-core, maximized windows do not cast shadows on adjacent monitors at all. That bug has seemingly already been fixed since oneiric. However this branch reintroduces that bug and causes adjacent monitors to show the shadow of maximized windows.

3. The branch name is misleading because it actually has nothing to do with "924736" any more.

Please log a bug for #1, fix #1 & #2, and resubmit using a more accurate branch name to resolve #3.

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

On Mon, 20 Feb 2012, Daniel van Vugt wrote:

> Review: Needs Fixing
>
> OK, I have re-tested this branch and compared it to lp:compiz-core. There are a few problems however, with at least 2 regressions introduced by this branch...
>
> 1. The fix to make semi-maximized windows not cast shadows on each other mostly works, but causes shadow-like artifacts appear when you slowly hover the mouse over the common border between the windows.
>

ack

> 2. Using lp:compiz-core, maximized windows do not cast shadows on adjacent monitors at all. That bug has seemingly already been fixed since oneiric. However this branch reintroduces that bug and causes adjacent monitors to show the shadow of maximized windows.
>

The problem was that maximized windows were not casting shadows /at all/.
This in itself was a bug[tm]

> 3. The branch name is misleading because it actually has nothing to do with "924736" any more.
>

ack

> Please log a bug for #1, fix #1 & #2, and resubmit using a more accurate branch name to resolve #3.
>
>
> --
> https://code.launchpad.net/~smspillaz/compiz-core/compiz-core.fix_924736.2/+merge/92727
> You are the owner of lp:~smspillaz/compiz-core/compiz-core.fix_924736.2.
>

Unmerged revisions

2999. By Sam Spilsbury

Use a default value for the draggable border width if the mutter key doesn't exist

2998. By Sam Spilsbury

  Only clip shadows based on windows underneath and only clip if the window is adjacent
  and not overlapping (this way you can have two semi maximized windows right next to each
  other and not have them cast shadows)

  Also update the window decoration state and actions when the
  window is redecorated

  Fix typo that would cause active maximized windows to not get shadows

  Fixes LP #924736

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/window-decorator/decorator.c'
2--- gtk/window-decorator/decorator.c 2011-10-13 11:31:37 +0000
3+++ gtk/window-decorator/decorator.c 2012-02-16 02:06:18 +0000
4@@ -936,7 +936,7 @@
5 gdk_x11_screen_get_xscreen (gdk_screen_get_default ()),
6 frame, &frame->border_shadow_active,
7 &frame->window_context_active,
8- &frame->max_border_shadow_inactive,
9+ &frame->max_border_shadow_active,
10 &frame->max_window_context_active,
11 info, opt_active_shadow, opt_inactive_shadow);
12
13
14=== modified file 'gtk/window-decorator/events.c'
15--- gtk/window-decorator/events.c 2012-02-10 10:23:27 +0000
16+++ gtk/window-decorator/events.c 2012-02-16 02:06:18 +0000
17@@ -1011,7 +1011,11 @@
18
19 d->frame = gwd_get_decor_frame (get_frame_type (win));
20
21+ update_window_decoration_state (win);
22+ update_window_decoration_actions (win);
23+ update_window_decoration_icon (win);
24 update_window_decoration_size (win);
25+
26 update_event_windows (win);
27 }
28 else
29
30=== modified file 'gtk/window-decorator/settings.c'
31--- gtk/window-decorator/settings.c 2011-10-13 12:22:14 +0000
32+++ gtk/window-decorator/settings.c 2012-02-16 02:06:18 +0000
33@@ -154,9 +154,16 @@
34 int new_width;
35 int width = settings->mutter_draggable_border_width;
36
37- new_width = gconf_client_get_int (client,
38- MUTTER_DRAGGABLE_BORDER_WIDTH_KEY,
39- NULL);
40+ if (gconf_client_dir_exists (client, "/apps/mutter/general", NULL))
41+ {
42+ new_width = gconf_client_get_int (client,
43+ MUTTER_DRAGGABLE_BORDER_WIDTH_KEY,
44+ NULL);
45+ }
46+ else
47+ {
48+ new_width = 7;
49+ }
50
51 if (new_width != width)
52 {
53
54=== modified file 'plugins/decor/src/decor.cpp'
55--- plugins/decor/src/decor.cpp 2012-02-09 07:48:57 +0000
56+++ plugins/decor/src/decor.cpp 2012-02-16 02:06:18 +0000
57@@ -107,8 +107,6 @@
58
59 for (it--; it != screen->windows ().end (); it--)
60 {
61- CompRegion inter;
62-
63 if (!(*it)->isViewable ())
64 continue;
65
66@@ -121,7 +119,7 @@
67 if (!isAncestorTo (window, (*it)))
68 continue;
69
70- inter = shadowRegion.intersected ((*it)->borderRect ());
71+ CompRegion inter = shadowRegion.intersected ((*it)->borderRect ());
72
73 if (!inter.isEmpty ())
74 shadowRegion = shadowRegion.subtracted (inter);
75@@ -151,6 +149,32 @@
76 shadowRegion = shadowRegion.subtracted (area);
77 }
78 }
79+ else if (window->state () & MAXIMIZE_STATE)
80+ {
81+ shadowRegion = shadowRegion.intersected (screen->region ());
82+
83+ CompWindowVector::const_iterator it = std::find (screen->clientList ().begin (),
84+ screen->clientList ().end (),
85+ window);
86+ CompWindowVector::const_reverse_iterator rit (it);
87+
88+ for (; rit != screen->clientList ().rend (); rit++)
89+ {
90+ if (!((*rit)->state () & MAXIMIZE_STATE))
91+ continue;
92+
93+ /* Only care about windows that logically overlap
94+ * the shadow, but aren't actually obscured by this window */
95+ if (window->borderRect ().intersects ((*rit)->borderRect ()))
96+ continue;
97+
98+ CompRegion clippable = shadowRegion - CompRegion (window->borderRect ());
99+ CompRegion inter = clippable.intersected ((*rit)->borderRect ());
100+
101+ if (!inter.isEmpty ())
102+ shadowRegion = shadowRegion.subtracted (inter);
103+ }
104+ }
105 }
106
107 /*
108@@ -2229,6 +2253,14 @@
109 unshading = true;
110 shading = false;
111 break;
112+ case CompWindowNotifyRestack:
113+ if (dScreen->cmActive)
114+ {
115+ foreach (CompWindow *cw, DecorScreen::get (screen)->cScreen->getWindowPaintList ())
116+ {
117+ DecorWindow::get (cw)->computeShadowRegion ();
118+ }
119+ }
120 default:
121 break;
122 }

Subscribers

People subscribed via source and target branches