Skip to content

Change zwlr layer to background, or add option for specifying it. #541

@Volfit

Description

@Volfit

What needs improvement?

Right now linux-wallpaper engine displays wallpapers on bottom layer:

hyprctl layers
Monitor eDP-1:
 Layer level 0 (background):
 Layer level 1 (bottom):
  Layer 56199aab71b0: xywh: 0 0 1920 1080, namespace: caelestia-background, pid: 1217544
  Layer 56199a872890: xywh: 0 0 1920 1080, namespace: linux-wallpaperengine, pid: 1934581
 Layer level 2 (top):
  Layer 56199a3b1760: xywh: 0 540 1 1, namespace: caelestia-border-exclusion, pid: 1217544
  Layer 56199a55c710: xywh: 987 0 1 1, namespace: caelestia-border-exclusion, pid: 1217544
  Layer 56199a6f61e0: xywh: 1919 540 1 1, namespace: caelestia-border-exclusion, pid: 1217544
  Layer 56199aab78b0: xywh: 986 1079 1 1, namespace: caelestia-border-exclusion, pid: 1217544
  Layer 56199aa8f5c0: xywh: 986 540 1 1, namespace: quickshell, pid: 1217544
 Layer level 3 (overlay):
  Layer 56199aae27a0: xywh: 0 0 1920 1080, namespace: caelestia-drawers, pid: 1217544

As you see, there's background layer, that's not utilized.

Why is this necessary or beneficial?

I run hyprland with caelestia dots, and It has a clock displayed on the same bottom layer, but linux wallpaper engine covers it.

Changing layer to background fixes the issue.

It would be nice to have an option to specify where the background is rendered to fix potential compatibility issues with similar issues, or to automatically detect if such layer exist.
(I'm not a programmer, and I'm not a wayland expert, and I don't know if every wayland system has a background layer).

The easiest way to fix the issue is to chage the next line here:

./src/WallpaperEngine/Render/Drivers/Output/WaylandOutputViewport.cpp

119    m_driver->getWaylandContext ()->layerShell, surface, output, ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM,

to

119    m_driver->getWaylandContext ()->layerShell, surface, output, ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND,

And that's the result:

hyprctl layers
Monitor eDP-1:
 Layer level 0 (background):
  Layer 56199a640800: xywh: 0 0 1920 1080, namespace: linux-wallpaperengine, pid: 2037718
 Layer level 1 (bottom):
  Layer 56199aab71b0: xywh: 0 0 1920 1080, namespace: caelestia-background, pid: 1217544
 Layer level 2 (top):
  Layer 56199a3b1760: xywh: 0 540 1 1, namespace: caelestia-border-exclusion, pid: 1217544
  Layer 56199a55c710: xywh: 987 0 1 1, namespace: caelestia-border-exclusion, pid: 1217544
  Layer 56199a6f61e0: xywh: 1919 540 1 1, namespace: caelestia-border-exclusion, pid: 1217544
  Layer 56199aab78b0: xywh: 986 1079 1 1, namespace: caelestia-border-exclusion, pid: 1217544
  Layer 56199aa8f5c0: xywh: 986 540 1 1, namespace: quickshell, pid: 1217544
 Layer level 3 (overlay):
  Layer 56199aae27a0: xywh: 0 0 1920 1080, namespace: caelestia-drawers, pid: 1217544

After compiling the engine with this change, I no longer have an issue of a clock, presented on the bottom layer, being blocked by the wallpaper engine.

Potential Impact on Users

  • If just apply the fix presented above, if system doesn't have background layer (again, I'm not sure is it exist everywhere or not), the linux wallpaper engine might brake.
  • If there's background layer, but something above is covering it, the output of linux-wallpaper engine might get blocked, despite being presented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions