jonaburg / picom

A lightweight compositor for X11 (previously a compton fork)
Other
954 stars 98 forks source link

Shadows don't work properly with rounded corners #62

Open ItsDrike opened 2 years ago

ItsDrike commented 2 years ago

Environment

OS: Arch Linux (5.14.16-arch1-1) Picom version: vgit-a8445

Current Behavior

When I enable both shadows and the rounded corners, while the rounded corners do work just fine, there is a non-rounded shadow that over-reaches behind the corners which doesn't look very good.

Screenshot_2021-12-02_16-43-18

Expected behavior

Shadows should respect the rounded borders and shouldn't be drawn outside of it.

Configuration

Click to expand ```sh # General settings ################### # Daemonize process. Fork to background after initialization. # Causes issues with certain (badly-written) drivers. daemon = false # Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. # `xrender` is the default one. # We use GLX since it's generally a lot faster than xrender. # There usually aren't anny issues with this, but if you do experience some # try falling back to xrender. backend = "glx"; # To properly use non-xrender backend, we need to enable experimental backends # or start picom with --experimental-backends attribute experimental-backends = true; # Enable/Disable VSync. vsync = true; # Enable remote control via D-Bus. dbus = false; # Try to detect WM windows (a non-override-redirect window with no # child that has 'WM_STATE') and mark them as active. mark-wmwin-focused = true; # Mark override-redirect windows that doesn't have a child window # with 'WM_STATE' focused. mark-ovredir-focused = true; # Try to detect windows with rounded corners and don't consider them # shaped windows. The accuracy is not very high, unfortunately. detect-rounded-corners = true; # Detect '_NET_WM_OPACITY' on client windows, useful for window managers # not passing '_NET_WM_OPACITY' of client windows to frame windows. detect-client-opacity = true; # Specify refresh rate of the screen. If not specified or 0, picom will # try detecting this with X RandR extension. refresh-rate = 0; # GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. # Might cause incorrect opacity when rendering transparent content (but never # practically happened) and may not work with blur-background. # My tests show a 15% performance boost. Recommended. glx-no-stencil = true; # GLX backend: Avoid rebinding pixmap on window damage. # Probably could improve performance on rapid window content changes, # but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). # Recommended if it works. glx-no-rebind-pixmap = true; # Disable/Enable the use of damage information. # Disabling cause the whole screen to be redrawn everytime, instead of the part # of the screen has actually changed. Potentially degrades the performance, # but might fix some artifacts. It is recommended to keep this enabled. # The opposing option is no-use-damage use-damage = true # Window type settings # # 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: # "unknown", "desktop", "dock", "toolbar", "menu", "utility", # "splash", "dialog", "normal", "dropdown_menu", "popup_menu", # "tooltip", "notification", "combo", and "dnd". # # Following per window-type options are available: :: # # fade, shadow::: # Controls window-type-specific shadow and fade settings. # # opacity::: # Controls default opacity of the window type. # # focus::: # Controls whether the window of this type is to be always considered focused. # (By default, all window types except "normal" and "dialog" has this on.) # # full-shadow::: # Controls whether shadow is drawn under the parts of the window that you # normally won't be able to see. Useful when the window has parts of it # transparent, and you want shadows in those areas. # # redir-ignore::: # Controls whether this type of windows should cause screen to become # redirected again after been unredirected. If you have unredir-if-possible # set, and doesn't want certain window to cause unnecessary screen redirection, # you can set this to `true`. # wintypes: { normal = { full-shadow = true; blur-background = true; }; splash = { blur-background = false; }; menu = { full-shadow = true; }; tooltip = { fade = true; shadow = false; focus = true;}; dock = { shadow = false; }; dnd = { shadow = false; }; popup_menu = { full-shadow = true; }; utility = { full-shadow = true; }; toolbar = { full-shadow = true; }; notification = { opacity = 1; } }; # Transparency / Opacity ######################### # Specify a list of opacity rules. # format: "[Opacity level]:[xprop info name] = '[xprop value]'" # - class_g reffers to class in position #0, # - class_i reffers to class in position #1 # Note we don't make any guarantee about possible conflicts with other # programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. # Apply blur to terminals opacity-rule = [ "100:name = 'Dunst'", "70:class_g = 'Alacritty'", "75:class_g = 'st-256color'", "75:class_g = 'URxvt'", "75:class_g = 'kitty'", "75:class_g = 'Spotify'" ]; # Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) active-opacity = 1; # Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) inactive-opacity = 1; # Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) frame-opacity = 1.0; # Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) opacity = 1.0 # Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. inactive-opacity-override = false # Dim inactive windows. (0.0 - 1.0, defaults to 0.0) inactive-dim = 0.0 # Use fixed inactive dim value, instead of adjusting according to window opacity. inactive-dim-fixed = 1.0 # Specify a list of conditions of windows that should always be considered focused. focus-exclude = [] # Background blurring ######################## blur: { # dual_kawase blur method requires GLX as backend # If you can't get GLX to work, use 'kernel' blur instead. # dual_kawase allows for multi-threaded bluring that's # very fast. method = "dual_kawase"; #method = "kernel"; #kernel = "11x11gaussian"; strength = 4; deviation = 1.0; # When true, blur background of semi-transparent / ARGB window. background = false; # When true, the background of windows when the window frame # is not opaque is blurred, implies background=true background-frame = false; # Whe true, use fixeed blur strength rather than adjusing # according to window opacity background-fixed = false; # Specify the blur convolution kernel kern = "3x3box" } # Exclude conditions for background blur blur-background-exclude = [ # Prevents picom from blurring the background # when taking selection screenshot with `maim` "class_g = 'slop'", "_GTK_FRAME_EXTENTS@:c" ]; # Window Fading ################ # Fade windows in/out when opening/closing and when opacity changes, # unless no-fading-openclose is used. fading = false; # Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) fade-in-step = 0.07; # Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) fade-out-step = 0.1; # The time between steps in fade step, in milliseconds. (> 0, defaults to 10) fade-delta = 10 # Do not fade on window open/close. no-fading-openclose = false # Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, # Fluxbox, etc. no-fading-destroyed-argb = false # Specify a list of conditions of windows that should not be faded. # don't need this, we disable fading for all normal windows with wintypes: {} fade-exclude = [ #"class_g = 'slop'" # maim ] # Shadows ################ # Enabled client-side shadows on windows. Note desktop windows # (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, # unless explicitly requested using the wintypes option. shadow = true; # The blur radius for shadows, in pixels. (defaults to 12) shadow-radius = 12; # The opacity of shadows. (0.0 - 1.0, defaults to 0.75) shadow-opacity = 0.75; # The left offset for shadows, in pixels. (defaults to -15) shadow-offset-x = -15; # The top offset for shadows, in pixels. (defaults to -15) shadow-offset-y = -15; # Red color value of shadow (0.0 - 1.0, defaults to 0). shadow-red = 0 # Green color value of shadow (0.0 - 1.0, defaults to 0). shadow-green = 0 # Blue color value of shadow (0.0 - 1.0, defaults to 0). shadow-blue = 0 # Crop shadow of a window fully on a particular Xinerama screen to the screen. xinerama-shadow-crop = false # Specify a list of conditions of windows that should have no shadow. shadow-exclude = [ "name = 'Notification'", "class_g = 'Conky'", "class_g ?= 'Notify-osd'", "class_g = 'Cairo-clock'", "class_g = 'slop'", "class_g = 'Polybar'", "_GTK_FRAME_EXTENTS@:c" ]; # Corners ################ corner-radius = 12; rounded-corners-exclude = [ "class_g = 'Rofi'", "name = 'Notification area'", "class_g = 'firefox'" ] round-borders = 1; # Specify a list of border width rules. # format: "[pixels]:[xprop info name] = '[xprop value]'" # Note this doesn't have any guarantee about not conflicting with the # border width set by the window manager. round-borders-rule = [ "3:class_g = 'Alacritty'" ]; round-borders-exclude= []; ```
Arian8j2 commented 2 years ago

