Skip to content

swayfx renders zen browser as several regions, creating "stars". #574

Description

@moshpirit
  • Swayfx Version:

    • swayfx version 0.6 (based on sway 1.12.0)
  • GPU / Driver:

    • Intel Alder Lake-P GT2 (Iris Xe Graphics), open-source i915 kernel driver, Mesa (OpenGL renderer string: Mesa Intel(R) Iris(R) Xe Graphics (ADL GT2)). Not using proprietary nvidia drivers.
  • Debug Log:

  • Configuration File:

    • Relevant section (sway-windowrules.conf), with corner_radius set to 5 (also reproduces at higher values, e.g. 10):
      default_border pixel 2
      default_floating_border pixel 2
      hide_edge_borders --i3 smart_no_gaps
      corner_radius 5
      animation_duration_ms 100
      gaps inner 6
      gaps outer 2
      smart_borders on
      smart_gaps on
      
    • Relevant Zen Browser window rules (sway-windowrules.conf):
      assign [app_id="(?i)firefox|zen"] $ws2
      for_window [app_id="(?i)firefox|WebApp-chapi(?i)|(?i)zen"] focus; focus parent; layout tabbed; mark _tabbed; [workspace=__focused__] move to window mark _tabbed; border pixel 0, opacity 1
      
  • Stack Trace:

    • N/A — sway does not crash, this is a rendering issue.
  • Description:

    When using Zen Browser in SwayFX with corner_radius enabled, gaps shaped like a "four-pointed star" appear in the browser window during sway animations (e.g. when opening the window, moving it, or switching workspaces). The larger the corner_radius value, the bigger these gaps get.

    This same symptom was originally reported in Zen Browser as gaps revealing the desktop wallpaper ("stars"): On wayland, stars show the wallpaper on zen browser. zen-browser/desktop#10529

    After checking with the Wayland project (https://gitlab.freedesktop.org/wayland/wayland/-/work_items/605), I was told the cause is how the compositor applies rounded corners:

    Your compositor applies rounded corners to each region it renders instead of only to the window as a whole.

    In other words, SwayFX appears to apply the corner rounding (corner_radius) to each region/subsurface it renders separately, instead of applying it to the window as a whole. When these regions overlap or get recomposited during an animation, gaps appear where nothing is painted, revealing whatever is behind (the wallpaper or other windows), with a characteristic four-pointed star shape.

    Steps to reproduce:

    1. Configure sway with corner_radius enabled to a reasonable value (e.g. 10-15).
    2. Open Zen Browser.
    3. Trigger an animation (open the window, move it, switch workspace, scroll within the page itself, resize, etc.).
    4. Observe the star-shaped gaps appearing over the Zen Browser window, showing the desktop wallpaper through them.

    Expected behavior: rounded corners should be applied to the window as a whole, without leaving gaps between the different rendered regions/subsurfaces.

    Actual behavior: four-pointed star-shaped gaps appear, whose size scales with the corner_radius value.

Feel free to ask for anything for more information.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions