After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744667 - Shadow is too light for non-CSD windows
Shadow is too light for non-CSD windows
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 774313 (view as bug list)
Depends on:
Blocks: 763798
 
 
Reported: 2015-02-17 15:45 UTC by Eddy Castillo
Modified: 2021-07-05 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Border nautilus and firefox (6.90 KB, image/png)
2015-02-17 15:45 UTC, Eddy Castillo
  Details
Same shadow in different windows (1.18 KB, patch)
2016-10-27 09:50 UTC, Maxim
none Details | Review
window-actor: Stop adding shadows to windows with frames (1.20 KB, patch)
2016-10-27 12:27 UTC, Florian Müllner
none Details | Review
theme: Drop ssd-specific shadows (2.10 KB, patch)
2016-10-27 12:42 UTC, Florian Müllner
none Details | Review
shaped-texture: Only mask alpha channel (1.39 KB, patch)
2016-10-28 15:11 UTC, Florian Müllner
needs-work Details | Review
ui: Render frame in mask as well (1.70 KB, patch)
2016-10-28 15:11 UTC, Florian Müllner
none Details | Review
theme: Consider frame borders in titlebar (1.35 KB, patch)
2016-10-28 15:11 UTC, Florian Müllner
none Details | Review
window-actor: Update mask on focus changes (1.18 KB, patch)
2016-10-28 15:11 UTC, Florian Müllner
none Details | Review
window-actor: Use different shape_regions/masks based on focus state (6.69 KB, patch)
2016-10-28 15:11 UTC, Florian Müllner
none Details | Review
window-actor: Only recompute shape region and mask if necessary (3.30 KB, patch)
2016-10-28 15:11 UTC, Florian Müllner
none Details | Review
window-actor: Stop adding shadows to windows with frames (1.20 KB, patch)
2016-10-28 15:11 UTC, Florian Müllner
none Details | Review
theme: Update style classes to match CSD decorations (1.12 KB, patch)
2016-10-28 15:12 UTC, Florian Müllner
none Details | Review
Update shadows to match Adwaita better (2.13 KB, patch)
2017-02-01 16:01 UTC, Juraj Fiala
none Details | Review
Update shadows to match Adwaita better (2.19 KB, patch)
2017-02-01 16:42 UTC, Juraj Fiala
committed Details | Review
window-actor: Special-case COMBO window's shadow class (1.23 KB, patch)
2017-02-01 17:36 UTC, Florian Müllner
committed Details | Review

Description Eddy Castillo 2015-02-17 15:45:09 UTC
Created attachment 297028 [details]
Border nautilus and firefox

This issue is similar to bug 707448, but with the removal of metacity decorations on 3.16 I thought it would need a different bug report.

Shadows for non-CSD windows are too light/small when compared to those of CSD windows. See attachment.
Comment 1 Juraj Fiala 2015-12-29 18:42:47 UTC
This should have a higher priority IMHO. Sometimes it's hard to distinguish windows because of this bug.
Comment 2 Juraj Fiala 2016-06-26 18:08:09 UTC
Since the gtk3 version of Adwaita was moved into gtk+, these bugs belong there.
Comment 3 Lapo Calamandrei 2016-07-26 17:20:35 UTC
Moving to mutter, since the shadow of non csd windows is hardcoded.
Comment 4 Maxim 2016-10-27 09:50:25 UTC
Created attachment 338591 [details] [review]
Same shadow in different windows

I suggest to try this patch.

Also see my comparsion screenshot.
http://storage3.static.itmages.ru/i/16/1027/h_1477561514_2414847_90d42bcd9f.png

It looks almost identical between CSD and non-CSD windows. Why not use something like this?
Comment 5 Lapo Calamandrei 2016-10-27 12:09:46 UTC
That looks pretty good, I'd really like mutter to just pick the shadow from the css though.
Comment 6 Florian Müllner 2016-10-27 12:27:20 UTC
Created attachment 338603 [details] [review]
window-actor: Stop adding shadows to windows with frames

The frame decorations can pick up the shadow as defined by the GTK+
theme.

