소스 검색

fixed windowed mode

UwU 1 개월 전
부모
커밋
9ff93cc6d3

+ 1 - 0
README.md

@@ -175,6 +175,7 @@ The background can be a Steam Workshop ID (`1845706469`) or a path to a backgrou
 | `--no-audio-processing` | Disable audio reactive features |
 | `--fps <val>` | Limit frame rate |
 | `--window <XxYxWxH>` | Run in windowed mode with custom size/position |
+| `--window-normal` | With `--window`: a regular window with a title bar that can be moved, resized, closed and covered by other windows, instead of the borderless window that stays on top |
 | `--window-background` | X11 only, with `--window`: the window acts as the desktop background (desktop type, below every other window, on all workspaces, off the taskbar, never focused, clicks go through, desktop icons stay above it). For desktops that don't show a root window wallpaper, e.g. some Cinnamon setups |
 | `--screen-root <screen>` | Set as background for a specific screen |
 | `--screen-span <screen-1>,<screen-2>,...` | Stretch a single wallpaper across multiple screens |

+ 8 - 0
src/WallpaperEngine/Application/ApplicationContext.cpp

@@ -1120,6 +1120,14 @@ void ApplicationContext::loadSettingsFromArgv () {
 	.flag ()
 	.action ([this] (const std::string& value) -> void { this->settings.render.window.asBackground = true; });
 
+    backgroundGroup.add_argument ("--window-normal")
+	.help (
+	    "With --window: a regular window with a title bar that can be moved, resized, closed and covered by other "
+	    "windows, instead of the borderless window that stays on top"
+	)
+	.flag ()
+	.action ([this] (const std::string& value) -> void { this->settings.render.window.regular = true; });
+
     performanceGroup.add_argument ("--pause-on-focus")
 	.help (
 	    "Also pause while another application has the focus (Wallpaper Engine's \"Other application focused\" "

+ 2 - 0
src/WallpaperEngine/Application/ApplicationContext.h

@@ -184,6 +184,7 @@ public:
 		glm::vec4 cornerColor;
 		WallpaperEngine::Data::Model::ImageAdjustments imageAdjustments;
 		bool asBackground;
+		bool regular;
 	    } window;
 
 	    struct {
@@ -286,6 +287,7 @@ public:
                 .cornerColor = { 0.0f, 0.0f, 0.0f, 1.0f },
                 .imageAdjustments = {},
                 .asBackground = false,
+                .regular = false,
             },
             .wayland = {
                 .layer = WAYLAND_LAYER_BOTTOM,

+ 5 - 3
src/WallpaperEngine/Render/Drivers/GLFWOpenGLDriver.cpp

@@ -38,9 +38,11 @@ GLFWOpenGLDriver::GLFWOpenGLDriver (const char* windowTitle, ApplicationContext&
     glfwWindowHintString (GLFW_X11_INSTANCE_NAME, "linux-wallpaperengine");
 
     if (context.settings.render.mode == Application::ApplicationContext::EXPLICIT_WINDOW) {
-	glfwWindowHint (GLFW_RESIZABLE, GLFW_FALSE);
-	glfwWindowHint (GLFW_DECORATED, GLFW_FALSE);
-	glfwWindowHint (GLFW_FLOATING, GLFW_TRUE);
+	const bool regular = context.settings.render.window.regular;
+
+	glfwWindowHint (GLFW_RESIZABLE, regular ? GLFW_TRUE : GLFW_FALSE);
+	glfwWindowHint (GLFW_DECORATED, regular ? GLFW_TRUE : GLFW_FALSE);
+	glfwWindowHint (GLFW_FLOATING, regular ? GLFW_FALSE : GLFW_TRUE);
     }
 
 #if !NDEBUG

+ 3 - 2
tools/linuxvm/RELEASE_TESTING.md

@@ -24,6 +24,7 @@ particles (1120596121), one video, one preset, two web items (1078208425, 834237
 | opensuse-xfce | XFCE X11 | portable | PulseAudio only desktop (no libpipewire), covered root window, zypper dependency install |
 | manjaro-kde | Plasma Wayland | portable | pacman dependency install (needs a fully updated system) |
 | popos-cosmic | COSMIC | portable + .deb | layer shell and window states (`zcosmic_toplevel_info`) on cosmic-comp |
+| cachyos-kde | Plasma Wayland | portable | x86-64-v3 packages and kernel, Plasma Login Manager autologin, pacman dependency install |
 | bazzite | KDE, immutable | portable + Flatpak | rpm-ostree: dependency install refused, Flatpak |
 
 Rows are added as the VMs of `TODO.md` -> "Real-session distro VMs" get built. A new distro joins the matrix once its
@@ -78,7 +79,7 @@ and re-tag on my own: the report goes to the maintainer first. Cleanup after a r
 ## State (2026-10-19)
 
 Built and used: everything under "Automation". Golden disks and profiles exist for debian-gnome, debian-xfce, opensuse-kde,
-opensuse-xfce, opensuse-leap, manjaro-kde, arch-xfce (Arch with XFCE, stands in for EndeavourOS), popos-cosmic and bazzite.
+opensuse-xfce, opensuse-leap, manjaro-kde, cachyos-kde, arch-xfce (Arch with XFCE, stands in for EndeavourOS), popos-cosmic and bazzite.
 fedora-kde, fedora-gnome and ubuntu-gnome have draft profiles that were not run through `release_check.sh`, arch-hypr and
 mint-cinnamon have none yet. Per VM notes: KDE VMs need screen lock and sleep disabled (`kde-inhibit`, in the profile's
 PREP), Bazzite's /home is /var/home, Debian's cloud image needs the regular kernel for any graphics, GNOME needs its extension
@@ -98,5 +99,5 @@ brings wallpapers back through its autostart playlist, one or two VMs fit in RAM
    of them.
 2. Run the whole matrix on the committed build, fix what it finds, keep that report as the baseline for comparisons
    (reference frames per wallpaper for `check_frame.py` first).
-3. Remaining distros from the TODO (CachyOS, SteamOS, Zorin, Manjaro XFCE, Garuda, ChimeraOS, elementary, MX; installer
+3. Remaining distros from the TODO (SteamOS, Zorin, Manjaro XFCE, Garuda, ChimeraOS, elementary, MX; installer
    ISOs, no cloud images) join the matrix one by one.

+ 24 - 0
tools/linuxvm/bootstrap_ssh.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+# bootstrap_ssh.sh <vm> <port> <layout us|de> [password] - for a VM installed from an ISO that has no ssh: serves a setup script
+# from this host ($PORT, pick one nobody else uses) and runs it in a terminal that is already open and focused in the guest
+# (the QEMU user network reaches the host as 10.0.2.2). The script enables sshd, adds the rig key, passwordless sudo,
+# autologin is distro specific and not done here. The guest password is typed by the script's sudo (default labbalab1).
+HERE=$(cd "$(dirname "$0")" && pwd)
+LINUXVM=${LINUXVM:-$HOME/.local/share/linuxvm}
+vm=$1 port=$2 layout=$3 pw=${4:-labbalab1}
+dir=$(mktemp -d)
+cat > "$dir/s" <<EOS
+#!/bin/bash
+echo $pw | sudo -S true 2>/dev/null
+sudo systemctl enable --now sshd 2>/dev/null || sudo systemctl enable --now ssh
+mkdir -p ~/.ssh; chmod 700 ~/.ssh; echo '$(cat "$LINUXVM/id_ed25519.pub")' >> ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys
+echo 'lab ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/lab >/dev/null
+sudo chsh -s /bin/bash lab
+sudo ufw allow 22 2>/dev/null; sudo firewall-cmd --add-service=ssh --permanent 2>/dev/null
+echo SETUP-DONE
+EOS
+(cd "$dir" && python3 -m http.server "$port" --bind 0.0.0.0 >/dev/null 2>&1 & echo $! > "$dir/pid")
+sleep 1
+q() { "$HERE/qtype.sh" "$vm" "$layout" "$1"; }
+q "curl -sO 10.0.2.2:$port/s"; q ret; sleep 4; q "bash s"; q ret; sleep 15
+kill "$(cat "$dir/pid")"; rm -rf "$dir"

+ 2 - 0
tools/linuxvm/linuxvm.sh

@@ -19,6 +19,7 @@
 #   shot <vm> <png>       screenshot through the VNC socket (vncshot.py); pointer/click/keys/type/raw go to qmp.py
 #   golden <vm>           freezes a stopped VM's disk as golden.qcow2 (and its UEFI vars) and puts a throwaway overlay on top
 #   fresh <vm>            throws the overlay away: the next start begins from the golden state again (release_check.sh)
+#   a file <vm>/qemu-extra holds extra QEMU arguments (SteamOS: NVMe disk, Valve SMBIOS, the recovery image as USB disk)
 #   stop | kill <vm>      ACPI power off | kill QEMU
 # QEMU's virtio-gpu and egl-headless modules are not in the image's qemu-system-x86-core: `fetch` unpacks the Fedora
 # RPMs (plus virglrenderer) into $LINUXVM/root and QEMU_MODULE_DIR points there.
@@ -142,6 +143,7 @@ start)
         -device virtio-vga-gl,xres="${size%x*}",yres="${size#*x}" \
         "${display[@]}" "${extra[@]}" \
         -device qemu-xhci -device usb-tablet \
+        $([ -f "$dir/qemu-extra" ] && cat "$dir/qemu-extra") \
         -qmp unix:"$dir/qmp.sock",server=on,wait=off -serial file:"$dir/serial.log" \
         -daemonize -pidfile "$dir/qemu.pid"
     [ -f "$dir/seed.iso" ] || { echo "$vm started (no cloud-init, no ssh wait)"; exit 0; }

+ 11 - 0
tools/linuxvm/prep_guest.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+# prep_guest.sh <vm> [candidate dir] - fills ~/lwe in a VM the way release_check.sh expects it: test assets and wallpapers
+# (kept in $LINUXVM/payload), the engine under test (candidate/lwe-hints), the guest scripts. Needs working ssh to the VM.
+HERE=$(cd "$(dirname "$0")" && pwd)
+LINUXVM=${LINUXVM:-$HOME/.local/share/linuxvm}
+vm=$1 cand=${2:-/tmp/claude-1000/pkgout/cand}
+lv() { "$HERE/linuxvm.sh" "$@"; }
+lv ssh "$vm" 'mkdir -p ~/lwe' </dev/null
+for d in "$LINUXVM"/payload/* "$cand/lwe-hints"; do lv scp "$vm" "$d" lwe/; done
+for f in sessenv.sh guest_test.sh fullscreen_window.py maximize_kde.sh; do lv scp "$vm" "$HERE/$f" "lwe/$f"; done
+lv ssh "$vm" 'du -sh ~/lwe' </dev/null

+ 7 - 0
tools/linuxvm/profiles/cachyos-kde.sh

@@ -0,0 +1,7 @@
+VM=cachyos-kde
+SCREEN=Virtual-1
+SHOT_CMD=host
+FULLSCREEN_CMD='konsole --fullscreen'
+MAXIMIZE_CMD='~/lwe/maximize_kde.sh'
+WEM=app
+PREP='(setsid nohup kde-inhibit --power --screenSaver sleep 100000 >/dev/null 2>&1 &)'

+ 27 - 0
tools/linuxvm/qtype.sh

@@ -0,0 +1,27 @@
+#!/bin/bash
+# qtype.sh <vm> <us|de> <text> - types text into a VM one key at a time through QMP (`linuxvm.sh type` drops characters
+# under load). Letters, digits and  . - / : ; _ + = @ space are mapped for the given guest keyboard layout; "ret" as the
+# whole text presses Enter. For the German layout y and z are swapped, - is the slash key, : is shift-dot, / is shift-7.
+HERE=$(cd "$(dirname "$0")" && pwd)
+vm=$1 layout=$2 text=$3
+k() { "$HERE/linuxvm.sh" keys "$vm" "$1" >/dev/null; sleep ${QTYPE_DELAY:-0.25}; }
+[ "$text" = ret ] && { k ret; exit 0; }
+for ((i = 0; i < ${#text}; i++)); do
+    c=${text:i:1}
+    case $c in
+    [a-z0-9])
+        if [ "$layout" = de ]; then case $c in y) c=z ;; z) c=y ;; esac; fi; k "$c" ;;
+    [A-Z]) c=$(echo "$c" | tr A-Z a-z); if [ "$layout" = de ]; then case $c in y) c=z ;; z) c=y ;; esac; fi; k "shift-$c" ;;
+    ' ') k spc ;;
+    .) k dot ;;
+    -) [ "$layout" = de ] && k slash || k minus ;;
+    /) [ "$layout" = de ] && k shift-7 || k slash ;;
+    :) [ "$layout" = de ] && k shift-dot || k shift-semicolon ;;
+    _) [ "$layout" = de ] && k shift-slash || k shift-minus ;;
+    \;) [ "$layout" = de ] && k shift-comma || k semicolon ;;
+    =) [ "$layout" = de ] && k shift-0 || k equal ;;
+    +) [ "$layout" = de ] && k bracket_right || k shift-equal ;;
+    @) [ "$layout" = de ] && k alt_r-q || k shift-2 ;;
+    *) echo "qtype: no mapping for '$c'" >&2; exit 1 ;;
+    esac
+done

+ 1 - 1
tools/linuxvm/release_check.sh

@@ -30,7 +30,7 @@ while [ $# -gt 0 ]; do
 done
 [ ${#vms[@]} -gt 0 ] || for f in "$HERE"/profiles/*.sh; do vms+=("$(basename "$f" .sh)"); done
 
-report=$HERE/reports/$(date +%F)
+report=${REPORT_DIR:-$HERE/reports/$(date +%F)}
 mkdir -p "$report"
 summary=$report/summary.md
 echo "# Release check $(date '+%F %H:%M')" > "$summary"