Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Strange blur reduce on floating window

Open rynskyi opened this issue 2 years ago • 8 comments

Blur reduced when the window is floating

The issue is very similar to this one But happens only on floating windows (without any dimaround) See example screenshots below

Normal window

2023-05-03T14:42:43,021106977+01:00

Floating window

2023-05-03T14:42:10,203319205+01:00

Floating window overlay

2023-05-03T14:43:11,592594534+01:00

Tested on: 5a3c1449194aa70d5eacbd902fa99cc1b2910a30

My hyprland.conf

########################################################################################
AUTOGENERATED HYPR CONFIG.
PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
########################################################################################

#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#

# autogenerated = 1 # remove this line to remove the warning

# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,auto


# See https://wiki.hyprland.org/Configuring/Keywords/ for more

# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
exec-once = wbg ~/Pictures/favorit/mountains_nord.png
exec-once = hyprctl setcursor capitaine-cursors 24
exec-once = ~/.config/hypr/scripts/wallpaper
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf

# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
    kb_layout = us,ua
    kb_options = grp:lalt_lshift_toggle
    # kb_variant =
    # kb_model =
    # kb_rules =

    follow_mouse = 1

    touchpad {
        scroll_factor = 0.3
        natural_scroll = true
    }

    sensitivity = 0  # -1.0 - 1.0, 0 means no modification.
}

debug {
    disable_logs = false
}

misc {
    disable_hyprland_logo = true
    animate_mouse_windowdragging = false
    animate_manual_resizes = false
}

general {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    gaps_in = 3
    gaps_out = 5
    border_size = 1
    # col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    # col.inactive_border = rgba(595959aa)

    # nord
    # col.active_border = rgba(00ffe5FF) rgba(00bfffFF) 35deg
    # col.inactive_border = rgba(59595900)

    # catppuccin frape
    col.active_border = rgba(63c7b6FF)
    col.inactive_border = rgba(303446FF)
    col.group_border = rgba(30344699)
    col.group_border_active = rgba(e5c890FF)
    resize_on_border = true
    extend_border_grab_area = true

    no_border_on_floating = true
    layout = master
}

decoration {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    rounding = 0
    blur = true
    blur_size = 3
    blur_passes = 3
    blur_new_optimizations = true
    blur_xray = false

    drop_shadow = true
    shadow_range = 15
    shadow_render_power = 3
    shadow_ignore_window = false

    col.shadow = rgba(0f111555)
    # col.shadow_inactive = rgba(0f111555)

    # drop_shadow = true
    # shadow_ignore_window = true
    shadow_offset = -1 1
    # shadow_range = 4
    # shadow_render_power = 2
    # col.shadow = 0x66000000
    dim_special = 0.35
}

animations {
    enabled = true

    # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    bezier = myBezier, 0.05, 0.9, 0.1, 1.05

    animation = windows, 1, 5, myBezier
    animation = windowsOut, 1, 5, default, popin 80%
    animation = border, 1, 10, default
    animation = fade, 1, 5, default
    animation = workspaces, 1, 5, default
    animation = specialWorkspace, 1, 5, default, slidevert
}

dwindle {
    # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
    no_gaps_when_only = true
    pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = true # you probably want this
}

master {
    # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
    new_is_master = false
    no_gaps_when_only = true
}