I faced this issue too, Any fixes?

Atavixion commented 2 years ago

found a fix on ibhagwan's fork but dont know how to merge it with jonaburg's fork

Arian8j2 commented 2 years ago

@Atavixion Thanks for mentioning it, I forked jonaburgs one and applied changes by hand, Now every thing works fine! You can find my fork at here. Thanks a lot to @s0nny7 too for his amazing commit.

Atavixion commented 2 years ago

@Arian8j2 it still has the same behaviour for me running it with experimental-backends = true, and there are no shadows running it with experimental-backends = false. On ibhagwan's fork, it worked fine without experimental-backends. Hope this helps in some way :0

Arian8j2 commented 2 years ago

@Atavixion can you post your config file

Atavixion commented 2 years ago

config : https://pastebin.com/ieC2aWzb

Graphics: Nvidia GeForce GTX 1080Ti Drivers : NVIDIA 495.46 OS : Arch (5.15.8-227-tkg-pds)

Atavixion commented 2 years ago

ok i somehow fixed it by rebuilding it, everything seems to work now :D

Arian8j2 commented 2 years ago

Yeah i was just posting a comment about make sure that you are using the new one tho, Happy to hear it got fixed.

Atavixion commented 2 years ago

thanks :3, are u going to merge your fork with jonaburg's ?

