Merge lp:~vanvugt/compiz/fix-928807 into lp:compiz/0.9.9

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3477
Merged at revision: 3478
Proposed branch: lp:~vanvugt/compiz/fix-928807
Merge into: lp:compiz/0.9.9
Diff against target: 51 lines (+10/-3)
1 file modified
gtk/window-decorator/decorator.c (+10/-3)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-928807
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+135081@code.launchpad.net

Commit message

Disable shadows for maximized windows. They only create annoyance and
confusion on adjacent monitors/workspaces. (LP: #928807)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Looks fine implementation wise, just some questions:

8 + /*
9 + * Warning: decor_shadow_create does more than return a decor_shadow_t*
10 + * It also has to be called to populate the context parameter
11 + * (third last parameter). So even if you don't want a shadow
12 + * then you still need to call decor_shadow_create :(
13 + */
14 *shadow_normal = decor_shadow_create (xdisplay,
15 screen,
16 1, 1,

Should we rename decor_shadow_create then? decor_create_shadow_and_pad_context ? Fixing the symbol is probably better than adding a comment

I was going to ask about this:

38 - info, opt_active_shadow, opt_inactive_shadow);
39 + info, opt_active_shadow, &no_shadow);

Then realized that its correct, maybe it might be good to do this:

info,
opt_active_shadow, // for normal windows
&no_shadow, // for maximized windows

Something entirely different to consider would be to clip maximized window shadows on output edges. It still makes sense for them to have shadows in the case of them being transformed etc. Can you try this and see how it works ?

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

I'd rather not rename decor_shadow_create because that would break the libdecoration API and ABI backward-compatibility. It's not worth it just to rename a function.

Yeah I know we used to clip shadows on the other monitors, but I'm trying to avoid any more shadow clipping. Clipping shadows often causes artefacts of some sort like in bug 979252, bug 1061346.

Finally there is the damage region/clipping problem introduced in 0.9.8 with swapbuffers. It means we no longer have the ability to guarantee every redraw is clipped to the damage region like with regional redraws. Every plugin is now responsible for honouring the damage region and ensuring nothing ever draws outside of that. Doing this with shadows I think is overcomplicated considering the potential pay-off (keeping shadows on transformed maximized windows).

I've been thinking about a nice reusable solution to the damage region problem, and separately, how to layer shadows nicely (and more efficiently). However that's off topic here.

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

Okay, lets go with this then.

review: Approve

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 2012-11-12 07:07:38 +0000
3+++ gtk/window-decorator/decorator.c 2012-11-20 08:16:18 +0000
4@@ -911,6 +911,12 @@
5 *shadow_normal = NULL;
6 }
7
8+ /*
9+ * Warning: decor_shadow_create does more than return a decor_shadow_t*
10+ * It also has to be called to populate the context parameter
11+ * (third last parameter). So even if you don't want a shadow
12+ * then you still need to call decor_shadow_create :(
13+ */
14 *shadow_normal = decor_shadow_create (xdisplay,
15 screen,
16 1, 1,
17@@ -954,7 +960,7 @@
18 frame->max_win_extents.top + frame->max_titlebar_height -
19 TRANSLUCENT_CORNER_SIZE,
20 frame->max_win_extents.bottom - TRANSLUCENT_CORNER_SIZE,
21- opt_shadow,
22+ opt_no_shadow, /* No shadow when maximized */
23 context_max,
24 draw_border_shape,
25 (void *) info);
26@@ -976,6 +982,7 @@
27 decor_shadow_options_t *opt_active_shadow,
28 decor_shadow_options_t *opt_inactive_shadow)
29 {
30+ static decor_shadow_options_t no_shadow = {0.0, 0.0, {0, 0, 0}, 0, 0};
31 gwd_decor_frame_ref (frame);
32
33 info->active = TRUE;
34@@ -986,7 +993,7 @@
35 &frame->window_context_active,
36 &frame->max_border_shadow_active,
37 &frame->max_window_context_active,
38- info, opt_active_shadow, opt_inactive_shadow);
39+ info, opt_active_shadow, &no_shadow);
40
41 info->active = FALSE;
42
43@@ -996,7 +1003,7 @@
44 &frame->window_context_inactive,
45 &frame->max_border_shadow_inactive,
46 &frame->max_window_context_inactive,
47- info, opt_inactive_shadow, opt_active_shadow);
48+ info, opt_inactive_shadow, &no_shadow);
49
50 gwd_decor_frame_unref (frame);
51 }

Subscribers

People subscribed via source and target branches