From 1e877fa602a2accc093dc17fa03023fa552c9ff0 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:17:52 -0400 Subject: [PATCH] fix: give each new session the current screen's output size (#357) --- .../java/com/droiddeck/launcher/wayland/CompositorHost.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/droiddeck/launcher/wayland/CompositorHost.kt b/app/src/main/java/com/droiddeck/launcher/wayland/CompositorHost.kt index a19bd858..797ae846 100644 --- a/app/src/main/java/com/droiddeck/launcher/wayland/CompositorHost.kt +++ b/app/src/main/java/com/droiddeck/launcher/wayland/CompositorHost.kt @@ -2,6 +2,7 @@ package com.droiddeck.launcher.wayland import android.view.Choreographer import android.view.Surface +import com.droiddeck.launcher.session.SessionState /** * The compositor is a process-wide thing, not an activity's: it is started once, keeps running @@ -35,13 +36,17 @@ object CompositorHost { fpsLimit: Int, ): Boolean { pace(refreshHz, fpsLimit) + // The compositor outlives sessions, and the next one may be on the other screen of a dual-screen + // device: gamescope reads the size from the toplevel configure and the wl_output mode when it + // connects, and kept the first session's (the Thor's 1920x1080 top screen letterboxed the bottom + // one's session to 16:9). A running session keeps the size it was started at. + if (!SessionState.running) WaylandCompositor.nativeSetOutputSize(outputWidth, outputHeight) if (started) { attached = surface WaylandCompositor.nativeSetSurface(surface) resumeVsync() return false } - WaylandCompositor.nativeSetOutputSize(outputWidth, outputHeight) WaylandCompositor.nativeSetOutputRefreshRate(refreshHz) WaylandCompositor.nativeStartWithSurface( surface, xdgRuntimeDir, driverPath, libraryName, nativeLibDir,