Arian8j2 commented 2 years ago

I don't think so, cause its actually @s0nny7 work and I just merged it with @Jonaburg fork, And it seems like @Jonaburg isn't updating his fork anymore, It passed about 1 years from his last commit.

Atavixion commented 2 years ago

ok, can i then put ur fork on the aur?

Arian8j2 commented 2 years ago

Yeah, that sounds cool, I really appreciate it.

Atavixion commented 2 years ago

ok, here's the AUR Package

Arian8j2 commented 2 years ago

Great !

Arian8j2 commented 2 years ago

For anybody that is looking for quick fix, There is a package in AUR called picom-jonaburg-fix (thanks to @Atavixion for maintaining), Just install and use it instead of original fork.

aleksfadini commented 2 years ago

For anybody that is looking for quick fix, There is a package in AUR called picom-jonaburg-fix (thanks to @Atavixion for maintaining), Just install and use it instead of original fork.

This worked perfectly for me, thank you for this and many thanks to @Atavixion

I wish this would be pushed to the main picom fork

theamazing0 commented 2 years ago

For anybody that is looking for quick fix, There is a package in AUR called picom-jonaburg-fix (thanks to @Atavixion for maintaining), Just install and use it instead of original fork.

This works well but the shadow don't always show for me. Sometimes when I run the picom command/start with bspwm config file the shadows get shown but other times they just don't appear. Any solution?

Atavixion commented 2 years ago

This works well but the shadow don't always show for me. Sometimes when I run the picom command/start with bspwm config file the shadows get shown but other times they just don't appear. Any solution?

I run bspwm as well and have had no problems so far. Maybe it is your picom config? Another person running Herbstluftwm also had this issue. Post your config and i can try to help my best :)

theamazing0 commented 2 years ago

This works well but the shadow don't always show for me. Sometimes when I run the picom command/start with bspwm config file the shadows get shown but other times they just don't appear. Any solution?

I run bspwm as well and have had no problems so far. Maybe it is your picom config? Another person running Herbstluftwm also had this issue. Post your config and i can try to help my best :)

My picom config file (sorry its kind of messy): https://pastebin.com/rwLJB6vq

I'm currently running picom with the command: picom --config $HOME/.config/picom.conf --experimental-backends

Atavixion commented 2 years ago

Everything looks fine to me, except I have detect-client-opacity = true; set to false. Also, you don't have wintypes but im not sure if that changes anything. I doubt this will do anything, but copy the default config to .config/picom/picom.conf and turn on shadows from there. Sorry if none of this helps -w-"

theamazing0 commented 2 years ago

Everything looks fine to me, except I have detect-client-opacity = true; set to false. Also, you don't have wintypes but im not sure if that changes anything. I doubt this will do anything, but copy the default config to .config/picom/picom.conf and turn on shadows from there. Sorry if none of this helps -w-"

Could you by any chance send your config file? Perhaps it'll work for me too?

Atavixion commented 2 years ago

Could you by any chance send your config file? Perhaps it'll work for me too?

my picom.conf