feat: Multi-Monitor-Support — Wallpaper auf Sekundärmonitoren
- WallpaperWindow für Sekundärmonitore (nur Hintergrundbild) - GreeterWindow bekommt bg_path als Parameter - resolve_wallpaper_path() aus config.py extrahiert (wiederverwendbar) - main.py: Monitor-Enumeration, Layer-Shell pro Monitor - Keyboard-Exclusive nur auf dem primären Monitor - CSS: ungültige max-width/max-height Properties entfernt
This commit is contained in:
+36
-1
@@ -5,7 +5,7 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from moongreet.config import load_config, Config
|
||||
from moongreet.config import load_config, resolve_wallpaper_path, Config
|
||||
|
||||
|
||||
class TestLoadConfig:
|
||||
@@ -53,3 +53,38 @@ class TestLoadConfig:
|
||||
config = load_config(toml_file)
|
||||
|
||||
assert config.background == tmp_path / "wallpaper.jpg"
|
||||
|
||||
|
||||
class TestResolveWallpaperPath:
|
||||
"""Tests for resolving the wallpaper path from config or package default."""
|
||||
|
||||
def test_uses_configured_path_when_exists(self, tmp_path: Path) -> None:
|
||||
wallpaper = tmp_path / "custom.jpg"
|
||||
wallpaper.write_bytes(b"fake-image")
|
||||
config = Config(background=wallpaper)
|
||||
|
||||
path, ctx = resolve_wallpaper_path(config)
|
||||
|
||||
assert path == wallpaper
|
||||
assert ctx is None
|
||||
|
||||
def test_falls_back_to_package_default(self) -> None:
|
||||
config = Config(background=None)
|
||||
|
||||
path, ctx = resolve_wallpaper_path(config)
|
||||
|
||||
assert path is not None
|
||||
assert path.exists()
|
||||
assert ctx is not None
|
||||
# Clean up context manager
|
||||
ctx.__exit__(None, None, None)
|
||||
|
||||
def test_falls_back_when_configured_path_missing(self, tmp_path: Path) -> None:
|
||||
config = Config(background=tmp_path / "nonexistent.jpg")
|
||||
|
||||
path, ctx = resolve_wallpaper_path(config)
|
||||
|
||||
assert path is not None
|
||||
assert path.exists()
|
||||
assert ctx is not None
|
||||
ctx.__exit__(None, None, None)
|
||||
|
||||
Reference in New Issue
Block a user