hyprpaper: Turning off monitor stops outputting wallpaper

What happens:

When I turn off my monitor, this disconnects DP-1. Hyprpaper reacts accordingly: [LOG] Destroying output DP-1

Steps to reproduce:

  1. run hyprpaper
  2. turn off monitor
  3. turn on monitor
  4. wallpaper is gone

killall hyprpaper && hyprpaper fixes this, but it needs to be run every time I turn the monitor back on. I’ve tried this with both wallpaper = ,/path/to/img and wallpaper = DP-1,/path/to/img in the config, same result.

Expected result:

Wallpaper is persistent; re-apply wallpaper after DP-1/fallback display is reconnected (turned back on)

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 4
  • Comments: 18 (5 by maintainers)

Commits related to this issue

Most upvoted comments

c2fb8a2 fixes the issue for me; please give it a try.

@vaxerski We may also want to consider switching m_mMonitorActiveWallpaperTargets to a string-based map (with keys being monitor names, similar to other maps in CHyperpaper) to avoid the size-based side effects described here. After switching, the issue always appears without the fix from PR #79 applied (regardless of the size of SMonitor) and never appears after the fix.

https://github.com/hyprwm/hyprpaper/blob/66b3ba8d9faa6b6a8894ecc03ac61667d344b8bc/src/helpers/Monitor.hpp#L9

I tried a few times and found that the new description field is the problem. New monitor detection works on 3bfaac0 but stops working after adding this property only.

This might relate to the structure SMonitor’s size. Notice that:

struct SMonitor {
    std::string name = "";
    int test;
    int test1;
    wl_output* output = nullptr;

works, it needs 248 bytes. and:

struct SMonitor {
    std::string name = "";
    int test;
    int test1;
    int test2;
    wl_output* output = nullptr;

doesn’t, it needs 256 bytes.

struct SMonitor {
    std::string name = "";
    std::string description = "";
    wl_output* output = nullptr;

needs 272 bytes.

I hope this helps.

I’m still experiencing this problem, same output in logs.

hyprland 0.24.1-1, hyprpaper 0.2.0-1, xdg-desktop-portal-hyprland 0.2.1-1 from new Arch community repository.

should be fixed in 654647f7b3cdeaf2f22df0b6744b3d63fb12bc0e, lmk