(In reply to Lapo Calamandrei from comment #5)
> That looks pretty good, I'd really like mutter to just pick the shadow from
> the css though.

This would be all that's required on the mutter side for that. On the GTK+ side, the theme would need to add a shadow to server-side decorated windows like it does for client-side decorated ones ...
Comment 7 Florian Müllner 2016-10-27 12:42:06 UTC
Created attachment 338604 [details] [review]
theme: Drop ssd-specific shadows

Mutter no longer adds its own shadows to decorated windows, so the theme
should provide the same shadows it does for client-side decorations.
Comment 8 Juraj Fiala 2016-10-27 13:08:48 UTC
I'm getting a bit confused here though. What about GTK+ 2 or Qt?
Comment 9 Lapo Calamandrei 2016-10-27 13:10:36 UTC
Thanks Florian, adwaita patch looks good to me, feel free to push it.
Comment 10 Maxim 2016-10-27 13:17:38 UTC
(In reply to Florian Müllner from comment #7)
> Created attachment 338604 [details] [review] [review]
> theme: Drop ssd-specific shadows
> 
> Mutter no longer adds its own shadows to decorated windows, so the theme
> should provide the same shadows it does for client-side decorations.

But now there is no dofference between focused/unfocused
http://storage5.static.itmages.ru/i/16/1027/h_1477574185_8944394_f5d39a98bb.png
Comment 11 Juraj Fiala 2016-10-27 13:26:20 UTC
Florian, does this have a chance to get backported? It's like the biggest usability/visual defect of gtk2.
Comment 12 Lapo Calamandrei 2016-10-27 16:59:05 UTC
Maxim, probably Adwaita's fault, lemme see.
Comment 13 Lapo Calamandrei 2016-10-27 17:01:20 UTC
Nope, Adwaita looks correct, Florian?
Comment 14 Florian Müllner 2016-10-27 19:15:37 UTC
Yeah, mutter's fault - I figured it out, but I'll go home before writing a proper commit message and attaching a patch ...
Comment 15 Florian Müllner 2016-10-28 15:10:14 UTC
(In reply to Florian Müllner from comment #14)
> Yeah, mutter's fault - I figured it out, but I'll go home before writing a
> proper commit message and attaching a patch ...

So I did some optimizations first to make the performance impact not quite as bad.

The first three patches are just drive-by fixes while working on theme stuff.
Comment 16 Florian Müllner 2016-10-28 15:11:04 UTC
Created attachment 338728 [details] [review]
shaped-texture: Only mask alpha channel

We currently apply the mask texture to any channel, which means
elements drawn outside the actual decorations are blended with
gray. This should hardly matter in practice where shadows can
be expected to be some shade of gray, but let's still make sure
the odd theme with pink shadows or the like works correctly by
applying the alpha mask to the alpha channel only.
Comment 17 Florian Müllner 2016-10-28 15:11:11 UTC
Created attachment 338729 [details] [review]
ui: Render frame in mask as well

The theme may render bits of the frame that are outside the rendered
area of the background, so don't skip it when painting the frame mask.
Comment 18 Florian Müllner 2016-10-28 15:11:18 UTC
Created attachment 338730 [details] [review]
theme: Consider frame borders in titlebar

We currently use the entire top border area to paint the titlebar,
ignoring the frame border set by the theme. Fix this.
Comment 19 Florian Müllner 2016-10-28 15:11:27 UTC
Created attachment 338731 [details] [review]
window-actor: Update mask on focus changes

We currently assume that the frame mask and -shape don't change with the
focus style. This is reasonable for the actual decoration, but not for
the window shadow that is expected to be more pronounced when focused.
We will eventually let the GTK+ theme draw the shadow of regular windows,
so update shape region and frame mask on focus changes.
Comment 20 Florian Müllner 2016-10-28 15:11:34 UTC
Created attachment 338732 [details] [review]
window-actor: Use different shape_regions/masks based on focus state

We now update the frame mask and -shape on every focus change, which
is expensive and wasteful if we recompute the same two regions over
and over again. To address this, use different regions/masks based on
the focus state, so that we'll be able to re-use a previously computed
one if possible.
Comment 21 Florian Müllner 2016-10-28 15:11:41 UTC
Created attachment 338733 [details] [review]
window-actor: Only recompute shape region and mask if necessary

Rather than recomputing shape region and mask on every focus change,
re-use the previously computed ones if possible.
Comment 22 Florian Müllner 2016-10-28 15:11:52 UTC
Created attachment 338734 [details] [review]
window-actor: Stop adding shadows to windows with frames

The frame decorations can pick up the shadow as defined by the GTK+
theme.
Comment 23 Florian Müllner 2016-10-28 15:12:00 UTC
Created attachment 338735 [details] [review]
theme: Update style classes to match CSD decorations

We currently use the "ssd" style class instead of "csd", so themes
can avoid adding a window shadow to windows that already got a shadow
from the compositor. Now that we no longer add a shadow to regular
windows, we should ask for the appropriate style.
Comment 24 Florian Müllner 2016-10-28 15:17:09 UTC
The patches are also on wip/fmuellner/gtk-shadows, no gtk+ changes required (as gtk+-3 is supposed to be "pixel-stable" now, I'm not sure the theme change should go on the stable branch anyway ...)
Comment 25 Lapo Calamandrei 2016-10-28 17:12:58 UTC
Thanks Florian! Yup, better not to break themes, you may merge on the stable branch the patch to sync the shadow Maxim provided in comment 4 though, no?
Comment 26 Juraj Fiala 2016-10-30 11:19:51 UTC
Let me play around with it first though please, the menu shadow looks far too big there.
Comment 27 Hussam Al-Tayeb 2016-10-30 13:25:26 UTC
I tried that bra(In reply to Florian Müllner from comment #24)
> The patches are also on wip/fmuellner/gtk-shadows, no gtk+ changes required
> (as gtk+-3 is supposed to be "pixel-stable" now, I'm not sure the theme
> change should go on the stable branch anyway ...)

I tried that branch. I found a bug. The window handling now extends outside the window contents into the shadow area. So I can drag or resize a window by clicking outside it over its shadow
This is not an issue in CSD windows where handling works in the correct places only.
Comment 28 Maxim 2016-10-30 20:09:41 UTC
> I tried that branch. I found a bug. The window handling now extends outside
> the window contents into the shadow area. So I can drag or resize a window
> by clicking outside it over its shadow
> This is not an issue in CSD windows where handling works in the correct
> places only.

Confirm. This happened only in Xorg session.
Also, mutter restarting sometimes.
Comment 29 Hussam Al-Tayeb 2016-10-30 20:21:46 UTC
(In reply to Maxim from comment #28)
> > I tried that branch. I found a bug. The window handling now extends outside
> > the window contents into the shadow area. So I can drag or resize a window
> > by clicking outside it over its shadow
> > This is not an issue in CSD windows where handling works in the correct
> > places only.
> 
> Confirm. This happened only in Xorg session.
> Also, mutter restarting sometimes.

I think it is because on Wayland gtk+ applications always used CSD style shadows anyway. But that is just a guess since my Wayland experience is very limited to when I occasionally try nouveau on major Linux kernel releases.
Comment 30 Florian Müllner 2016-10-30 20:26:59 UTC
That's technically not an issue with the branch, but https://git.gnome.org/browse/mutter/commit?id=f9db65f47f7e. What's new is that rather than making sure that there's at least 1px of invisible border (for the shadow-as-border of Adwaita), we are now accounting for the huge window shadow, which is bigger than the expected invisible border of 10px.


(In reply to Maxim from comment #28)
> Confirm. This happened only in Xorg session.

No, it happens for all server-side window decorations. Those are simply less common on wayland (for instance, all GTK+-3 programs will use client-side decorations on wayland).
Comment 31 Owen Taylor 2016-10-31 14:59:24 UTC
Review of attachment 338728 [details] [review]:

See https://bugzilla.gnome.org/show_bug.cgi?id=697758#c10 and further patches and comments - one part of that was committed, but the part that made themes with alpha-transparency work properly never was. This change here is what I said would be needed to make his initial patch work, but would break shaped windows. I have performance concerns about the route that Simon ended up taking with un-premultiplication, and I think it would be worth seeing if the shader approach I mentioned can be made to work.
Comment 32 Florian Müllner 2016-11-12 13:01:21 UTC
*** Bug 774313 has been marked as a duplicate of this bug. ***
Comment 33 Juraj Fiala 2017-02-01 16:01:55 UTC
Created attachment 344720 [details] [review]
Update shadows to match Adwaita better

This should make Mutter shadows almost indifferentiable to the ones made
by Adwaita.
Comment 34 Juraj Fiala 2017-02-01 16:05:00 UTC
I’m not sure how to credit Maxim though, I don’t even know his/her real name.

Note the patch is not finished, but works nicely so far, the only issue being combo-/option-menus getting normal (and not menu) shadows, but I believe Florian has a solution to that.
Comment 35 Juraj Fiala 2017-02-01 16:42:10 UTC
Created attachment 344722 [details] [review]
Update shadows to match Adwaita better

This should make Mutter shadows almost indifferentiable to the ones made
by Adwaita. Based on an initial patch from Maxim <dead.555@bk.ru>.
Comment 36 Florian Müllner 2017-02-01 16:48:27 UTC
Review of attachment 344722 [details] [review]:

ACK'ed by Jakub on IRC
Comment 37 Hussam Al-Tayeb 2017-02-01 17:02:23 UTC
Is the issue I mentioned in comment #27 existent also in the updated patch?

I'm rebuilding mutter now to check.
Comment 38 Hussam Al-Tayeb 2017-02-01 17:11:43 UTC
(In reply to Hussam Al-Tayeb from comment #37)
> Is the issue I mentioned in comment #27 existent also in the updated patch?
> 
> I'm rebuilding mutter now to check.

Nope. No issue with new patch :)
Comment 39 Florian Müllner 2017-02-01 17:36:00 UTC
Created attachment 344727 [details] [review]
window-actor: Special-case COMBO window's shadow class

We currently don't have any shadow class for combo box popups,
which means the default shadow of normal windows is used. That's
clearly odd given that the two are very different, and isn't
consistent with GTK+-3's client-side shadows for popups. While
we could add a dedicated shadow class, the designers are fine
with reusing the existing shadow for dropdown-menus, so let's
do that.
Comment 40 Rui Matos 2017-02-01 18:01:16 UTC
Review of attachment 344727 [details] [review]:

sure
Comment 41 Florian Müllner 2017-02-15 23:50:39 UTC
Attachment 344722 [details] pushed as 91c6a14 - Update shadows to match Adwaita better
Attachment 344727 [details] pushed as cb86745 - window-actor: Special-case COMBO window's shadow class
Comment 42 Juraj Fiala 2017-05-13 09:31:17 UTC
Could this be backported to 3.22?
Comment 43 Florian Müllner 2017-05-13 14:24:51 UTC
Sure. It's not a huge change, so asking informally on IRC for a UI freeze break should be fine.

(Although it's not very likely that there'll be another 3.22.x release by now)
Comment 44 GNOME Infrastructure Team 2021-07-05 13:46:23 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.