GNOME Bugzilla – Bug 521465
Shadow should be different if window has focus
Last modified: 2008-03-24 01:18:19 UTC
Windows with an inactive border should have their shadow opacity reduced, so that the shadows around a window give a clue which window is active (apart from the title bar). Other information: Mac OS X also does this. It makes the window seem to "come closer" (more shadow visible) when activated. Apart from that, it makes the whole screen look not so busy when there are many inactive windows lying around. You could even try to simply remove the shadow on inactive windows and see how that looks.
Created attachment 106933 [details] [review] my try on a patch, redrawing still doesn't work This patch implements the said feature, although I'm not familiar with the code, so there are two problems I currently see: * The shadow area isn't really marked dirty, so the screen isn't always updated (the maintainer should be able to add the code to fix this) * Optimization. I currently save the old "has_focus" variable and if it has changed (i.e. window gets or loses focus), I force a new shadow to be created with the correct opacity value set - is this the best way to do it?
Created attachment 106934 [details] video of the desired effect (metacity with patch applied) This video shows the desired effect. I have focus-follows-mouse turned on, so the active window is the one with the mouse cursor on it. Look at the shadow of the window.
Here's what I think: a) Thanks for adding the video-- it was helpful. b) I think this would be a really useful feature to have. c) Yes, I think that's the best way to do what you're doing. But has_focus is only a guint:1 in order to pack as many fields in as possible, and last_has_focus should semantically be a gboolean, not an int. d) I couldn't see the opacity change on my laptop in real life (rather than in the video) unless I turned the opacity factor up quite high, so perhaps it should be higher. e) Alex (whom I'm ccing) suggests that the focussed window should also have a *larger* as well as a darker shadow, i.e. that the shadow area should move some number of pixels southeast. I think he is right about this. f) He also suggests that the effect would be improved if it was gradual; I'm not convinced this would be worth the extra fuss, but I'm always willing to be convinced.
Created attachment 107428 [details] [review] Updated patch, against 2.22.0; still not redrawing, though Thomas, thanks for your comments. ad c) I've done this in the updated patch I post here ad d) Redrawing doesn't work, you might have to put another window in the background (i.e. a maximized Firefox and some other, smaller window in front of it and then move the mouse back and forth between the windows). Maybe someone more familiar with the compositor code could have a look on how we force the redrawing ad e) About the larger shadow: I initially wanted to do this, but as the shadow image is cached (re-generated on size change, afaik), we would have to save the double amount of picture data (one for the unfocused shadow, one for the focused). Also a patch to change the shadow _size_ would be more intrusive (I tried before, but failed ;). Nevertheless, I also think the effect Alex describes would look better ad f) I don't know fast this would be, performance-wise. If it is going to be gradual, it probably should be only some five frames and very short (0.5 seconds?), so we're not going to end up with too much bling-bling that is unusable :)
*** Bug 518915 has been marked as a duplicate of this bug. ***
*** Bug 523914 has been marked as a duplicate of this bug. ***
Björn Martensen in bug 523914 says that something this has already happened in 2.23.3; I didn't know this, but Iain might have changed something without me knowing. I should point out in answer to Björn Martensen's original suggestion that it's a longstanding tradition in GUIs to have shadows falling to the southeast; we can't centre shadows without weirding everyone out (or at least annoying the HCI team).
Oh, yeah, I added that last week. I didn't know about this bug... Sorry. The active windows shadow radius is now 12pixels, the inactive shadow is 6pixels. It still needs some tweaking, and changing the opacity values might be an interesting hack too... I would reopen the other bug, as its really two different things, but yes, the offset values need tweaked...