mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 15:26:04 +00:00
fix: give each new session the current screen's output size (#357)
This commit is contained in:
1 parent
906009a33a
commit
1e877fa602
1 file changed
+6
-1
@@ -2,6 +2,7 @@ package com.droiddeck.launcher.wayland
|
|||||||
|
|
||||||
import android.view.Choreographer
|
import android.view.Choreographer
|
||||||
import android.view.Surface
|
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
|
* 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,
|
fpsLimit: Int,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
pace(refreshHz, fpsLimit)
|
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) {
|
if (started) {
|
||||||
attached = surface
|
attached = surface
|
||||||
WaylandCompositor.nativeSetSurface(surface)
|
WaylandCompositor.nativeSetSurface(surface)
|
||||||
resumeVsync()
|
resumeVsync()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
WaylandCompositor.nativeSetOutputSize(outputWidth, outputHeight)
|
|
||||||
WaylandCompositor.nativeSetOutputRefreshRate(refreshHz)
|
WaylandCompositor.nativeSetOutputRefreshRate(refreshHz)
|
||||||
WaylandCompositor.nativeStartWithSurface(
|
WaylandCompositor.nativeStartWithSurface(
|
||||||
surface, xdgRuntimeDir, driverPath, libraryName, nativeLibDir,
|
surface, xdgRuntimeDir, driverPath, libraryName, nativeLibDir,
|
||||||
|
|||||||
Reference in new issue
Block a user