! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Change shadow geometry in the compositor.
Status:
RESOLVED: FIXED
Severity:
trivial

Comments

Description brian-schott 2005-01-09 03:02:15 CET
I think it looks a little silly that the shadows are drawn the same size on all
edges of windows. This could only happen if the light source was directly in
front of the screen. OS X's shadows look much more believable, being offset
towards the bottom and giving the illusion that there is a light source towards
the top of the screen.

The fix is pretty easy. Just change lines 57 and 58 in compositor.c to the
following:

#define SHADOW_OFFSET_X (SHADOW_RADIUS * -1.5)
#define SHADOW_OFFSET_Y (SHADOW_RADIUS * -.5)

This gives a small shadow on the right and left sides that is the same size, no
shadow on the top, and a larger shadow on the bottom of the window.

Reproducible: Always
Steps to Reproduce:
1. Run xfwm4 with the compositor enabled.

Actual Results:  
Shadows are drawn the same size in all four directions.

Expected Results:  
Shadows drawn with the bottom shadow being the biggest. The shadows on the right
and left side should be the same size.
Comment 1 Olivier Fourdan editbugs 2005-01-09 09:32:02 CET
That was on purpose. BTW, there is already options to control the size of
shadows on each size:

shadow_delta_height=0
shadow_delta_width=0
shadow_delta_x=0
shadow_delta_y=0

You can play with these values in the themerc to get what you want.
Comment 2 Olivier Fourdan editbugs 2005-01-09 10:12:35 CET
Closing bug, I changed to shadow to get a mix of both solutions (knowing that
it's customizable anyway)
Comment 3 brian-schott 2005-01-09 12:47:34 CET
Okay, I've done some tinkering with the themerc. In doing so, I found a related,
yet easily fixed bug in settings.c that only let you shrink the size of the
shadow to a size smaller than the size of the window. This made the shadow hide
behind the window completely. It used an absolute value function on these values.

Change lines 663 to 670 in settings.c to:

    screen_info->params->shadow_delta_x = 
        (TOINT (getValue ("shadow_delta_x", rc)) * -1);
    screen_info->params->shadow_delta_y = 
        (TOINT (getValue ("shadow_delta_y", rc)) * -1);
    screen_info->params->shadow_delta_width = 
        (TOINT (getValue ("shadow_delta_width", rc)) * -1);
    screen_info->params->shadow_delta_height = 
        (TOINT (getValue ("shadow_delta_height", rc)) * -1);

This will change the behavior of the themerc a bit, but I think it makes more
sense this way.

shadow_delta_height = distance from the bottom edge of the window to the bottom
edge of shadow
shadow_delta_width = distance from the left edge 
shadow_delta_y = distance from top edge
shadow_delta_x = distance from right edge

Positive numbers will make the shadow extend beyond the edge of the window,
while negative numbers will have the edge of the shadow hidden behind the window.
Comment 4 brian-schott 2005-03-28 07:15:02 CEST
Created attachment 201 
Patch for adding shadow settings to xfwm4 and its settings plugin

I finally got around to writing a patch for changing the shadow settings. You
can now use some sliders in xfwm4's mcs-plugin to change the geometry and
opacity of the shadows in real time. These settings can be parsed in the
xfwm4rc and can be saved by the session manager.

Screenshot: http://members.cox.net/brian-schott/shadow_patch.png
Comment 5 Harold Aling 2007-02-15 20:48:58 CET
This would be a cool addition to the Window manager tweaks!

The patch was written against xfwm4-4.2.1, so I'd recon that it won't apply at all.

Olivier, any change such a thing can be added to the 4.4+ xfwm4?
Comment 6 Olivier Fourdan editbugs 2007-02-15 20:55:55 CET
No, it's not been merged, the shadow geometry is a setting from the theme, it's not configurable by the user. I'm not sure about the "usefulness" of that feature, that's why it was left out. 

Actually, I always have a problem with rejecting a feature request with a patch, that's why I left it open, but I believe it adds bloats...
Comment 7 Harold Aling 2007-02-15 22:01:23 CET
> Actually, I always have a problem with rejecting a feature request with a
> patch, that's why I left it open, but I believe it adds bloats...
> 

If you really see this as bloat, please close this bug...
Comment 8 brian-schott 2007-02-19 06:29:56 CET
(In reply to comment #5)
> This would be a cool addition to the Window manager tweaks!
> 
> The patch was written against xfwm4-4.2.1, so I'd recon that it won't apply at
> all.
> 
> Olivier, any change such a thing can be added to the 4.4+ xfwm4?
> 

I'm sure it wouldn't apply. The thing that I was really concerned about was that absolute value function mentioned earlier. Everything I was complaining about seems to be fixed in 4.4, so I'll call this fixed if nobody minds.

Bug #666

Reported by:
brian-schott
Reported on: 2005-01-09
Last modified on: 2009-07-14

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Attachments

Additional information