gestures {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more
    workspace_swipe = true
    workspace_swipe_cancel_ratio = 0.25
    workspace_swipe_min_speed_to_force = 10
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic mouse V1 {
    sensitivity = -0.5
}

# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more

# Window rules
windowrulev2 = float, class:^(swayimg_)(.*)$
windowrulev2 = float, class:^(nm-connection-editor)$
windowrulev2 = float, class:^(nemo)$, title:^(.*Properties)$
windowrulev2 = float, title:^(Open Folder)|(Open File)|(Save File)(Save As)$

# Layer rules
layerrule = blur, notifications
layerrule = ignorezero, notifications
layerrule = blur, waybar
layerrule = blur, launcher
layerrule = blur, wob

# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER

# Apps execute
bind = $mainMod, Return, exec, alacritty
bind = $mainMod SHIFT, Return, exec, [float] alacritty
bind = $mainMod, D, exec, fuzzel
binde = , XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+
binde = , XF86AudioLowerVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%-
bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bind = , XF86MonBrightnessUp, exec, light -A 5
bind = , XF86MonBrightnessDown, exec, light -U 5
bind = , Print, exec, ~/.config/hypr/scripts/grimblast --notify save area
bind = $mainMod SHIFT, B, exec, ~/.config/hypr/scripts/wallpaper --notify

# Windows control // Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod SHIFT, Q, killactive,
bind = $mainMod SHIFT, E, exit,
bind = $mainMod SHIFT, SPACE, togglefloating,
bind = $mainMod, mouse:274 , togglefloating,
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle

# Fullscreen mode
bind = $mainMod, F, fullscreen

# Groups
bind = $mainMod, TAB, togglegroup,
bind = $mainMod CTRL, left, changegroupactive, b
bind = $mainMod CTRL, right, changegroupactive, f

# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

# Move window  mainMod + arrow keys
bind = $mainMod SHIFT, left, movewindow, l
bind = $mainMod SHIFT, right, movewindow, r
bind = $mainMod SHIFT, up, movewindow, u
bind = $mainMod SHIFT, down, movewindow, d

# Scratchpad
bind = $mainMod SHIFT, S, movetoworkspace, special
bind = $mainMod , S, togglespecialworkspace,

# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10

# move this to arrow buttons

# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10

# TODO: remove this ?
# Navigate through existing workspaces with mainMod + <- ->
# bind = $mainMod, right, workspace, e+1
# bind = $mainMod, left, workspace, e-1

# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

# will switch to a submap called resize
bind= $mainMod, R, submap, resize

# will start a submap called "resize"
submap=resize

# sets repeatable binds for resizing the active window
binde=,right,resizeactive,10 0
binde=,left,resizeactive,-10 0
binde=,up,resizeactive,0 -10
binde=,down,resizeactive,0 10

# use reset to go back to the global submap
bind=,escape,submap,reset

# will reset the submap, meaning end the current one and return to the global one
submap=reset

rynskyi avatar May 03 '23 14:05 rynskyi

I'm pretty sure this issue is more general. It happens on every window if you apply something different than:

    active_opacity = 1.0
    inactive_opacity = 1.0
    fullscreen_opacity = 1.0

You can clearly see the blurred background is applied on top of the "normal" (not blurred) one with the given opacity. It's also visible during open/close animations of windows if you have opacity there.

It's extremely visible on top of sharp shapes.

The blur_size should be reduced if the window is transparent instead of blending blurred over non-blurred version.

fdev31 avatar May 05 '23 14:05 fdev31

I recommend reading the f-ing wiki and setting blur_ignore_opacity to true to fix this

vaxerski avatar May 05 '23 20:05 vaxerski

And get another bug open because the blur ignores the opacity ?

fdev31 avatar May 06 '23 09:05 fdev31

??

vaxerski avatar May 06 '23 14:05 vaxerski

Read the "f" comment ? ;) Both behaviors (the current one or the option for the workaround) lead to an inconsistent/incorrect rendering. I can understand it's quite harder to implement, but in no way the workaround is a "fix", did you read the comment I made?

fdev31 avatar May 06 '23 17:05 fdev31

any updates?

MightyPlaza avatar Aug 30 '23 18:08 MightyPlaza

I wanted to describe at least one option allowing good results providing a video but I never found time so I'll just explain in few bullet points (it's rough and can probably be improved, I wanted to make a video mock showing the exact result to validate it first but since it's not happening here we are):

  • create multiple "blur maps"
  • use linear blending to mix those blur maps and obtain a "close to reality" result

Example:

  • blur = 4
  • client opacity = 0.25

since we have blur set to 4, background images will be generated with a power of 4, 3, 2 and 1.

To draw the background, the client opacity will define which planes need to be blended, eg:

100% opacity = blur4 with 100% opacity. 75% opacity = blur3 with 100% opacity. 50% opacity = blur2 with 100% opacity. 25% opacity = blur1 with 100% opacity.

for intermediate values, linear blending is used, eg:

10% opacity = ref background (no blur) with blur1 blended on top with 40% opacity.

Alternatively, we can just compute the right value for the blur, proportional to the opacity, but I believe this was avoided for performances reasons.

fdev31 avatar Aug 31 '23 08:08 fdev31

is this still a thing?

vaxerski avatar May 15 '24 23:05 vaxerski

is this still a thing?

I think yes, was something done about it?

fdev31 avatar May 29 '24 10:05 fdev31

no clue, code changes, bugs could get fixed

vaxerski avatar May 29 '24 18:05 vaxerski

This is not really a bug, more like a non ideal implementation witch shows limits... Not a simple fix but a redesign would be needed.

fdev31 avatar May 29 '24 18:05 fdev31

Hello there!

This issue has been closed, as we are moving from issues to discussions. More about this can be found here and in #9854.

Firstly, please make sure this issue is still relevant in latest Hyprland. If so, we ask you to open a discussion (please read the discussion guidelines first, in the pinned post)

Thank you for your understanding!

vaxerski avatar Apr 05 '25 20:04 vaxerski