- go.yaml.in/yaml/v3 v3.0.5 → v3.0.6
- go.yaml.in/yaml/v3 v3.0.5 → v3.0.6 (tools)
#122 build(deps): update 2 dependencies
M .github/workflows/ci.yml +1 -1
| @@ -27,7 +27,7 @@ jobs: | |||
| 27 | 27 | pacman -Syu --noconfirm --needed | |
| 28 | 28 | git go make gcc shaderc wayland libxkbcommon libinput seatd | |
| 29 | 29 | vulkan-icd-loader vulkan-swrast dbus | |
| 30 | - | - uses: actions/checkout@v7 | |
| 30 | + | - uses: actions/checkout@v4 | |
| 31 | 31 | - run: | | |
| 32 | 32 | git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| 33 | 33 | install -d -m 700 "$XDG_RUNTIME_DIR" | |
| @@ -27,7 +27,7 @@ jobs: | |||||
| 27 | pacman -Syu --noconfirm --needed | 27 | pacman -Syu --noconfirm --needed | ||
| 28 | git go make gcc shaderc wayland libxkbcommon libinput seatd | 28 | git go make gcc shaderc wayland libxkbcommon libinput seatd | ||
| 29 | vulkan-icd-loader vulkan-swrast dbus | 29 | vulkan-icd-loader vulkan-swrast dbus | ||
| 30 | - | - uses: actions/checkout@v7 | 30 | + | - uses: actions/checkout@v4 |
| 31 | - run: | | 31 | - run: | | ||
| 32 | git config --global --add safe.directory "$GITHUB_WORKSPACE" | 32 | git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| 33 | install -d -m 700 "$XDG_RUNTIME_DIR" | 33 | install -d -m 700 "$XDG_RUNTIME_DIR" | ||
M .goreleaser.yaml +0 -4
| @@ -46,7 +46,6 @@ archives: | |||
| 46 | 46 | - examples/capture-allow | |
| 47 | 47 | - packaging/neferwl-session | |
| 48 | 48 | - packaging/neferwl.service | |
| 49 | - | - packaging/neferwl-server.service | |
| 50 | 49 | - packaging/neferwl-shutdown.target | |
| 51 | 50 | - packaging/neferwl.desktop | |
| 52 | 51 | - packaging/neferwl-portals.conf | |
| @@ -90,8 +89,6 @@ nfpms: | |||
| 90 | 89 | file_info: {mode: 0755} | |
| 91 | 90 | - src: packaging/neferwl.service | |
| 92 | 91 | dst: /usr/lib/systemd/user/neferwl.service | |
| 93 | - | - src: packaging/neferwl-server.service | |
| 94 | - | dst: /usr/lib/systemd/user/neferwl-server.service | |
| 95 | 92 | - src: packaging/neferwl-shutdown.target | |
| 96 | 93 | dst: /usr/lib/systemd/user/neferwl-shutdown.target | |
| 97 | 94 | - src: packaging/neferwl.desktop | |
| @@ -226,7 +223,6 @@ aurs: | |||
| 226 | 223 | install -Dm755 ./neferwl "${pkgdir}/usr/bin/neferwl" | |
| 227 | 224 | install -Dm755 ./packaging/neferwl-session "${pkgdir}/usr/bin/neferwl-session" | |
| 228 | 225 | install -Dm644 ./packaging/neferwl.service "${pkgdir}/usr/lib/systemd/user/neferwl.service" | |
| 229 | - | install -Dm644 ./packaging/neferwl-server.service "${pkgdir}/usr/lib/systemd/user/neferwl-server.service" | |
| 230 | 226 | install -Dm644 ./packaging/neferwl-shutdown.target "${pkgdir}/usr/lib/systemd/user/neferwl-shutdown.target" | |
| 231 | 227 | install -Dm644 ./packaging/neferwl.desktop "${pkgdir}/usr/share/wayland-sessions/neferwl.desktop" | |
| 232 | 228 | install -Dm644 ./packaging/neferwl-portals.conf "${pkgdir}/usr/share/xdg-desktop-portal/neferwl-portals.conf" | |
| @@ -46,7 +46,6 @@ archives: | |||||
| 46 | - examples/capture-allow | 46 | - examples/capture-allow | ||
| 47 | - packaging/neferwl-session | 47 | - packaging/neferwl-session | ||
| 48 | - packaging/neferwl.service | 48 | - packaging/neferwl.service | ||
| 49 | - | - packaging/neferwl-server.service | |||
| 50 | - packaging/neferwl-shutdown.target | 49 | - packaging/neferwl-shutdown.target | ||
| 51 | - packaging/neferwl.desktop | 50 | - packaging/neferwl.desktop | ||
| 52 | - packaging/neferwl-portals.conf | 51 | - packaging/neferwl-portals.conf | ||
| @@ -90,8 +89,6 @@ nfpms: | |||||
| 90 | file_info: {mode: 0755} | 89 | file_info: {mode: 0755} | ||
| 91 | - src: packaging/neferwl.service | 90 | - src: packaging/neferwl.service | ||
| 92 | dst: /usr/lib/systemd/user/neferwl.service | 91 | dst: /usr/lib/systemd/user/neferwl.service | ||
| 93 | - | - src: packaging/neferwl-server.service | |||
| 94 | - | dst: /usr/lib/systemd/user/neferwl-server.service | |||
| 95 | - src: packaging/neferwl-shutdown.target | 92 | - src: packaging/neferwl-shutdown.target | ||
| 96 | dst: /usr/lib/systemd/user/neferwl-shutdown.target | 93 | dst: /usr/lib/systemd/user/neferwl-shutdown.target | ||
| 97 | - src: packaging/neferwl.desktop | 94 | - src: packaging/neferwl.desktop | ||
| @@ -226,7 +223,6 @@ aurs: | |||||
| 226 | install -Dm755 ./neferwl "${pkgdir}/usr/bin/neferwl" | 223 | install -Dm755 ./neferwl "${pkgdir}/usr/bin/neferwl" | ||
| 227 | install -Dm755 ./packaging/neferwl-session "${pkgdir}/usr/bin/neferwl-session" | 224 | install -Dm755 ./packaging/neferwl-session "${pkgdir}/usr/bin/neferwl-session" | ||
| 228 | install -Dm644 ./packaging/neferwl.service "${pkgdir}/usr/lib/systemd/user/neferwl.service" | 225 | install -Dm644 ./packaging/neferwl.service "${pkgdir}/usr/lib/systemd/user/neferwl.service" | ||
| 229 | - | install -Dm644 ./packaging/neferwl-server.service "${pkgdir}/usr/lib/systemd/user/neferwl-server.service" | |||
| 230 | install -Dm644 ./packaging/neferwl-shutdown.target "${pkgdir}/usr/lib/systemd/user/neferwl-shutdown.target" | 226 | install -Dm644 ./packaging/neferwl-shutdown.target "${pkgdir}/usr/lib/systemd/user/neferwl-shutdown.target" | ||
| 231 | install -Dm644 ./packaging/neferwl.desktop "${pkgdir}/usr/share/wayland-sessions/neferwl.desktop" | 227 | install -Dm644 ./packaging/neferwl.desktop "${pkgdir}/usr/share/wayland-sessions/neferwl.desktop" | ||
| 232 | install -Dm644 ./packaging/neferwl-portals.conf "${pkgdir}/usr/share/xdg-desktop-portal/neferwl-portals.conf" | 228 | install -Dm644 ./packaging/neferwl-portals.conf "${pkgdir}/usr/share/xdg-desktop-portal/neferwl-portals.conf" | ||
M .mockery.yml +0 -14
| @@ -14,7 +14,6 @@ packages: | |||
| 14 | 14 | filename: '{{.InterfaceFile | base | trimSuffix ".go"}}_mock.go' | |
| 15 | 15 | interfaces: | |
| 16 | 16 | CaptureFrame: | |
| 17 | - | CastBufferAllocator: | |
| 18 | 17 | CastSink: | |
| 19 | 18 | Clock: | |
| 20 | 19 | ContentReturn: | |
| @@ -81,11 +80,6 @@ packages: | |||
| 81 | 80 | dir: internal/adapters/vulkan | |
| 82 | 81 | pkgname: vulkan | |
| 83 | 82 | filename: capture_sync_mock_test.go | |
| 84 | - | dmabufFences: | |
| 85 | - | config: | |
| 86 | - | dir: internal/adapters/vulkan | |
| 87 | - | pkgname: vulkan | |
| 88 | - | filename: dmabuf_fences_mock_test.go | |
| 89 | 83 | github.com/bnema/neferwl/internal/adapters/wayland: | |
| 90 | 84 | interfaces: | |
| 91 | 85 | procEnv: | |
| @@ -299,11 +293,3 @@ packages: | |||
| 299 | 293 | dir: internal/adapters/wayland/xwm | |
| 300 | 294 | pkgname: xwm | |
| 301 | 295 | filename: loop_mock_test.go | |
| 302 | - | ||
| 303 | - | github.com/bnema/neferwl/internal/adapters/directseat: | |
| 304 | - | interfaces: | |
| 305 | - | evdev: | |
| 306 | - | config: | |
| 307 | - | dir: internal/adapters/directseat | |
| 308 | - | pkgname: directseat | |
| 309 | - | filename: evdev_mock_test.go | |
| @@ -14,7 +14,6 @@ packages: | |||||
| 14 | filename: '{{.InterfaceFile | base | trimSuffix ".go"}}_mock.go' | 14 | filename: '{{.InterfaceFile | base | trimSuffix ".go"}}_mock.go' | ||
| 15 | interfaces: | 15 | interfaces: | ||
| 16 | CaptureFrame: | 16 | CaptureFrame: | ||
| 17 | - | CastBufferAllocator: | |||
| 18 | CastSink: | 17 | CastSink: | ||
| 19 | Clock: | 18 | Clock: | ||
| 20 | ContentReturn: | 19 | ContentReturn: | ||
| @@ -81,11 +80,6 @@ packages: | |||||
| 81 | dir: internal/adapters/vulkan | 80 | dir: internal/adapters/vulkan | ||
| 82 | pkgname: vulkan | 81 | pkgname: vulkan | ||
| 83 | filename: capture_sync_mock_test.go | 82 | filename: capture_sync_mock_test.go | ||
| 84 | - | dmabufFences: | |||
| 85 | - | config: | |||
| 86 | - | dir: internal/adapters/vulkan | |||
| 87 | - | pkgname: vulkan | |||
| 88 | - | filename: dmabuf_fences_mock_test.go | |||
| 89 | github.com/bnema/neferwl/internal/adapters/wayland: | 83 | github.com/bnema/neferwl/internal/adapters/wayland: | ||
| 90 | interfaces: | 84 | interfaces: | ||
| 91 | procEnv: | 85 | procEnv: | ||
| @@ -299,11 +293,3 @@ packages: | |||||
| 299 | dir: internal/adapters/wayland/xwm | 293 | dir: internal/adapters/wayland/xwm | ||
| 300 | pkgname: xwm | 294 | pkgname: xwm | ||
| 301 | filename: loop_mock_test.go | 295 | filename: loop_mock_test.go | ||
| 302 | - | ||||
| 303 | - | github.com/bnema/neferwl/internal/adapters/directseat: | |||
| 304 | - | interfaces: | |||
| 305 | - | evdev: | |||
| 306 | - | config: | |||
| 307 | - | dir: internal/adapters/directseat | |||
| 308 | - | pkgname: directseat | |||
| 309 | - | filename: evdev_mock_test.go | |||
M Makefile +2 -8
| @@ -1,4 +1,4 @@ | |||
| 1 | - | .PHONY: build test vet race e2e-xwayland e2e-wayvnc mocks mocks-check spv-check fakes-check log-check arch adapter-imports check perf-check color-check bin tty logs pkg install | |
| 1 | + | .PHONY: build test vet race e2e-xwayland mocks mocks-check spv-check fakes-check log-check arch adapter-imports check perf-check color-check bin tty logs pkg install | |
| 2 | 2 | ||
| 3 | 3 | # 0 runs until quit; set e.g. TTY_TIMEOUT=60s for a safety net. | |
| 4 | 4 | TTY_TIMEOUT ?= 0 | |
| @@ -27,7 +27,6 @@ test: | |||
| 27 | 27 | vet: | |
| 28 | 28 | CGO_ENABLED=0 go vet ./... | |
| 29 | 29 | CGO_ENABLED=0 go vet -tags xwayland ./internal/app | |
| 30 | - | CGO_ENABLED=0 go vet -tags wayvnc ./internal/app | |
| 31 | 30 | race: | |
| 32 | 31 | # cgo is enabled only for the race test binary. | |
| 33 | 32 | CGO_ENABLED=1 go test -race ./... | |
| @@ -65,10 +64,8 @@ arch: adapter-imports | |||
| 65 | 64 | adapter-imports: | |
| 66 | 65 | CGO_ENABLED=0 go test . -run '^TestAdapterImports$$' -count=1 | |
| 67 | 66 | # Fast, mandatory guards for tiled content publications and SHM copies. | |
| 68 | - | # GPU capture budgets follow the package tests: run on available Vulkan GPUs, | |
| 69 | - | # otherwise skip via their existing capability gates; idle budgets need no GPU. | |
| 70 | 67 | perf-check: | |
| 71 | - | CGO_ENABLED=0 go test ./internal/adapters/outputkit/presented ./internal/core ./internal/app ./internal/adapters/drm ./internal/adapters/headless ./internal/adapters/vulkan ./internal/adapters/wayland ./internal/adapters/outputkit/capture ./internal/adapters/outputkit/routing ./internal/adapters/screencast ./internal/adapters/wayland/xwm -run '^(TestLineageObserverDormantAndAllocations|TestWaitNilFencesAllocations|TestAnimateAllocations|TestPublishAllocations|TestPublishExpansionAllocations|TestPublishSubscribersAllocations|TestPublishStashSlideAllocations|TestPublishOverviewAllocations|TestPublishLeavingAllocations|TestOutputRoutingAllocations|TestReportSeenAllocations|TestFrameLifecycleTransitionsAllocations|TestFullscreenShownAllocations|TestFrameDecisionAllocations|TestFrameDecisionExpansionAllocations|TestOverlayExpansionAllocations|TestCommitFrameAllocations|TestColorPipelineAllocations|TestShownBySnapshotAllocations|TestFlipShowsAllocations|TestMRUNoteFocusDoesNotAllocateWhenSettled|TestDueFramesAllocations|TestRenderSteadyStateAllocations|TestRenderExpansionAllocations|TestRenderSteadyStateDMABufAllocations|TestSceneOpaqueRegionAllocations|TestSceneDeltaAllocations|TestAccountFlipAllocations|TestFlipDoneAllocations|TestSceneWalkUnchangedTiledSHM|TestTiledCommitPublishAllocations|TestCapturedCommitApplyAllocations|TestCapturedViewportApplyAllocations|TestEffectiveInputEmptyTreeAllocations|TestHeadlessTiledSHMCallbackAndCopyBudget|TestReleaseHeldAllocations|TestCommitDamageAllocations|TestEmitContentAllocations|TestPresentationPushAllocations|TestPresentationSnapshotAllocations|TestAnimatingFrameSendAllocations|TestContentBatchCycleAllocations|TestWriteMappedAllocations|TestCapturedForwardAllocations|TestCommandForwardAllocations|TestOutboxQueuedDeliveryAllocations|TestCastFrameAllocations|TestCastProducerAllocations|TestCaptureCycleAllocations|TestCaptureCursorCycleAllocations|TestCaptureCursorIdleAllocations|TestCaptureDMABufCopyAllocations|TestLogScenesAllocations|TestOverviewNamedRowsAllocations|TestOverviewWorkspaceSwitchAllocations|TestBufferContentAllocations|TestDueFramesFireScratch|TestRetireSemaphoreAllocatesNothing|TestTableLookupAllocations|TestTableInsertRemoveAllocations|TestPropertyUnchangedAllocations|TestDispatchAllocations|TestConfigureFlushAllocations|TestFocusAllocations|TestSpaceAllocations|TestUnmanagedGeometryAllocations|TestFocusInUnmanagedAllocations|TestUnmanagedPublishAllocations|TestUnmanagedHitAllocations|TestOverrideMovedUnchangedAllocations|TestFullscreenConfigureAllocations|TestKeyboardGrabSyncAllocations|TestSelectionCopyAllocations|TestSelectionINCRChunkAllocations|TestSelectionCopyAllocationsWaylandToX|TestXSettingsNoChangeAllocations|TestSettleLeftAllocs)$$' -count=1 | |
| 68 | + | CGO_ENABLED=0 go test ./internal/adapters/outputkit/presented ./internal/core ./internal/app ./internal/adapters/drm ./internal/adapters/headless ./internal/adapters/vulkan ./internal/adapters/wayland ./internal/adapters/outputkit/capture ./internal/adapters/outputkit/routing ./internal/adapters/screencast ./internal/adapters/wayland/xwm -run '^(TestWaitNilFencesAllocations|TestAnimateAllocations|TestPublishAllocations|TestPublishExpansionAllocations|TestPublishSubscribersAllocations|TestPublishStashSlideAllocations|TestPublishOverviewAllocations|TestPublishLeavingAllocations|TestOutputRoutingAllocations|TestReportSeenAllocations|TestFrameLifecycleTransitionsAllocations|TestFullscreenShownAllocations|TestFrameDecisionAllocations|TestFrameDecisionExpansionAllocations|TestOverlayExpansionAllocations|TestCommitFrameAllocations|TestColorPipelineAllocations|TestShownBySnapshotAllocations|TestFlipShowsAllocations|TestMRUNoteFocusDoesNotAllocateWhenSettled|TestDueFramesAllocations|TestRenderSteadyStateAllocations|TestRenderExpansionAllocations|TestRenderSteadyStateDMABufAllocations|TestSceneOpaqueRegionAllocations|TestSceneDeltaAllocations|TestAccountFlipAllocations|TestFlipDoneAllocations|TestSceneWalkUnchangedTiledSHM|TestTiledCommitPublishAllocations|TestCapturedCommitApplyAllocations|TestCapturedViewportApplyAllocations|TestEffectiveInputEmptyTreeAllocations|TestHeadlessTiledSHMCallbackAndCopyBudget|TestReleaseHeldAllocations|TestCommitDamageAllocations|TestEmitContentAllocations|TestPresentationPushAllocations|TestPresentationSnapshotAllocations|TestAnimatingFrameSendAllocations|TestContentBatchCycleAllocations|TestWriteMappedAllocations|TestCapturedForwardAllocations|TestCommandForwardAllocations|TestOutboxQueuedDeliveryAllocations|TestCastFrameAllocations|TestCastProducerAllocations|TestCaptureCycleAllocations|TestLogScenesAllocations|TestOverviewNamedRowsAllocations|TestOverviewWorkspaceSwitchAllocations|TestBufferContentAllocations|TestDueFramesFireScratch|TestRetireSemaphoreAllocatesNothing|TestTableLookupAllocations|TestTableInsertRemoveAllocations|TestPropertyUnchangedAllocations|TestDispatchAllocations|TestConfigureFlushAllocations|TestFocusAllocations|TestSpaceAllocations|TestUnmanagedGeometryAllocations|TestFocusInUnmanagedAllocations|TestUnmanagedPublishAllocations|TestUnmanagedHitAllocations|TestOverrideMovedUnchangedAllocations|TestFullscreenConfigureAllocations|TestKeyboardGrabSyncAllocations|TestSelectionCopyAllocations|TestSelectionINCRChunkAllocations|TestSelectionCopyAllocationsWaylandToX|TestXSettingsNoChangeAllocations|TestSettleLeftAllocs)$$' -count=1 | |
| 72 | 69 | CGO_ENABLED=0 go test -tags xturbo_poison ./internal/adapters/wayland/xwm -count=1 | |
| 73 | 70 | check: vet test arch fakes-check log-check perf-check | |
| 74 | 71 | ||
| @@ -82,9 +79,6 @@ color-check: | |||
| 82 | 79 | e2e-xwayland: | |
| 83 | 80 | CGO_ENABLED=1 go test -tags xwayland -race ./internal/app -run TestXwayland -count=1 -v | |
| 84 | 81 | ||
| 85 | - | e2e-wayvnc: | |
| 86 | - | CGO_ENABLED=1 go test -tags wayvnc -race ./internal/app -run TestWayVNC -count=1 -v | |
| 87 | - | ||
| 88 | 82 | # Arch package of the committed HEAD (packaging/arch/PKGBUILD). Go modules | |
| 89 | 83 | # come from the module proxy in prepare(); the build itself runs offline. | |
| 90 | 84 | # pacman-ordered version: 0.0.0.r<commits>.g<hash>; a tag replaces 0.0.0. | |
| @@ -1,4 +1,4 @@ | |||||
| 1 | - | .PHONY: build test vet race e2e-xwayland e2e-wayvnc mocks mocks-check spv-check fakes-check log-check arch adapter-imports check perf-check color-check bin tty logs pkg install | 1 | + | .PHONY: build test vet race e2e-xwayland mocks mocks-check spv-check fakes-check log-check arch adapter-imports check perf-check color-check bin tty logs pkg install |
| 2 | 2 | ||||
| 3 | # 0 runs until quit; set e.g. TTY_TIMEOUT=60s for a safety net. | 3 | # 0 runs until quit; set e.g. TTY_TIMEOUT=60s for a safety net. | ||
| 4 | TTY_TIMEOUT ?= 0 | 4 | TTY_TIMEOUT ?= 0 | ||
| @@ -27,7 +27,6 @@ test: | |||||
| 27 | vet: | 27 | vet: | ||
| 28 | CGO_ENABLED=0 go vet ./... | 28 | CGO_ENABLED=0 go vet ./... | ||
| 29 | CGO_ENABLED=0 go vet -tags xwayland ./internal/app | 29 | CGO_ENABLED=0 go vet -tags xwayland ./internal/app | ||
| 30 | - | CGO_ENABLED=0 go vet -tags wayvnc ./internal/app | |||
| 31 | race: | 30 | race: | ||
| 32 | # cgo is enabled only for the race test binary. | 31 | # cgo is enabled only for the race test binary. | ||
| 33 | CGO_ENABLED=1 go test -race ./... | 32 | CGO_ENABLED=1 go test -race ./... | ||
| @@ -65,10 +64,8 @@ arch: adapter-imports | |||||
| 65 | adapter-imports: | 64 | adapter-imports: | ||
| 66 | CGO_ENABLED=0 go test . -run '^TestAdapterImports$$' -count=1 | 65 | CGO_ENABLED=0 go test . -run '^TestAdapterImports$$' -count=1 | ||
| 67 | # Fast, mandatory guards for tiled content publications and SHM copies. | 66 | # Fast, mandatory guards for tiled content publications and SHM copies. | ||
| 68 | - | # GPU capture budgets follow the package tests: run on available Vulkan GPUs, | |||
| 69 | - | # otherwise skip via their existing capability gates; idle budgets need no GPU. | |||
| 70 | perf-check: | 67 | perf-check: | ||
| 71 | - | CGO_ENABLED=0 go test ./internal/adapters/outputkit/presented ./internal/core ./internal/app ./internal/adapters/drm ./internal/adapters/headless ./internal/adapters/vulkan ./internal/adapters/wayland ./internal/adapters/outputkit/capture ./internal/adapters/outputkit/routing ./internal/adapters/screencast ./internal/adapters/wayland/xwm -run '^(TestLineageObserverDormantAndAllocations|TestWaitNilFencesAllocations|TestAnimateAllocations|TestPublishAllocations|TestPublishExpansionAllocations|TestPublishSubscribersAllocations|TestPublishStashSlideAllocations|TestPublishOverviewAllocations|TestPublishLeavingAllocations|TestOutputRoutingAllocations|TestReportSeenAllocations|TestFrameLifecycleTransitionsAllocations|TestFullscreenShownAllocations|TestFrameDecisionAllocations|TestFrameDecisionExpansionAllocations|TestOverlayExpansionAllocations|TestCommitFrameAllocations|TestColorPipelineAllocations|TestShownBySnapshotAllocations|TestFlipShowsAllocations|TestMRUNoteFocusDoesNotAllocateWhenSettled|TestDueFramesAllocations|TestRenderSteadyStateAllocations|TestRenderExpansionAllocations|TestRenderSteadyStateDMABufAllocations|TestSceneOpaqueRegionAllocations|TestSceneDeltaAllocations|TestAccountFlipAllocations|TestFlipDoneAllocations|TestSceneWalkUnchangedTiledSHM|TestTiledCommitPublishAllocations|TestCapturedCommitApplyAllocations|TestCapturedViewportApplyAllocations|TestEffectiveInputEmptyTreeAllocations|TestHeadlessTiledSHMCallbackAndCopyBudget|TestReleaseHeldAllocations|TestCommitDamageAllocations|TestEmitContentAllocations|TestPresentationPushAllocations|TestPresentationSnapshotAllocations|TestAnimatingFrameSendAllocations|TestContentBatchCycleAllocations|TestWriteMappedAllocations|TestCapturedForwardAllocations|TestCommandForwardAllocations|TestOutboxQueuedDeliveryAllocations|TestCastFrameAllocations|TestCastProducerAllocations|TestCaptureCycleAllocations|TestCaptureCursorCycleAllocations|TestCaptureCursorIdleAllocations|TestCaptureDMABufCopyAllocations|TestLogScenesAllocations|TestOverviewNamedRowsAllocations|TestOverviewWorkspaceSwitchAllocations|TestBufferContentAllocations|TestDueFramesFireScratch|TestRetireSemaphoreAllocatesNothing|TestTableLookupAllocations|TestTableInsertRemoveAllocations|TestPropertyUnchangedAllocations|TestDispatchAllocations|TestConfigureFlushAllocations|TestFocusAllocations|TestSpaceAllocations|TestUnmanagedGeometryAllocations|TestFocusInUnmanagedAllocations|TestUnmanagedPublishAllocations|TestUnmanagedHitAllocations|TestOverrideMovedUnchangedAllocations|TestFullscreenConfigureAllocations|TestKeyboardGrabSyncAllocations|TestSelectionCopyAllocations|TestSelectionINCRChunkAllocations|TestSelectionCopyAllocationsWaylandToX|TestXSettingsNoChangeAllocations|TestSettleLeftAllocs)$$' -count=1 | 68 | + | CGO_ENABLED=0 go test ./internal/adapters/outputkit/presented ./internal/core ./internal/app ./internal/adapters/drm ./internal/adapters/headless ./internal/adapters/vulkan ./internal/adapters/wayland ./internal/adapters/outputkit/capture ./internal/adapters/outputkit/routing ./internal/adapters/screencast ./internal/adapters/wayland/xwm -run '^(TestWaitNilFencesAllocations|TestAnimateAllocations|TestPublishAllocations|TestPublishExpansionAllocations|TestPublishSubscribersAllocations|TestPublishStashSlideAllocations|TestPublishOverviewAllocations|TestPublishLeavingAllocations|TestOutputRoutingAllocations|TestReportSeenAllocations|TestFrameLifecycleTransitionsAllocations|TestFullscreenShownAllocations|TestFrameDecisionAllocations|TestFrameDecisionExpansionAllocations|TestOverlayExpansionAllocations|TestCommitFrameAllocations|TestColorPipelineAllocations|TestShownBySnapshotAllocations|TestFlipShowsAllocations|TestMRUNoteFocusDoesNotAllocateWhenSettled|TestDueFramesAllocations|TestRenderSteadyStateAllocations|TestRenderExpansionAllocations|TestRenderSteadyStateDMABufAllocations|TestSceneOpaqueRegionAllocations|TestSceneDeltaAllocations|TestAccountFlipAllocations|TestFlipDoneAllocations|TestSceneWalkUnchangedTiledSHM|TestTiledCommitPublishAllocations|TestCapturedCommitApplyAllocations|TestCapturedViewportApplyAllocations|TestEffectiveInputEmptyTreeAllocations|TestHeadlessTiledSHMCallbackAndCopyBudget|TestReleaseHeldAllocations|TestCommitDamageAllocations|TestEmitContentAllocations|TestPresentationPushAllocations|TestPresentationSnapshotAllocations|TestAnimatingFrameSendAllocations|TestContentBatchCycleAllocations|TestWriteMappedAllocations|TestCapturedForwardAllocations|TestCommandForwardAllocations|TestOutboxQueuedDeliveryAllocations|TestCastFrameAllocations|TestCastProducerAllocations|TestCaptureCycleAllocations|TestLogScenesAllocations|TestOverviewNamedRowsAllocations|TestOverviewWorkspaceSwitchAllocations|TestBufferContentAllocations|TestDueFramesFireScratch|TestRetireSemaphoreAllocatesNothing|TestTableLookupAllocations|TestTableInsertRemoveAllocations|TestPropertyUnchangedAllocations|TestDispatchAllocations|TestConfigureFlushAllocations|TestFocusAllocations|TestSpaceAllocations|TestUnmanagedGeometryAllocations|TestFocusInUnmanagedAllocations|TestUnmanagedPublishAllocations|TestUnmanagedHitAllocations|TestOverrideMovedUnchangedAllocations|TestFullscreenConfigureAllocations|TestKeyboardGrabSyncAllocations|TestSelectionCopyAllocations|TestSelectionINCRChunkAllocations|TestSelectionCopyAllocationsWaylandToX|TestXSettingsNoChangeAllocations|TestSettleLeftAllocs)$$' -count=1 |
| 72 | CGO_ENABLED=0 go test -tags xturbo_poison ./internal/adapters/wayland/xwm -count=1 | 69 | CGO_ENABLED=0 go test -tags xturbo_poison ./internal/adapters/wayland/xwm -count=1 | ||
| 73 | check: vet test arch fakes-check log-check perf-check | 70 | check: vet test arch fakes-check log-check perf-check | ||
| 74 | 71 | ||||
| @@ -82,9 +79,6 @@ color-check: | |||||
| 82 | e2e-xwayland: | 79 | e2e-xwayland: | ||
| 83 | CGO_ENABLED=1 go test -tags xwayland -race ./internal/app -run TestXwayland -count=1 -v | 80 | CGO_ENABLED=1 go test -tags xwayland -race ./internal/app -run TestXwayland -count=1 -v | ||
| 84 | 81 | ||||
| 85 | - | e2e-wayvnc: | |||
| 86 | - | CGO_ENABLED=1 go test -tags wayvnc -race ./internal/app -run TestWayVNC -count=1 -v | |||
| 87 | - | ||||
| 88 | # Arch package of the committed HEAD (packaging/arch/PKGBUILD). Go modules | 82 | # Arch package of the committed HEAD (packaging/arch/PKGBUILD). Go modules | ||
| 89 | # come from the module proxy in prepare(); the build itself runs offline. | 83 | # come from the module proxy in prepare(); the build itself runs offline. | ||
| 90 | # pacman-ordered version: 0.0.0.r<commits>.g<hash>; a tag replaces 0.0.0. | 84 | # pacman-ordered version: 0.0.0.r<commits>.g<hash>; a tag replaces 0.0.0. | ||
M docs/capture.md +3 -19
| @@ -10,8 +10,7 @@ NeferWL supports `zwlr_screencopy_manager_v1` (used by `grim`) and `ext_image_co | |||
| 10 | 10 | ||
| 11 | 11 | With ext-image-copy-capture, a client can capture an output, a window, a workspace (even off screen, without bars) or a region of an output. The workspace and region sources use the NeferWL protocol in `internal/adapters/wayland/imagecapture/`. | |
| 12 | 12 | ||
| 13 | - | - Screenshots and recordings over these protocols are 8-bit sRGB. HDR content is tone-mapped. Screen sharing through the [portal](#portals) keeps HDR. | |
| 14 | - | - `zwlr_screencopy_manager_v1` offers shared-memory buffers and, when the GPU can write them, linux-dmabuf buffers (XRGB8888 or ARGB8888), so a recorder can keep frames on the GPU. | |
| 13 | + | - Captures are 8-bit sRGB. HDR content is tone-mapped. | |
| 15 | 14 | - The cursor is never included. | |
| 16 | 15 | - GPUs without Vulkan sync-file export (such as lavapipe) cannot capture. | |
| 17 | 16 | - `neferwl_capture_exclusion_manager_v1` lets a recorder keep its own HUD out of its frames. | |
| @@ -26,8 +25,7 @@ grim -o tv tv.png | |||
| 26 | 25 | ``` | |
| 27 | 26 | ||
| 28 | 27 | Select `tv` in an OBS output-capture source or use `wayvnc -o tv`. The same | |
| 29 | - | allowlist, portal and lock-security restrictions apply. A virtual output with | |
| 30 | - | `output.tv.hdr = on` is shared over the portal in HDR, like a physical one. | |
| 28 | + | allowlist, portal and lock-security restrictions apply; virtual outputs are SDR. | |
| 31 | 29 | ||
| 32 | 30 | ## The indicator | |
| 33 | 31 | ||
| @@ -80,26 +78,12 @@ The allowlist stops unknown programs, not a program running as you that drives a | |||
| 80 | 78 | NeferWL serves the GNOME ScreenCast, DisplayConfig, Introspect and Screenshot D-Bus interfaces, so `xdg-desktop-portal-gnome` provides screen sharing and screenshots. | |
| 81 | 79 | ||
| 82 | 80 | - **Screen sharing** in browsers and apps: install `xdg-desktop-portal-gnome` and run PipeWire. The portal dialog lists monitors and windows with their titles; the stream is a PipeWire video node. Without PipeWire, the ScreenCast interface is not offered. | |
| 83 | - | - **GPU buffers only**: the stream's buffers are DMA-BUFs the GPU allocates (DRM format modifiers), and every frame is copied into them on the GPU, synchronised through the buffers' implicit fences. No frame goes through CPU memory and no shared-memory (memfd) buffer is offered: a program that cannot take DMA-BUF frames (or a GPU that cannot export them) gets no stream, and the cast ends with a `dmabuf` reason in the log. OBS, browsers, Sunshine and GStreamer's `pipewiresrc` take DMA-BUF. `wlr-screencopy` clients such as grim still get shared-memory frames. | |
| 84 | 81 | - **Screenshots** through the portal, interactive or not: install [nefercap](https://github.com/bnema/nefercap), which writes the PNG. | |
| 85 | 82 | - A cast keeps the indicator on until it ends. It ends when the session locks, the output or window goes away, the client stops it or disconnects, or NeferWL loses the D-Bus connection. When the receiving program stops reading, the stream pauses (no frames are rendered) and the cast stays open for the next reader, as in GNOME. | |
| 86 | - | - **HDR**: sharing an output that shows HDR offers 10-bit PQ first (`xBGR_210LE`, BT.2020 primaries, SMPTE 2084, full-range RGB), with no tone mapping, and 8-bit sRGB (`BGRx`, `BGRA`) as the fallback for programs that do not take it. When the output turns HDR on or off, the stream renegotiates on the same PipeWire node: the receiving program keeps its stream. Window casts are 8-bit sRGB. | |
| 87 | - | - Unsupported: area casts and casts of a monitor the cast itself creates (`RecordVirtual`; config-declared virtual outputs are shared like any output), and the "Select area" and "Window" choices of the screenshot dialog. | |
| 83 | + | - Unsupported: area and virtual casts, and the "Select area" and "Window" choices of the screenshot dialog. | |
| 88 | 84 | ||
| 89 | 85 | The packaged `neferwl-portals.conf` routes `ScreenCast` and `Screenshot` to the gnome portal. | |
| 90 | 86 | ||
| 91 | 87 | The D-Bus interfaces are served on the session bus when NeferWL runs on a hardware session. With `--backend=headless`, pass `-dbus` to serve them. Names already owned (by a GNOME session) are skipped. | |
| 92 | 88 | ||
| 93 | 89 | Screenshots through the portal are taken without asking, for any program running as you whose executable is on the allowlist. The indicator still flashes. | |
| 94 | - | ||
| 95 | - | ### Sunshine | |
| 96 | - | ||
| 97 | - | [Sunshine](https://github.com/LizardByte/Sunshine) streams an HDR output through the portal. Set its capture method in `sunshine.conf`: | |
| 98 | - | ||
| 99 | - | ```ini | |
| 100 | - | capture = portal | |
| 101 | - | ``` | |
| 102 | - | ||
| 103 | - | Pick the output in the portal dialog, for example a virtual `tv` with `output.tv.hdr = on`. | |
| 104 | - | ||
| 105 | - | To stream from a machine with no display, run NeferWL in server mode: see [Game server](server.md). | |
| @@ -10,8 +10,7 @@ NeferWL supports `zwlr_screencopy_manager_v1` (used by `grim`) and `ext_image_co | |||||
| 10 | 10 | ||||
| 11 | With ext-image-copy-capture, a client can capture an output, a window, a workspace (even off screen, without bars) or a region of an output. The workspace and region sources use the NeferWL protocol in `internal/adapters/wayland/imagecapture/`. | 11 | With ext-image-copy-capture, a client can capture an output, a window, a workspace (even off screen, without bars) or a region of an output. The workspace and region sources use the NeferWL protocol in `internal/adapters/wayland/imagecapture/`. | ||
| 12 | 12 | ||||
| 13 | - | - Screenshots and recordings over these protocols are 8-bit sRGB. HDR content is tone-mapped. Screen sharing through the [portal](#portals) keeps HDR. | 13 | + | - Captures are 8-bit sRGB. HDR content is tone-mapped. |
| 14 | - | - `zwlr_screencopy_manager_v1` offers shared-memory buffers and, when the GPU can write them, linux-dmabuf buffers (XRGB8888 or ARGB8888), so a recorder can keep frames on the GPU. | |||
| 15 | - The cursor is never included. | 14 | - The cursor is never included. | ||
| 16 | - GPUs without Vulkan sync-file export (such as lavapipe) cannot capture. | 15 | - GPUs without Vulkan sync-file export (such as lavapipe) cannot capture. | ||
| 17 | - `neferwl_capture_exclusion_manager_v1` lets a recorder keep its own HUD out of its frames. | 16 | - `neferwl_capture_exclusion_manager_v1` lets a recorder keep its own HUD out of its frames. | ||
| @@ -26,8 +25,7 @@ grim -o tv tv.png | |||||
| 26 | ``` | 25 | ``` | ||
| 27 | 26 | ||||
| 28 | Select `tv` in an OBS output-capture source or use `wayvnc -o tv`. The same | 27 | Select `tv` in an OBS output-capture source or use `wayvnc -o tv`. The same | ||
| 29 | - | allowlist, portal and lock-security restrictions apply. A virtual output with | 28 | + | allowlist, portal and lock-security restrictions apply; virtual outputs are SDR. |
| 30 | - | `output.tv.hdr = on` is shared over the portal in HDR, like a physical one. | |||
| 31 | 29 | ||||
| 32 | ## The indicator | 30 | ## The indicator | ||
| 33 | 31 | ||||
| @@ -80,26 +78,12 @@ The allowlist stops unknown programs, not a program running as you that drives a | |||||
| 80 | NeferWL serves the GNOME ScreenCast, DisplayConfig, Introspect and Screenshot D-Bus interfaces, so `xdg-desktop-portal-gnome` provides screen sharing and screenshots. | 78 | NeferWL serves the GNOME ScreenCast, DisplayConfig, Introspect and Screenshot D-Bus interfaces, so `xdg-desktop-portal-gnome` provides screen sharing and screenshots. | ||
| 81 | 79 | ||||
| 82 | - **Screen sharing** in browsers and apps: install `xdg-desktop-portal-gnome` and run PipeWire. The portal dialog lists monitors and windows with their titles; the stream is a PipeWire video node. Without PipeWire, the ScreenCast interface is not offered. | 80 | - **Screen sharing** in browsers and apps: install `xdg-desktop-portal-gnome` and run PipeWire. The portal dialog lists monitors and windows with their titles; the stream is a PipeWire video node. Without PipeWire, the ScreenCast interface is not offered. | ||
| 83 | - | - **GPU buffers only**: the stream's buffers are DMA-BUFs the GPU allocates (DRM format modifiers), and every frame is copied into them on the GPU, synchronised through the buffers' implicit fences. No frame goes through CPU memory and no shared-memory (memfd) buffer is offered: a program that cannot take DMA-BUF frames (or a GPU that cannot export them) gets no stream, and the cast ends with a `dmabuf` reason in the log. OBS, browsers, Sunshine and GStreamer's `pipewiresrc` take DMA-BUF. `wlr-screencopy` clients such as grim still get shared-memory frames. | |||
| 84 | - **Screenshots** through the portal, interactive or not: install [nefercap](https://github.com/bnema/nefercap), which writes the PNG. | 81 | - **Screenshots** through the portal, interactive or not: install [nefercap](https://github.com/bnema/nefercap), which writes the PNG. | ||
| 85 | - A cast keeps the indicator on until it ends. It ends when the session locks, the output or window goes away, the client stops it or disconnects, or NeferWL loses the D-Bus connection. When the receiving program stops reading, the stream pauses (no frames are rendered) and the cast stays open for the next reader, as in GNOME. | 82 | - A cast keeps the indicator on until it ends. It ends when the session locks, the output or window goes away, the client stops it or disconnects, or NeferWL loses the D-Bus connection. When the receiving program stops reading, the stream pauses (no frames are rendered) and the cast stays open for the next reader, as in GNOME. | ||
| 86 | - | - **HDR**: sharing an output that shows HDR offers 10-bit PQ first (`xBGR_210LE`, BT.2020 primaries, SMPTE 2084, full-range RGB), with no tone mapping, and 8-bit sRGB (`BGRx`, `BGRA`) as the fallback for programs that do not take it. When the output turns HDR on or off, the stream renegotiates on the same PipeWire node: the receiving program keeps its stream. Window casts are 8-bit sRGB. | 83 | + | - Unsupported: area and virtual casts, and the "Select area" and "Window" choices of the screenshot dialog. |
| 87 | - | - Unsupported: area casts and casts of a monitor the cast itself creates (`RecordVirtual`; config-declared virtual outputs are shared like any output), and the "Select area" and "Window" choices of the screenshot dialog. | |||
| 88 | 84 | ||||
| 89 | The packaged `neferwl-portals.conf` routes `ScreenCast` and `Screenshot` to the gnome portal. | 85 | The packaged `neferwl-portals.conf` routes `ScreenCast` and `Screenshot` to the gnome portal. | ||
| 90 | 86 | ||||
| 91 | The D-Bus interfaces are served on the session bus when NeferWL runs on a hardware session. With `--backend=headless`, pass `-dbus` to serve them. Names already owned (by a GNOME session) are skipped. | 87 | The D-Bus interfaces are served on the session bus when NeferWL runs on a hardware session. With `--backend=headless`, pass `-dbus` to serve them. Names already owned (by a GNOME session) are skipped. | ||
| 92 | 88 | ||||
| 93 | Screenshots through the portal are taken without asking, for any program running as you whose executable is on the allowlist. The indicator still flashes. | 89 | Screenshots through the portal are taken without asking, for any program running as you whose executable is on the allowlist. The indicator still flashes. | ||
| 94 | - | ||||
| 95 | - | ### Sunshine | |||
| 96 | - | ||||
| 97 | - | [Sunshine](https://github.com/LizardByte/Sunshine) streams an HDR output through the portal. Set its capture method in `sunshine.conf`: | |||
| 98 | - | ||||
| 99 | - | ```ini | |||
| 100 | - | capture = portal | |||
| 101 | - | ``` | |||
| 102 | - | ||||
| 103 | - | Pick the output in the portal dialog, for example a virtual `tv` with `output.tv.hdr = on`. | |||
| 104 | - | ||||
| 105 | - | To stream from a machine with no display, run NeferWL in server mode: see [Game server](server.md). | |||
M docs/config.md +6 -37
| @@ -85,9 +85,8 @@ See [examples/config](../examples/config) for every key with its default. | |||
| 85 | 85 | | `output.<name>.transform` | `normal` | `90`, `180`, `270`, `flipped`, `flipped-90`, … | | |
| 86 | 86 | | `output.<name>.primary` | `off` | Focused at startup | | |
| 87 | 87 | | `output.<name>.right-of`, `.left-of`, `.above`, `.below`, `.offset` | automatic | [Output placement](#output-placement) | | |
| 88 | - | | `output.<name>.hdr` | `off` | [HDR](#hdr) on capable displays and on virtual outputs | | |
| 88 | + | | `output.<name>.hdr` | `off` | [HDR](#hdr) on capable displays; ignored with a warning on virtual outputs, as are `.sdr-expand`, `.sdr-expand-intensity`, `.sdr-expand-peak` and `.sdr-decode` (always SDR) | | |
| 89 | 89 | | `output.<name>.sdr-brightness` | `203` | Brightness of SDR content in HDR, in nits (80–1000) | | |
| 90 | - | | `output.<name>.keep-focus` | `off` | Keeps an X11 window on this output X11-active while a native window has the keyboard; see [Virtual outputs](#virtual-outputs) | | |
| 91 | 90 | | `drm.devices` | empty (all GPUs) | Comma-separated [GPUs](#gpus) NeferWL uses (restart required) | | |
| 92 | 91 | | `drm.ignore` | empty | Comma-separated [GPUs](#gpus) NeferWL leaves alone (restart required) | | |
| 93 | 92 | | `render.device` | automatic | [GPU](#gpus) that renders; `NEFERWL_RENDER_DEVICE` overrides it (restart required) | | |
| @@ -167,7 +166,6 @@ output.<name>.primary = off | |||
| 167 | 166 | output.<name>.offset = 0 | |
| 168 | 167 | output.<name>.hdr = off | |
| 169 | 168 | output.<name>.sdr-brightness = 203 | |
| 170 | - | output.<name>.keep-focus = off | |
| 171 | 169 | output.<name>.sdr-expand = auto | |
| 172 | 170 | output.<name>.sdr-expand-intensity = 0.5 | |
| 173 | 171 | output.<name>.sdr-expand-peak = 0 | |
| @@ -178,7 +176,7 @@ Outputs are arranged automatically unless `.right-of`, `.left-of`, `.above` or ` | |||
| 178 | 176 | ||
| 179 | 177 | ## Window rules | |
| 180 | 178 | ||
| 181 | - | Rules place an app's windows when they first open. A window a rule opens on another output, even an isolated one, takes the focus there and that output becomes focused, as it would have taken the focus on the focused output; a window that would open in the background (behind another app's fullscreen window, during overview or lock) stays unfocused. A rule matches its app ID and, when set, its title. A title rule's output/workspace placement also applies when a later title first matches, at most once per rule per window. This later move never changes floating state or column width. When the focused window moves, it stays the focused window on the destination output, even an isolated one, and that output becomes focused (not while the source output's overview is open); otherwise focus and view are unchanged. With `output.<name>.input` bindings, input from an unbound device returns focus to the last unbound output. SDR expansion settings follow the current title match. | |
| 179 | + | Rules place an app's windows when they first open. A rule matches its app ID and, when set, its title. A title rule's output/workspace placement also applies when a later title first matches, at most once per rule per window. This later move never changes focus or view, floating state, or column width. SDR expansion settings follow the current title match. | |
| 182 | 180 | ||
| 183 | 181 | | Key | Meaning | | |
| 184 | 182 | |---|---| | |
| @@ -207,7 +205,7 @@ rule.calc.floating = on | |||
| 207 | 205 | ``` | |
| 208 | 206 | ||
| 209 | 207 | - Every matching rule applies, in file order; later rules win. | |
| 210 | - | - A rule never moves your focus or view, except a new window or a focused window it sends to another output (above). | |
| 208 | + | - A rule never moves your focus or view. | |
| 211 | 209 | - Proton games (X11) use `steam_app_<id>` as app ID, taken from `WM_CLASS`. | |
| 212 | 210 | - An X11 window that opens exactly on one output's area opens on that output, unless a rule sets `output`. | |
| 213 | 211 | - A rule can float a Proton game: `rule.games.app-id = steam_app_\d+` with `rule.games.floating = on`. Without a rule, X11 games tile until they ask for fullscreen. | |
| @@ -215,7 +213,7 @@ rule.calc.floating = on | |||
| 215 | 213 | ||
| 216 | 214 | ## Virtual outputs | |
| 217 | 215 | ||
| 218 | - | Declare a virtual output in the config; it exists while its entry remains: | |
| 216 | + | Declare an SDR output in the config; it exists while its entry remains: | |
| 219 | 217 | ||
| 220 | 218 | ```ini | |
| 221 | 219 | output.tv = virtual 1920x1080@60 | |
| @@ -223,15 +221,8 @@ output.tv = virtual 1920x1080@60 | |||
| 223 | 221 | ||
| 224 | 222 | Refresh defaults to 60 Hz. Dimensions must be 1–16384; names use ASCII | |
| 225 | 223 | letters, digits, `.`, `_` and `-`, and must not collide with a physical head. | |
| 226 | - | Invalid declarations warn and are ignored. | |
| 227 | - | ||
| 228 | - | Virtual outputs are SDR by default. `output.tv.hdr = on` makes one HDR | |
| 229 | - | (PQ/BT.2020, reported as a 1000-nit display) when the renderer supports it, | |
| 230 | - | else it falls back to SDR and logs why. `.sdr-brightness`, `.sdr-expand`, | |
| 231 | - | `.sdr-expand-intensity`, `.sdr-expand-peak` and `.sdr-decode` apply as on | |
| 232 | - | physical outputs. Reloading after a change to `.hdr` or `.sdr-brightness` | |
| 233 | - | restarts the output's rendering; its windows, workspaces and screen casts | |
| 234 | - | stay. `.sdr-expand-peak` applies at once. | |
| 224 | + | Invalid declarations warn and are ignored. HDR and SDR-expansion overrides | |
| 225 | + | warn and are ignored on virtual outputs. | |
| 235 | 226 | ||
| 236 | 227 | Without placement, `tv` is isolated: automatic layout, unbound pointers, | |
| 237 | 228 | directional focus and startup focus skip it. Isolated outputs share a column | |
| @@ -276,16 +267,6 @@ rule.big.title = (?i)big picture | |||
| 276 | 267 | rule.big.output = tv | |
| 277 | 268 | ``` | |
| 278 | 269 | ||
| 279 | - | Steam Big Picture picks its controller layout from the X11 focus. With | |
| 280 | - | `output.tv.keep-focus = on`, an X11 (Xwayland) window on `tv` keeps the X11 | |
| 281 | - | input focus and `_NET_ACTIVE_WINDOW` while a native window on another output | |
| 282 | - | has the keyboard: the window focused on `tv`, else the most recently mapped | |
| 283 | - | visible one. Wayland keyboard focus is unchanged, so typed keys go to the | |
| 284 | - | focused window only. It applies to X11 windows only; an X11 window with the | |
| 285 | - | keyboard elsewhere takes precedence, and a locked session clears it. With | |
| 286 | - | several such outputs, the first in config order wins. Sunshine's virtual | |
| 287 | - | keyboard and mouse still follow normal focus. | |
| 288 | - | ||
| 289 | 270 | For Sunshine, a `global_prep_cmd` command can select the client's mode: | |
| 290 | 271 | `wlr-randr --output tv --custom-mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}`. | |
| 291 | 272 | Use `wayvnc -o tv` for remote access, or select `tv` in OBS's screen-capture | |
| @@ -480,7 +461,6 @@ The default layout. Columns sit side by side in bands of up to `max-columns`, st | |||
| 480 | 461 | - A fullscreen window gets a band of its own right below the band it was in (expelled into its own column first when it shares one), so the other columns stay put and focus changes among them leave the fullscreen output alone. Leaving fullscreen keeps the column in that band. A parentless, non-stashed floating window becomes a tiled column in its own band below the selected column's band on fullscreen entry, including `toggle-fullscreen`; dialogs with a parent and stash entries stay floating. | |
| 481 | 462 | - A window requesting fullscreen before its first map opens fullscreen and focused, using the same band placement as `toggle-fullscreen`. The last pre-map set/unset request wins; child dialogs are excluded and window rules retain their workspace/output. Requests arriving after map are honoured immediately, subject to the usual fullscreen focus rules; `toggle-fullscreen` is unaffected. | |
| 482 | 463 | - A new window from another app never disturbs a covering fullscreen window; a window of the same app comes forward (equal non-zero PID or equal non-empty app ID). In cascade it opens focused in a new band; in scroll it opens focused to the right; in fixed it opens as a focused float above fullscreen. The original window keeps its fullscreen state. In scroll, a floating fullscreen cover is promoted to a tile when the same-app window arrives; ordinary fullscreen requests keep their existing floating semantics. | |
| 483 | - | - A tiled window that a fullscreen window's program launches as a different program (a game started from Steam Big Picture, found by [process lineage](#process-lineage-shell-exclusions)) opens fullscreen too, in a column of its own to the right in scroll or a band of its own below in cascade, and fills the screen; the launcher stays fullscreen next to it. Moving the focus between them changes which one fills the screen, with no fullscreen toggle, and closing the program returns to the fullscreen launcher. Windows of the launcher's own app, floating and parented windows keep the behaviour above; fixed opens the program as a float above the launcher. | |
| 484 | 464 | - `move-column-left/right` on a fullscreen window (tiled or floating) sends it to the neighbor monitor, where it stays fullscreen and focused; with no neighbor monitor nothing moves. | |
| 485 | 465 | - A band left empty goes away. A smaller `max-columns` moves the extra columns of a band to a new band below it. | |
| 486 | 466 | ||
| @@ -635,14 +615,3 @@ X11 games are classified as games for auto mode, not forced past output gates. | |||
| 635 | 615 | Other X11 games need an app-ID rule because X11 carries no Wayland game content | |
| 636 | 616 | type. `on` requests expansion eligibility; it does not bypass HDR/headroom gates. | |
| 637 | 617 | Placement fields still apply only at first map. | |
| 638 | - | ||
| 639 | - | ### Process-lineage shell exclusions | |
| 640 | - | ||
| 641 | - | `lineage.shells = wrapper, custom-launcher` adds process **comm** names to the | |
| 642 | - | common-ancestor exclusion list. It reloads live and affects future first-map | |
| 643 | - | lineage decisions; existing launcher edges are retained. Names are limited to | |
| 644 | - | 16 bytes. Defaults are `sh`, `bash`, `zsh`, `fish`, `dash`, `ksh`, `tcsh`, `csh`, | |
| 645 | - | `nu`, `elvish`, `xonsh`, `env`, `sudo`, `doas`, `setsid`, `nohup`, `timeout`, | |
| 646 | - | `systemd-run`, and `flatpak-spawn`. Generic launch wrappers (including | |
| 647 | - | `flatpak-spawn`) do not establish application identity. Direct ancestor matches | |
| 648 | - | are unaffected; common meeting points that are session leaders are excluded too. | |
| @@ -85,9 +85,8 @@ See [examples/config](../examples/config) for every key with its default. | |||||
| 85 | | `output.<name>.transform` | `normal` | `90`, `180`, `270`, `flipped`, `flipped-90`, … | | 85 | | `output.<name>.transform` | `normal` | `90`, `180`, `270`, `flipped`, `flipped-90`, … | | ||
| 86 | | `output.<name>.primary` | `off` | Focused at startup | | 86 | | `output.<name>.primary` | `off` | Focused at startup | | ||
| 87 | | `output.<name>.right-of`, `.left-of`, `.above`, `.below`, `.offset` | automatic | [Output placement](#output-placement) | | 87 | | `output.<name>.right-of`, `.left-of`, `.above`, `.below`, `.offset` | automatic | [Output placement](#output-placement) | | ||
| 88 | - | | `output.<name>.hdr` | `off` | [HDR](#hdr) on capable displays and on virtual outputs | | 88 | + | | `output.<name>.hdr` | `off` | [HDR](#hdr) on capable displays; ignored with a warning on virtual outputs, as are `.sdr-expand`, `.sdr-expand-intensity`, `.sdr-expand-peak` and `.sdr-decode` (always SDR) | |
| 89 | | `output.<name>.sdr-brightness` | `203` | Brightness of SDR content in HDR, in nits (80–1000) | | 89 | | `output.<name>.sdr-brightness` | `203` | Brightness of SDR content in HDR, in nits (80–1000) | | ||
| 90 | - | | `output.<name>.keep-focus` | `off` | Keeps an X11 window on this output X11-active while a native window has the keyboard; see [Virtual outputs](#virtual-outputs) | | |||
| 91 | | `drm.devices` | empty (all GPUs) | Comma-separated [GPUs](#gpus) NeferWL uses (restart required) | | 90 | | `drm.devices` | empty (all GPUs) | Comma-separated [GPUs](#gpus) NeferWL uses (restart required) | | ||
| 92 | | `drm.ignore` | empty | Comma-separated [GPUs](#gpus) NeferWL leaves alone (restart required) | | 91 | | `drm.ignore` | empty | Comma-separated [GPUs](#gpus) NeferWL leaves alone (restart required) | | ||
| 93 | | `render.device` | automatic | [GPU](#gpus) that renders; `NEFERWL_RENDER_DEVICE` overrides it (restart required) | | 92 | | `render.device` | automatic | [GPU](#gpus) that renders; `NEFERWL_RENDER_DEVICE` overrides it (restart required) | | ||
| @@ -167,7 +166,6 @@ output.<name>.primary = off | |||||
| 167 | output.<name>.offset = 0 | 166 | output.<name>.offset = 0 | ||
| 168 | output.<name>.hdr = off | 167 | output.<name>.hdr = off | ||
| 169 | output.<name>.sdr-brightness = 203 | 168 | output.<name>.sdr-brightness = 203 | ||
| 170 | - | output.<name>.keep-focus = off | |||
| 171 | output.<name>.sdr-expand = auto | 169 | output.<name>.sdr-expand = auto | ||
| 172 | output.<name>.sdr-expand-intensity = 0.5 | 170 | output.<name>.sdr-expand-intensity = 0.5 | ||
| 173 | output.<name>.sdr-expand-peak = 0 | 171 | output.<name>.sdr-expand-peak = 0 | ||
| @@ -178,7 +176,7 @@ Outputs are arranged automatically unless `.right-of`, `.left-of`, `.above` or ` | |||||
| 178 | 176 | ||||
| 179 | ## Window rules | 177 | ## Window rules | ||
| 180 | 178 | ||||
| 181 | - | Rules place an app's windows when they first open. A window a rule opens on another output, even an isolated one, takes the focus there and that output becomes focused, as it would have taken the focus on the focused output; a window that would open in the background (behind another app's fullscreen window, during overview or lock) stays unfocused. A rule matches its app ID and, when set, its title. A title rule's output/workspace placement also applies when a later title first matches, at most once per rule per window. This later move never changes floating state or column width. When the focused window moves, it stays the focused window on the destination output, even an isolated one, and that output becomes focused (not while the source output's overview is open); otherwise focus and view are unchanged. With `output.<name>.input` bindings, input from an unbound device returns focus to the last unbound output. SDR expansion settings follow the current title match. | 179 | + | Rules place an app's windows when they first open. A rule matches its app ID and, when set, its title. A title rule's output/workspace placement also applies when a later title first matches, at most once per rule per window. This later move never changes focus or view, floating state, or column width. SDR expansion settings follow the current title match. |
| 182 | 180 | ||||
| 183 | | Key | Meaning | | 181 | | Key | Meaning | | ||
| 184 | |---|---| | 182 | |---|---| | ||
| @@ -207,7 +205,7 @@ rule.calc.floating = on | |||||
| 207 | ``` | 205 | ``` | ||
| 208 | 206 | ||||
| 209 | - Every matching rule applies, in file order; later rules win. | 207 | - Every matching rule applies, in file order; later rules win. | ||
| 210 | - | - A rule never moves your focus or view, except a new window or a focused window it sends to another output (above). | 208 | + | - A rule never moves your focus or view. |
| 211 | - Proton games (X11) use `steam_app_<id>` as app ID, taken from `WM_CLASS`. | 209 | - Proton games (X11) use `steam_app_<id>` as app ID, taken from `WM_CLASS`. | ||
| 212 | - An X11 window that opens exactly on one output's area opens on that output, unless a rule sets `output`. | 210 | - An X11 window that opens exactly on one output's area opens on that output, unless a rule sets `output`. | ||
| 213 | - A rule can float a Proton game: `rule.games.app-id = steam_app_\d+` with `rule.games.floating = on`. Without a rule, X11 games tile until they ask for fullscreen. | 211 | - A rule can float a Proton game: `rule.games.app-id = steam_app_\d+` with `rule.games.floating = on`. Without a rule, X11 games tile until they ask for fullscreen. | ||
| @@ -215,7 +213,7 @@ rule.calc.floating = on | |||||
| 215 | 213 | ||||
| 216 | ## Virtual outputs | 214 | ## Virtual outputs | ||
| 217 | 215 | ||||
| 218 | - | Declare a virtual output in the config; it exists while its entry remains: | 216 | + | Declare an SDR output in the config; it exists while its entry remains: |
| 219 | 217 | ||||
| 220 | ```ini | 218 | ```ini | ||
| 221 | output.tv = virtual 1920x1080@60 | 219 | output.tv = virtual 1920x1080@60 | ||
| @@ -223,15 +221,8 @@ output.tv = virtual 1920x1080@60 | |||||
| 223 | 221 | ||||
| 224 | Refresh defaults to 60 Hz. Dimensions must be 1–16384; names use ASCII | 222 | Refresh defaults to 60 Hz. Dimensions must be 1–16384; names use ASCII | ||
| 225 | letters, digits, `.`, `_` and `-`, and must not collide with a physical head. | 223 | letters, digits, `.`, `_` and `-`, and must not collide with a physical head. | ||
| 226 | - | Invalid declarations warn and are ignored. | 224 | + | Invalid declarations warn and are ignored. HDR and SDR-expansion overrides |
| 227 | - | 225 | + | warn and are ignored on virtual outputs. | |
| 228 | - | Virtual outputs are SDR by default. `output.tv.hdr = on` makes one HDR | |||
| 229 | - | (PQ/BT.2020, reported as a 1000-nit display) when the renderer supports it, | |||
| 230 | - | else it falls back to SDR and logs why. `.sdr-brightness`, `.sdr-expand`, | |||
| 231 | - | `.sdr-expand-intensity`, `.sdr-expand-peak` and `.sdr-decode` apply as on | |||
| 232 | - | physical outputs. Reloading after a change to `.hdr` or `.sdr-brightness` | |||
| 233 | - | restarts the output's rendering; its windows, workspaces and screen casts | |||
| 234 | - | stay. `.sdr-expand-peak` applies at once. | |||
| 235 | 226 | ||||
| 236 | Without placement, `tv` is isolated: automatic layout, unbound pointers, | 227 | Without placement, `tv` is isolated: automatic layout, unbound pointers, | ||
| 237 | directional focus and startup focus skip it. Isolated outputs share a column | 228 | directional focus and startup focus skip it. Isolated outputs share a column | ||
| @@ -276,16 +267,6 @@ rule.big.title = (?i)big picture | |||||
| 276 | rule.big.output = tv | 267 | rule.big.output = tv | ||
| 277 | ``` | 268 | ``` | ||
| 278 | 269 | ||||
| 279 | - | Steam Big Picture picks its controller layout from the X11 focus. With | |||
| 280 | - | `output.tv.keep-focus = on`, an X11 (Xwayland) window on `tv` keeps the X11 | |||
| 281 | - | input focus and `_NET_ACTIVE_WINDOW` while a native window on another output | |||
| 282 | - | has the keyboard: the window focused on `tv`, else the most recently mapped | |||
| 283 | - | visible one. Wayland keyboard focus is unchanged, so typed keys go to the | |||
| 284 | - | focused window only. It applies to X11 windows only; an X11 window with the | |||
| 285 | - | keyboard elsewhere takes precedence, and a locked session clears it. With | |||
| 286 | - | several such outputs, the first in config order wins. Sunshine's virtual | |||
| 287 | - | keyboard and mouse still follow normal focus. | |||
| 288 | - | ||||
| 289 | For Sunshine, a `global_prep_cmd` command can select the client's mode: | 270 | For Sunshine, a `global_prep_cmd` command can select the client's mode: | ||
| 290 | `wlr-randr --output tv --custom-mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}`. | 271 | `wlr-randr --output tv --custom-mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}`. | ||
| 291 | Use `wayvnc -o tv` for remote access, or select `tv` in OBS's screen-capture | 272 | Use `wayvnc -o tv` for remote access, or select `tv` in OBS's screen-capture | ||
| @@ -480,7 +461,6 @@ The default layout. Columns sit side by side in bands of up to `max-columns`, st | |||||
| 480 | - A fullscreen window gets a band of its own right below the band it was in (expelled into its own column first when it shares one), so the other columns stay put and focus changes among them leave the fullscreen output alone. Leaving fullscreen keeps the column in that band. A parentless, non-stashed floating window becomes a tiled column in its own band below the selected column's band on fullscreen entry, including `toggle-fullscreen`; dialogs with a parent and stash entries stay floating. | 461 | - A fullscreen window gets a band of its own right below the band it was in (expelled into its own column first when it shares one), so the other columns stay put and focus changes among them leave the fullscreen output alone. Leaving fullscreen keeps the column in that band. A parentless, non-stashed floating window becomes a tiled column in its own band below the selected column's band on fullscreen entry, including `toggle-fullscreen`; dialogs with a parent and stash entries stay floating. | ||
| 481 | - A window requesting fullscreen before its first map opens fullscreen and focused, using the same band placement as `toggle-fullscreen`. The last pre-map set/unset request wins; child dialogs are excluded and window rules retain their workspace/output. Requests arriving after map are honoured immediately, subject to the usual fullscreen focus rules; `toggle-fullscreen` is unaffected. | 462 | - A window requesting fullscreen before its first map opens fullscreen and focused, using the same band placement as `toggle-fullscreen`. The last pre-map set/unset request wins; child dialogs are excluded and window rules retain their workspace/output. Requests arriving after map are honoured immediately, subject to the usual fullscreen focus rules; `toggle-fullscreen` is unaffected. | ||
| 482 | - A new window from another app never disturbs a covering fullscreen window; a window of the same app comes forward (equal non-zero PID or equal non-empty app ID). In cascade it opens focused in a new band; in scroll it opens focused to the right; in fixed it opens as a focused float above fullscreen. The original window keeps its fullscreen state. In scroll, a floating fullscreen cover is promoted to a tile when the same-app window arrives; ordinary fullscreen requests keep their existing floating semantics. | 463 | - A new window from another app never disturbs a covering fullscreen window; a window of the same app comes forward (equal non-zero PID or equal non-empty app ID). In cascade it opens focused in a new band; in scroll it opens focused to the right; in fixed it opens as a focused float above fullscreen. The original window keeps its fullscreen state. In scroll, a floating fullscreen cover is promoted to a tile when the same-app window arrives; ordinary fullscreen requests keep their existing floating semantics. | ||
| 483 | - | - A tiled window that a fullscreen window's program launches as a different program (a game started from Steam Big Picture, found by [process lineage](#process-lineage-shell-exclusions)) opens fullscreen too, in a column of its own to the right in scroll or a band of its own below in cascade, and fills the screen; the launcher stays fullscreen next to it. Moving the focus between them changes which one fills the screen, with no fullscreen toggle, and closing the program returns to the fullscreen launcher. Windows of the launcher's own app, floating and parented windows keep the behaviour above; fixed opens the program as a float above the launcher. | |||
| 484 | - `move-column-left/right` on a fullscreen window (tiled or floating) sends it to the neighbor monitor, where it stays fullscreen and focused; with no neighbor monitor nothing moves. | 464 | - `move-column-left/right` on a fullscreen window (tiled or floating) sends it to the neighbor monitor, where it stays fullscreen and focused; with no neighbor monitor nothing moves. | ||
| 485 | - A band left empty goes away. A smaller `max-columns` moves the extra columns of a band to a new band below it. | 465 | - A band left empty goes away. A smaller `max-columns` moves the extra columns of a band to a new band below it. | ||
| 486 | 466 | ||||
| @@ -635,14 +615,3 @@ X11 games are classified as games for auto mode, not forced past output gates. | |||||
| 635 | Other X11 games need an app-ID rule because X11 carries no Wayland game content | 615 | Other X11 games need an app-ID rule because X11 carries no Wayland game content | ||
| 636 | type. `on` requests expansion eligibility; it does not bypass HDR/headroom gates. | 616 | type. `on` requests expansion eligibility; it does not bypass HDR/headroom gates. | ||
| 637 | Placement fields still apply only at first map. | 617 | Placement fields still apply only at first map. | ||
| 638 | - | ||||
| 639 | - | ### Process-lineage shell exclusions | |||
| 640 | - | ||||
| 641 | - | `lineage.shells = wrapper, custom-launcher` adds process **comm** names to the | |||
| 642 | - | common-ancestor exclusion list. It reloads live and affects future first-map | |||
| 643 | - | lineage decisions; existing launcher edges are retained. Names are limited to | |||
| 644 | - | 16 bytes. Defaults are `sh`, `bash`, `zsh`, `fish`, `dash`, `ksh`, `tcsh`, `csh`, | |||
| 645 | - | `nu`, `elvish`, `xonsh`, `env`, `sudo`, `doas`, `setsid`, `nohup`, `timeout`, | |||
| 646 | - | `systemd-run`, and `flatpak-spawn`. Generic launch wrappers (including | |||
| 647 | - | `flatpak-spawn`) do not establish application identity. Direct ancestor matches | |||
| 648 | - | are unaffected; common meeting points that are session leaders are excluded too. | |||
M docs/desktop.md +1 -2
| @@ -161,14 +161,13 @@ Each window also carries metadata keys: | |||
| 161 | 161 | - `content_type`: `game`, `video`, `photo` or empty, from `wp_content_type_v1`. | |
| 162 | 162 | - `xwayland`: the window is an X11 window on either backend. | |
| 163 | 163 | ||
| 164 | - | The `workspaces` list holds every workspace with its `visible` flag, its columns and the windows in them, each with `x`, `y`, `width` and `height` in logical pixels of its output. A workspace's `cover` is its active fullscreen window, 0 if none; a window's `fullscreen` is also set for the other fullscreen windows it holds, which sit output-sized in their own column or band. The file is written at most once per second. | |
| 164 | + | The `workspaces` list holds every workspace with its `visible` flag, its columns and the windows in them, each with `x`, `y`, `width` and `height` in logical pixels of its output. The file is written at most once per second. | |
| 165 | 165 | ||
| 166 | 166 | ```sh | |
| 167 | 167 | neferwl state # the whole state | |
| 168 | 168 | neferwl state output-of "$PID" # the output showing that process's window | |
| 169 | 169 | neferwl state | jq '[.windows[] | select(.hidden)] | length' # windows in hidden stashes | |
| 170 | 170 | neferwl state | jq '[.windows[] | select(.fullscreen)] | length' # fullscreen windows | |
| 171 | - | neferwl state | jq '.workspaces[] | select(.visible) | .cover' # the window covering the screen | |
| 172 | 171 | neferwl state | jq '.workspaces[] | select(.visible) | .columns[] | .width' # column widths on screen | |
| 173 | 172 | ``` | |
| 174 | 173 | ||
| @@ -161,14 +161,13 @@ Each window also carries metadata keys: | |||||
| 161 | - `content_type`: `game`, `video`, `photo` or empty, from `wp_content_type_v1`. | 161 | - `content_type`: `game`, `video`, `photo` or empty, from `wp_content_type_v1`. | ||
| 162 | - `xwayland`: the window is an X11 window on either backend. | 162 | - `xwayland`: the window is an X11 window on either backend. | ||
| 163 | 163 | ||||
| 164 | - | The `workspaces` list holds every workspace with its `visible` flag, its columns and the windows in them, each with `x`, `y`, `width` and `height` in logical pixels of its output. A workspace's `cover` is its active fullscreen window, 0 if none; a window's `fullscreen` is also set for the other fullscreen windows it holds, which sit output-sized in their own column or band. The file is written at most once per second. | 164 | + | The `workspaces` list holds every workspace with its `visible` flag, its columns and the windows in them, each with `x`, `y`, `width` and `height` in logical pixels of its output. The file is written at most once per second. |
| 165 | 165 | ||||
| 166 | ```sh | 166 | ```sh | ||
| 167 | neferwl state # the whole state | 167 | neferwl state # the whole state | ||
| 168 | neferwl state output-of "$PID" # the output showing that process's window | 168 | neferwl state output-of "$PID" # the output showing that process's window | ||
| 169 | neferwl state | jq '[.windows[] | select(.hidden)] | length' # windows in hidden stashes | 169 | neferwl state | jq '[.windows[] | select(.hidden)] | length' # windows in hidden stashes | ||
| 170 | neferwl state | jq '[.windows[] | select(.fullscreen)] | length' # fullscreen windows | 170 | neferwl state | jq '[.windows[] | select(.fullscreen)] | length' # fullscreen windows | ||
| 171 | - | neferwl state | jq '.workspaces[] | select(.visible) | .cover' # the window covering the screen | |||
| 172 | neferwl state | jq '.workspaces[] | select(.visible) | .columns[] | .width' # column widths on screen | 171 | neferwl state | jq '.workspaces[] | select(.visible) | .columns[] | .width' # column widths on screen | ||
| 173 | ``` | 172 | ``` | ||
| 174 | 173 | ||||
M docs/dev/headless.md +0 -16
| @@ -64,22 +64,6 @@ WAYLAND_DISPLAY=<name> go run ./examples/testime -preedit nihon -commit 日本 | |||
| 64 | 64 | ||
| 65 | 65 | `-count <n>` exits after n commits; `-delay` sets the time between preedit and commit. | |
| 66 | 66 | ||
| 67 | - | ## Testing the virtual pointer | |
| 68 | - | ||
| 69 | - | `neferwl pointer` drives the pointer of the headless session (same display resolution as `neferwl state`); run it with the headless `WAYLAND_DISPLAY`: | |
| 70 | - | ||
| 71 | - | ```sh | |
| 72 | - | WAYLAND_DISPLAY=<name> neferwl pointer abs 0.1 0.5 click | |
| 73 | - | WAYLAND_DISPLAY=<name> neferwl pointer drag 100 0 scroll down 3 | |
| 74 | - | WAYLAND_DISPLAY=<name> neferwl pointer --output HEADLESS-2 abs 0.5 0.5 | |
| 75 | - | ``` | |
| 76 | - | ||
| 77 | - | Check the result with `neferwl state` (`.window.id` is the focused window). Headless screenshots do not show the cursor. `TestPointerCLI` (`internal/app`, in `go test ./...`) runs the built binary against a headless NeferWL and checks a click, a drag, a scroll and the release at exit on a test client. | |
| 78 | - | ||
| 79 | - | ## wayvnc check | |
| 80 | - | ||
| 81 | - | `make e2e-wayvnc` runs `TestWayVNC` (build tag `wayvnc`; skips without `wayvnc` on `PATH`). A headless NeferWL with a 320x240 output allowlists wayvnc in a throwaway capture-allow file and maps a client that shows a red square; then `wayvnc -o HEADLESS-1` runs on a free localhost port. A minimal RFB client in the test checks that the framebuffer has the output's size and shows the square, that a pointer event over the square enters the client and a click reaches it, and that a key event types `a` (KEY_A) into the focused client. | |
| 82 | - | ||
| 83 | 67 | ## X11 check | |
| 84 | 68 | ||
| 85 | 69 | `make e2e-xwayland` runs the end-to-end test of the built-in window manager (`xwayland = builtin`). It is behind the `xwayland` build tag, so `go test ./...` and `make check` only compile it (`go vet -tags xwayland`). It needs `Xwayland` on `PATH` and a GPU, and skips without Xwayland. The clipboard test also needs `wl-copy` and `wl-paste` (wl-clipboard) and skips without them; they run with the headless `WAYLAND_DISPLAY` and need no extra focus step, since the focused probe window is enough for `wl-copy --foreground` to set the selection. | |
| @@ -64,22 +64,6 @@ WAYLAND_DISPLAY=<name> go run ./examples/testime -preedit nihon -commit 日本 | |||||
| 64 | 64 | ||||
| 65 | `-count <n>` exits after n commits; `-delay` sets the time between preedit and commit. | 65 | `-count <n>` exits after n commits; `-delay` sets the time between preedit and commit. | ||
| 66 | 66 | ||||
| 67 | - | ## Testing the virtual pointer | |||
| 68 | - | ||||
| 69 | - | `neferwl pointer` drives the pointer of the headless session (same display resolution as `neferwl state`); run it with the headless `WAYLAND_DISPLAY`: | |||
| 70 | - | ||||
| 71 | - | ```sh | |||
| 72 | - | WAYLAND_DISPLAY=<name> neferwl pointer abs 0.1 0.5 click | |||
| 73 | - | WAYLAND_DISPLAY=<name> neferwl pointer drag 100 0 scroll down 3 | |||
| 74 | - | WAYLAND_DISPLAY=<name> neferwl pointer --output HEADLESS-2 abs 0.5 0.5 | |||
| 75 | - | ``` | |||
| 76 | - | ||||
| 77 | - | Check the result with `neferwl state` (`.window.id` is the focused window). Headless screenshots do not show the cursor. `TestPointerCLI` (`internal/app`, in `go test ./...`) runs the built binary against a headless NeferWL and checks a click, a drag, a scroll and the release at exit on a test client. | |||
| 78 | - | ||||
| 79 | - | ## wayvnc check | |||
| 80 | - | ||||
| 81 | - | `make e2e-wayvnc` runs `TestWayVNC` (build tag `wayvnc`; skips without `wayvnc` on `PATH`). A headless NeferWL with a 320x240 output allowlists wayvnc in a throwaway capture-allow file and maps a client that shows a red square; then `wayvnc -o HEADLESS-1` runs on a free localhost port. A minimal RFB client in the test checks that the framebuffer has the output's size and shows the square, that a pointer event over the square enters the client and a click reaches it, and that a key event types `a` (KEY_A) into the focused client. | |||
| 82 | - | ||||
| 83 | ## X11 check | 67 | ## X11 check | ||
| 84 | 68 | ||||
| 85 | `make e2e-xwayland` runs the end-to-end test of the built-in window manager (`xwayland = builtin`). It is behind the `xwayland` build tag, so `go test ./...` and `make check` only compile it (`go vet -tags xwayland`). It needs `Xwayland` on `PATH` and a GPU, and skips without Xwayland. The clipboard test also needs `wl-copy` and `wl-paste` (wl-clipboard) and skips without them; they run with the headless `WAYLAND_DISPLAY` and need no extra focus step, since the focused probe window is enough for `wl-copy --foreground` to set the selection. | 69 | `make e2e-xwayland` runs the end-to-end test of the built-in window manager (`xwayland = builtin`). It is behind the `xwayland` build tag, so `go test ./...` and `make check` only compile it (`go vet -tags xwayland`). It needs `Xwayland` on `PATH` and a GPU, and skips without Xwayland. The clipboard test also needs `wl-copy` and `wl-paste` (wl-clipboard) and skips without them; they run with the headless `WAYLAND_DISPLAY` and need no extra focus step, since the focused probe window is enough for `wl-copy --foreground` to set the selection. | ||
M docs/index.md +0 -1
| @@ -6,6 +6,5 @@ NeferWL is a small Wayland compositor in Go. Start with Configuration to set up | |||
| 6 | 6 | - [Desktop integration](desktop.md): sessions, clipboard, input methods, X11 apps, session locking and scripting. | |
| 7 | 7 | - [Screen capture](capture.md): protocols, indicator, executable allowlist and portals. | |
| 8 | 8 | - [Performance](performance.md): resource use, VRR and real-time priority. | |
| 9 | - | - [Game server](server.md): `--backend=server` on a headless machine, streaming with Sunshine. | |
| 10 | 9 | ||
| 11 | 10 | Developer documentation: [docs/dev](dev/index.md) | |
| @@ -6,6 +6,5 @@ NeferWL is a small Wayland compositor in Go. Start with Configuration to set up | |||||
| 6 | - [Desktop integration](desktop.md): sessions, clipboard, input methods, X11 apps, session locking and scripting. | 6 | - [Desktop integration](desktop.md): sessions, clipboard, input methods, X11 apps, session locking and scripting. | ||
| 7 | - [Screen capture](capture.md): protocols, indicator, executable allowlist and portals. | 7 | - [Screen capture](capture.md): protocols, indicator, executable allowlist and portals. | ||
| 8 | - [Performance](performance.md): resource use, VRR and real-time priority. | 8 | - [Performance](performance.md): resource use, VRR and real-time priority. | ||
| 9 | - | - [Game server](server.md): `--backend=server` on a headless machine, streaming with Sunshine. | |||
| 10 | 9 | ||||
| 11 | Developer documentation: [docs/dev](dev/index.md) | 10 | Developer documentation: [docs/dev](dev/index.md) | ||
D docs/server.md +0 -138
| @@ -1,138 +0,0 @@ | |||
| 1 | - | # Game server | |
| 2 | - | ||
| 3 | - | `neferwl --backend=server` runs NeferWL without a display: it drives only the virtual outputs declared in the config, reads input devices directly and serves screen casting on the session bus. With [Sunshine](https://github.com/LizardByte/Sunshine), it turns a headless machine into a game streaming host. | |
| 4 | - | ||
| 5 | - | Server mode differs from a desktop session: | |
| 6 | - | ||
| 7 | - | - No DRM/KMS and no logind session: no physical output lights up, and no VT is taken. | |
| 8 | - | - Virtual outputs are laid out left to right in config order, starting at 0,0. They take the startup focus and every pointer reaches them, so they are not isolated as on a desktop. | |
| 9 | - | - The screen-casting and screensaver D-Bus services always run. The logind power-key lock does not. | |
| 10 | - | - No terminal opens at startup. Scale changes are saved to the config, as on a desktop. | |
| 11 | - | - The test flags (`--screenshot`, `--screenshot-raw`, `--input`, `--size`, `--timeout`, `--headless-hdr`, `--dbus`) are rejected. | |
| 12 | - | ||
| 13 | - | ## Requirements | |
| 14 | - | ||
| 15 | - | - A GPU with a DRM render node (`/dev/dri/renderD*`). Software rasterizers such as lavapipe are refused. | |
| 16 | - | - PipeWire, `xdg-desktop-portal` and `xdg-desktop-portal-gnome`, with the packaged `neferwl-portals.conf` (see [Portals](capture.md#portals)). | |
| 17 | - | - Sunshine with portal capture. | |
| 18 | - | ||
| 19 | - | ## Account setup | |
| 20 | - | ||
| 21 | - | The user service runs without anyone logged in: | |
| 22 | - | ||
| 23 | - | ```sh | |
| 24 | - | sudo loginctl enable-linger $USER | |
| 25 | - | ``` | |
| 26 | - | ||
| 27 | - | Without a logind seat, NeferWL opens `/dev/input/event*` itself, so the user must be in the `input` group. On distributions where `/dev/dri/renderD*` is not world-accessible, add `render` too: | |
| 28 | - | ||
| 29 | - | ```sh | |
| 30 | - | sudo usermod -aG input,render $USER | |
| 31 | - | ``` | |
| 32 | - | ||
| 33 | - | Log out and back in (or reboot) to apply. | |
| 34 | - | ||
| 35 | - | **Security.** Membership in `input` lets every program of that user read every keyboard of the machine: it is the same as a keylogger. NeferWL grabs each device exclusively (`EVIOCGRAB`), so a local keyboard types into the server session, not into a console or another session. A device it cannot grab (another program already holds it) is skipped and logged as `input device skipped`. Use a dedicated account, and never run server mode while a desktop NeferWL session is running on the same machine: `neferwl-server.service` conflicts with `neferwl.service` for that reason. | |
| 36 | - | ||
| 37 | - | ## Configuration | |
| 38 | - | ||
| 39 | - | `~/.config/neferwl/config`: | |
| 40 | - | ||
| 41 | - | ```ini | |
| 42 | - | output.tv = virtual 1920x1080@60 | |
| 43 | - | output.tv.hdr = on | |
| 44 | - | startup = steam -gamepadui | |
| 45 | - | # Only when several GPUs are present, see Configuration > GPUs: | |
| 46 | - | # render.device = /dev/dri/renderD128 | |
| 47 | - | ``` | |
| 48 | - | ||
| 49 | - | Check it with `neferwl validate-config`. See [Virtual outputs](config.md#virtual-outputs) and [GPUs](config.md#gpus). | |
| 50 | - | ||
| 51 | - | ## Services | |
| 52 | - | ||
| 53 | - | ```sh | |
| 54 | - | systemctl --user enable --now neferwl-server.service | |
| 55 | - | systemctl --user enable --now sunshine.service | |
| 56 | - | ``` | |
| 57 | - | ||
| 58 | - | `neferwl-server.service` starts `neferwl --backend=server --session`, notifies systemd when ready, exports `WAYLAND_DISPLAY` and `DISPLAY` to the user manager and restarts on failure. It binds `graphical-session.target`, so Sunshine and the portals start in the right environment. | |
| 59 | - | ||
| 60 | - | ## Sunshine | |
| 61 | - | ||
| 62 | - | `~/.config/sunshine/sunshine.conf`: | |
| 63 | - | ||
| 64 | - | ```ini | |
| 65 | - | capture = portal | |
| 66 | - | ``` | |
| 67 | - | ||
| 68 | - | To match the client's resolution and refresh rate, change the virtual output's mode before each stream (`global_prep_cmd`, a JSON list): | |
| 69 | - | ||
| 70 | - | ```ini | |
| 71 | - | global_prep_cmd = [{"do":"sh -c \"wlr-randr --output tv --custom-mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}\"","undo":"wlr-randr --output tv --custom-mode 1920x1080@60"}] | |
| 72 | - | ``` | |
| 73 | - | ||
| 74 | - | ## First portal approval | |
| 75 | - | ||
| 76 | - | The first time Sunshine captures, the portal shows its share dialog on `tv`, with nobody in front of the screen. Accept it once over SSH: | |
| 77 | - | ||
| 78 | - | ```sh | |
| 79 | - | export $(systemctl --user show-environment | grep -E '^(WAYLAND_DISPLAY|XDG_RUNTIME_DIR)=') | |
| 80 | - | grim -o tv /tmp/tv.png # look at the dialog | |
| 81 | - | ydotool key 28:1 28:0 # Return accepts the selected output | |
| 82 | - | ``` | |
| 83 | - | ||
| 84 | - | Move the selection with Tab (`15:1 15:0`) if needed, and take another screenshot to check. The portal gives Sunshine a restore token: later streams start without the dialog, as long as the output keeps its name. | |
| 85 | - | ||
| 86 | - | ## HDR | |
| 87 | - | ||
| 88 | - | With `output.tv.hdr = on`, the output is HDR (PQ/BT.2020, reported as a 1000-nit display) and the cast offers 10-bit PQ first. Enable HDR in the Moonlight client and in the game. If the renderer cannot do HDR, the output falls back to SDR and the log says why. See [HDR](config.md#hdr) and [Screen capture](capture.md#portals). | |
| 89 | - | ||
| 90 | - | ## Input | |
| 91 | - | ||
| 92 | - | Moonlight's keyboard, mouse and gamepads reach the host through Sunshine's virtual devices. Keyboard and mouse events go through NeferWL to the focused window. Gamepads go straight to games: NeferWL does not handle them. | |
| 93 | - | ||
| 94 | - | Steam's controller rules grant access through `uaccess`, which needs a logind seat. Server mode has none, so the `input` group is what gives Steam its gamepads. | |
| 95 | - | ||
| 96 | - | ## Controlling a NeferWL session (agents) | |
| 97 | - | ||
| 98 | - | An agent or script on the host can watch the session and drive it with standard Wayland tools. Run them as the session user with the session's display: | |
| 99 | - | ||
| 100 | - | ```sh | |
| 101 | - | export $(systemctl --user show-environment | grep -E '^(WAYLAND_DISPLAY|XDG_RUNTIME_DIR)=') | |
| 102 | - | grim -o tv /tmp/screen.png # capture one output (see Screen capture) | |
| 103 | - | neferwl pointer abs 0.5 0.5 click # click the middle of the layout | |
| 104 | - | neferwl pointer move 200 -50 click right # actions run in order | |
| 105 | - | wtype 'hello' # type into the focused window | |
| 106 | - | neferwl state # windows, focus, outputs as JSON | |
| 107 | - | ``` | |
| 108 | - | ||
| 109 | - | - `neferwl pointer` actions: `abs X Y` (fractions 0..1 of the layout, or of one output with `--output <name>`), `move DX DY`, `press`/`release`/`click [BTN]`, `hold [BTN] [DURATION]`, `drag DX DY [BTN]` and `scroll up|down|left|right [N]`. BTN is `left` (default), `right`, `middle`, `side`, `extra`, `forward`, `back`, a `BTN_*` name or an evdev code. `--click-duration` (20ms), `--hold-duration` (500ms), `--drag-steps` (10) and `--drag-step-delay` (10ms) tune the timing. Buttons still pressed at exit are released. See `neferwl pointer --help`. | |
| 110 | - | - [wlrctl](https://git.sr.ht/~brocellous/wlrctl) (AUR: `wlrctl`) works too: `wlrctl pointer move 200 -50`, `wlrctl pointer click left`. | |
| 111 | - | - Both use `zwlr_virtual_pointer_v1`. NeferWL routes their events like a real mouse, so focus, hover and drags behave as they would for a person. Absolute motion maps into the whole layout, or into one output when the tool binds it (`create_virtual_pointer_with_output`). | |
| 112 | - | - `ydotool` writes to `/dev/uinput` through `ydotoold` and does not use this protocol; prefer `neferwl pointer`. | |
| 113 | - | - Nothing is injected while the session is locked. Buttons a tool still held when it disconnects are released. | |
| 114 | - | - Flatpak and other sandboxed clients (those on a `wp_security_context_v1` socket) do not see the virtual pointer global. | |
| 115 | - | - `grim` needs the capture allowlist to admit it; see [the allowlist](capture.md#the-allowlist). | |
| 116 | - | ||
| 117 | - | [wayvnc](https://github.com/any1/wayvnc) works for remote viewing and control: it captures an output with wlr-screencopy and injects input through the virtual pointer and keyboard. Add its executable (`/usr/bin/wayvnc`) to `/etc/neferwl/capture-allow`, then run it in the session: | |
| 118 | - | ||
| 119 | - | ```sh | |
| 120 | - | wayvnc -o tv 127.0.0.1 5900 | |
| 121 | - | ``` | |
| 122 | - | ||
| 123 | - | Keep it on localhost and reach it through an SSH tunnel, or configure wayvnc's own authentication and TLS. | |
| 124 | - | ||
| 125 | - | ## Hardening | |
| 126 | - | ||
| 127 | - | On a dedicated box, a local keyboard should not reboot or reach a console: | |
| 128 | - | ||
| 129 | - | ```sh | |
| 130 | - | sudo systemctl mask ctrl-alt-del.target | |
| 131 | - | echo kernel.sysrq=0 | sudo tee /etc/sysctl.d/90-sysrq.conf | |
| 132 | - | sudo systemctl disable --now getty@tty1.service | |
| 133 | - | ``` | |
| 134 | - | ||
| 135 | - | ## Limits | |
| 136 | - | ||
| 137 | - | - Touch screens and pens (tablets) are not supported. | |
| 138 | - | - Only virtual outputs exist: a connected monitor stays dark. | |
| @@ -1,138 +0,0 @@ | |||||
| 1 | - | # Game server | |||
| 2 | - | ||||
| 3 | - | `neferwl --backend=server` runs NeferWL without a display: it drives only the virtual outputs declared in the config, reads input devices directly and serves screen casting on the session bus. With [Sunshine](https://github.com/LizardByte/Sunshine), it turns a headless machine into a game streaming host. | |||
| 4 | - | ||||
| 5 | - | Server mode differs from a desktop session: | |||
| 6 | - | ||||
| 7 | - | - No DRM/KMS and no logind session: no physical output lights up, and no VT is taken. | |||
| 8 | - | - Virtual outputs are laid out left to right in config order, starting at 0,0. They take the startup focus and every pointer reaches them, so they are not isolated as on a desktop. | |||
| 9 | - | - The screen-casting and screensaver D-Bus services always run. The logind power-key lock does not. | |||
| 10 | - | - No terminal opens at startup. Scale changes are saved to the config, as on a desktop. | |||
| 11 | - | - The test flags (`--screenshot`, `--screenshot-raw`, `--input`, `--size`, `--timeout`, `--headless-hdr`, `--dbus`) are rejected. | |||
| 12 | - | ||||
| 13 | - | ## Requirements | |||
| 14 | - | ||||
| 15 | - | - A GPU with a DRM render node (`/dev/dri/renderD*`). Software rasterizers such as lavapipe are refused. | |||
| 16 | - | - PipeWire, `xdg-desktop-portal` and `xdg-desktop-portal-gnome`, with the packaged `neferwl-portals.conf` (see [Portals](capture.md#portals)). | |||
| 17 | - | - Sunshine with portal capture. | |||
| 18 | - | ||||
| 19 | - | ## Account setup | |||
| 20 | - | ||||
| 21 | - | The user service runs without anyone logged in: | |||
| 22 | - | ||||
| 23 | - | ```sh | |||
| 24 | - | sudo loginctl enable-linger $USER | |||
| 25 | - | ``` | |||
| 26 | - | ||||
| 27 | - | Without a logind seat, NeferWL opens `/dev/input/event*` itself, so the user must be in the `input` group. On distributions where `/dev/dri/renderD*` is not world-accessible, add `render` too: | |||
| 28 | - | ||||
| 29 | - | ```sh | |||
| 30 | - | sudo usermod -aG input,render $USER | |||
| 31 | - | ``` | |||
| 32 | - | ||||
| 33 | - | Log out and back in (or reboot) to apply. | |||
| 34 | - | ||||
| 35 | - | **Security.** Membership in `input` lets every program of that user read every keyboard of the machine: it is the same as a keylogger. NeferWL grabs each device exclusively (`EVIOCGRAB`), so a local keyboard types into the server session, not into a console or another session. A device it cannot grab (another program already holds it) is skipped and logged as `input device skipped`. Use a dedicated account, and never run server mode while a desktop NeferWL session is running on the same machine: `neferwl-server.service` conflicts with `neferwl.service` for that reason. | |||
| 36 | - | ||||
| 37 | - | ## Configuration | |||
| 38 | - | ||||
| 39 | - | `~/.config/neferwl/config`: | |||
| 40 | - | ||||
| 41 | - | ```ini | |||
| 42 | - | output.tv = virtual 1920x1080@60 | |||
| 43 | - | output.tv.hdr = on | |||
| 44 | - | startup = steam -gamepadui | |||
| 45 | - | # Only when several GPUs are present, see Configuration > GPUs: | |||
| 46 | - | # render.device = /dev/dri/renderD128 | |||
| 47 | - | ``` | |||
| 48 | - | ||||
| 49 | - | Check it with `neferwl validate-config`. See [Virtual outputs](config.md#virtual-outputs) and [GPUs](config.md#gpus). | |||
| 50 | - | ||||
| 51 | - | ## Services | |||
| 52 | - | ||||
| 53 | - | ```sh | |||
| 54 | - | systemctl --user enable --now neferwl-server.service | |||
| 55 | - | systemctl --user enable --now sunshine.service | |||
| 56 | - | ``` | |||
| 57 | - | ||||
| 58 | - | `neferwl-server.service` starts `neferwl --backend=server --session`, notifies systemd when ready, exports `WAYLAND_DISPLAY` and `DISPLAY` to the user manager and restarts on failure. It binds `graphical-session.target`, so Sunshine and the portals start in the right environment. | |||
| 59 | - | ||||
| 60 | - | ## Sunshine | |||
| 61 | - | ||||
| 62 | - | `~/.config/sunshine/sunshine.conf`: | |||
| 63 | - | ||||
| 64 | - | ```ini | |||
| 65 | - | capture = portal | |||
| 66 | - | ``` | |||
| 67 | - | ||||
| 68 | - | To match the client's resolution and refresh rate, change the virtual output's mode before each stream (`global_prep_cmd`, a JSON list): | |||
| 69 | - | ||||
| 70 | - | ```ini | |||
| 71 | - | global_prep_cmd = [{"do":"sh -c \"wlr-randr --output tv --custom-mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS}\"","undo":"wlr-randr --output tv --custom-mode 1920x1080@60"}] | |||
| 72 | - | ``` | |||
| 73 | - | ||||
| 74 | - | ## First portal approval | |||
| 75 | - | ||||
| 76 | - | The first time Sunshine captures, the portal shows its share dialog on `tv`, with nobody in front of the screen. Accept it once over SSH: | |||
| 77 | - | ||||
| 78 | - | ```sh | |||
| 79 | - | export $(systemctl --user show-environment | grep -E '^(WAYLAND_DISPLAY|XDG_RUNTIME_DIR)=') | |||
| 80 | - | grim -o tv /tmp/tv.png # look at the dialog | |||
| 81 | - | ydotool key 28:1 28:0 # Return accepts the selected output | |||
| 82 | - | ``` | |||
| 83 | - | ||||
| 84 | - | Move the selection with Tab (`15:1 15:0`) if needed, and take another screenshot to check. The portal gives Sunshine a restore token: later streams start without the dialog, as long as the output keeps its name. | |||
| 85 | - | ||||
| 86 | - | ## HDR | |||
| 87 | - | ||||
| 88 | - | With `output.tv.hdr = on`, the output is HDR (PQ/BT.2020, reported as a 1000-nit display) and the cast offers 10-bit PQ first. Enable HDR in the Moonlight client and in the game. If the renderer cannot do HDR, the output falls back to SDR and the log says why. See [HDR](config.md#hdr) and [Screen capture](capture.md#portals). | |||
| 89 | - | ||||
| 90 | - | ## Input | |||
| 91 | - | ||||
| 92 | - | Moonlight's keyboard, mouse and gamepads reach the host through Sunshine's virtual devices. Keyboard and mouse events go through NeferWL to the focused window. Gamepads go straight to games: NeferWL does not handle them. | |||
| 93 | - | ||||
| 94 | - | Steam's controller rules grant access through `uaccess`, which needs a logind seat. Server mode has none, so the `input` group is what gives Steam its gamepads. | |||
| 95 | - | ||||
| 96 | - | ## Controlling a NeferWL session (agents) | |||
| 97 | - | ||||
| 98 | - | An agent or script on the host can watch the session and drive it with standard Wayland tools. Run them as the session user with the session's display: | |||
| 99 | - | ||||
| 100 | - | ```sh | |||
| 101 | - | export $(systemctl --user show-environment | grep -E '^(WAYLAND_DISPLAY|XDG_RUNTIME_DIR)=') | |||
| 102 | - | grim -o tv /tmp/screen.png # capture one output (see Screen capture) | |||
| 103 | - | neferwl pointer abs 0.5 0.5 click # click the middle of the layout | |||
| 104 | - | neferwl pointer move 200 -50 click right # actions run in order | |||
| 105 | - | wtype 'hello' # type into the focused window | |||
| 106 | - | neferwl state # windows, focus, outputs as JSON | |||
| 107 | - | ``` | |||
| 108 | - | ||||
| 109 | - | - `neferwl pointer` actions: `abs X Y` (fractions 0..1 of the layout, or of one output with `--output <name>`), `move DX DY`, `press`/`release`/`click [BTN]`, `hold [BTN] [DURATION]`, `drag DX DY [BTN]` and `scroll up|down|left|right [N]`. BTN is `left` (default), `right`, `middle`, `side`, `extra`, `forward`, `back`, a `BTN_*` name or an evdev code. `--click-duration` (20ms), `--hold-duration` (500ms), `--drag-steps` (10) and `--drag-step-delay` (10ms) tune the timing. Buttons still pressed at exit are released. See `neferwl pointer --help`. | |||
| 110 | - | - [wlrctl](https://git.sr.ht/~brocellous/wlrctl) (AUR: `wlrctl`) works too: `wlrctl pointer move 200 -50`, `wlrctl pointer click left`. | |||
| 111 | - | - Both use `zwlr_virtual_pointer_v1`. NeferWL routes their events like a real mouse, so focus, hover and drags behave as they would for a person. Absolute motion maps into the whole layout, or into one output when the tool binds it (`create_virtual_pointer_with_output`). | |||
| 112 | - | - `ydotool` writes to `/dev/uinput` through `ydotoold` and does not use this protocol; prefer `neferwl pointer`. | |||
| 113 | - | - Nothing is injected while the session is locked. Buttons a tool still held when it disconnects are released. | |||
| 114 | - | - Flatpak and other sandboxed clients (those on a `wp_security_context_v1` socket) do not see the virtual pointer global. | |||
| 115 | - | - `grim` needs the capture allowlist to admit it; see [the allowlist](capture.md#the-allowlist). | |||
| 116 | - | ||||
| 117 | - | [wayvnc](https://github.com/any1/wayvnc) works for remote viewing and control: it captures an output with wlr-screencopy and injects input through the virtual pointer and keyboard. Add its executable (`/usr/bin/wayvnc`) to `/etc/neferwl/capture-allow`, then run it in the session: | |||
| 118 | - | ||||
| 119 | - | ```sh | |||
| 120 | - | wayvnc -o tv 127.0.0.1 5900 | |||
| 121 | - | ``` | |||
| 122 | - | ||||
| 123 | - | Keep it on localhost and reach it through an SSH tunnel, or configure wayvnc's own authentication and TLS. | |||
| 124 | - | ||||
| 125 | - | ## Hardening | |||
| 126 | - | ||||
| 127 | - | On a dedicated box, a local keyboard should not reboot or reach a console: | |||
| 128 | - | ||||
| 129 | - | ```sh | |||
| 130 | - | sudo systemctl mask ctrl-alt-del.target | |||
| 131 | - | echo kernel.sysrq=0 | sudo tee /etc/sysctl.d/90-sysrq.conf | |||
| 132 | - | sudo systemctl disable --now getty@tty1.service | |||
| 133 | - | ``` | |||
| 134 | - | ||||
| 135 | - | ## Limits | |||
| 136 | - | ||||
| 137 | - | - Touch screens and pens (tablets) are not supported. | |||
| 138 | - | - Only virtual outputs exist: a connected monitor stays dark. | |||
M go.mod +3 -3
| @@ -5,8 +5,8 @@ go 1.27 | |||
| 5 | 5 | require ( | |
| 6 | 6 | bnema.dev/kvconf v0.2.0 | |
| 7 | 7 | bnema.dev/purego v0.13.0-bnema.3 | |
| 8 | - | bnema.dev/purego-libwayland v0.14.0 | |
| 9 | - | bnema.dev/purego-pipewire v0.6.0 | |
| 8 | + | bnema.dev/purego-libwayland v0.13.0 | |
| 9 | + | bnema.dev/purego-pipewire v0.4.0 | |
| 10 | 10 | bnema.dev/purego-vulkan v0.7.0 | |
| 11 | 11 | bnema.dev/wlturbo v0.7.0 | |
| 12 | 12 | bnema.dev/xturbo v0.1.0 | |
| @@ -24,7 +24,7 @@ require ( | |||
| 24 | 24 | github.com/mattn/go-colorable v0.1.16 // indirect | |
| 25 | 25 | github.com/mattn/go-isatty v0.0.24 // indirect | |
| 26 | 26 | github.com/stretchr/objx v0.8.0 // indirect | |
| 27 | - | go.yaml.in/yaml/v3 v3.0.5 // indirect | |
| 27 | + | go.yaml.in/yaml/v3 v3.0.6 // indirect | |
| 28 | 28 | golang.org/x/text v0.43.0 // indirect | |
| 29 | 29 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | |
| 30 | 30 | ) | |
| @@ -5,8 +5,8 @@ go 1.27 | |||||
| 5 | require ( | 5 | require ( | ||
| 6 | bnema.dev/kvconf v0.2.0 | 6 | bnema.dev/kvconf v0.2.0 | ||
| 7 | bnema.dev/purego v0.13.0-bnema.3 | 7 | bnema.dev/purego v0.13.0-bnema.3 | ||
| 8 | - | bnema.dev/purego-libwayland v0.14.0 | 8 | + | bnema.dev/purego-libwayland v0.13.0 |
| 9 | - | bnema.dev/purego-pipewire v0.6.0 | 9 | + | bnema.dev/purego-pipewire v0.4.0 |
| 10 | bnema.dev/purego-vulkan v0.7.0 | 10 | bnema.dev/purego-vulkan v0.7.0 | ||
| 11 | bnema.dev/wlturbo v0.7.0 | 11 | bnema.dev/wlturbo v0.7.0 | ||
| 12 | bnema.dev/xturbo v0.1.0 | 12 | bnema.dev/xturbo v0.1.0 | ||
| @@ -24,7 +24,7 @@ require ( | |||||
| 24 | github.com/mattn/go-colorable v0.1.16 // indirect | 24 | github.com/mattn/go-colorable v0.1.16 // indirect | ||
| 25 | github.com/mattn/go-isatty v0.0.24 // indirect | 25 | github.com/mattn/go-isatty v0.0.24 // indirect | ||
| 26 | github.com/stretchr/objx v0.8.0 // indirect | 26 | github.com/stretchr/objx v0.8.0 // indirect | ||
| 27 | - | go.yaml.in/yaml/v3 v3.0.5 // indirect | 27 | + | go.yaml.in/yaml/v3 v3.0.6 // indirect |
| 28 | golang.org/x/text v0.43.0 // indirect | 28 | golang.org/x/text v0.43.0 // indirect | ||
| 29 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | 29 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | ||
| 30 | ) | 30 | ) | ||
M go.sum +6 -6 generated file: collapsed
M internal/adapters/config/config.go +19 -20
| @@ -456,17 +456,6 @@ func parseBytes(data []byte) (domain.Config, map[string]string, []Warning, error | |||
| 456 | 456 | entry().Primary = b | |
| 457 | 457 | continue | |
| 458 | 458 | } | |
| 459 | - | if base, ok := strings.CutSuffix(name, ".keep-focus"); ok { | |
| 460 | - | name = base | |
| 461 | - | b, err := onOff(value) | |
| 462 | - | if err != nil { | |
| 463 | - | warn("%s: %v", key, err) | |
| 464 | - | continue | |
| 465 | - | } | |
| 466 | - | override() | |
| 467 | - | entry().KeepFocus = b | |
| 468 | - | continue | |
| 469 | - | } | |
| 470 | 459 | if base, ok := strings.CutSuffix(name, ".hdr"); ok { | |
| 471 | 460 | name = base | |
| 472 | 461 | b, err := onOff(value) | |
| @@ -673,6 +662,25 @@ func parseBytes(data []byte) (domain.Config, map[string]string, []Warning, error | |||
| 673 | 662 | } | |
| 674 | 663 | override() | |
| 675 | 664 | } | |
| 665 | + | // Subkeys may precede the declaration: enforce SDR only after all lines. | |
| 666 | + | for i := range c.Outputs { | |
| 667 | + | o := &c.Outputs[i] | |
| 668 | + | if !o.Virtual { | |
| 669 | + | continue | |
| 670 | + | } | |
| 671 | + | for _, field := range []string{"hdr", "sdr-expand", "sdr-expand-intensity", "sdr-expand-peak", "sdr-decode"} { | |
| 672 | + | key := "output." + o.Name + "." + field | |
| 673 | + | if line, ok := seen[key]; ok { | |
| 674 | + | warnings = append(warnings, Warning{Line: line, Msg: key + ": ignored on virtual output (always SDR)"}) | |
| 675 | + | delete(raw, key) | |
| 676 | + | } | |
| 677 | + | } | |
| 678 | + | o.HDR = false | |
| 679 | + | o.SDRExpand = domain.SDRExpandAuto | |
| 680 | + | o.SDRExpandIntensity = domain.DefaultSDRExpandIntensity | |
| 681 | + | o.SDRExpandPeak = 0 | |
| 682 | + | o.SDRDecode = 0 | |
| 683 | + | } | |
| 676 | 684 | warnings = append(warnings, checkOutputAnchors(c.Outputs, relKeys, offsetLines, seen)...) | |
| 677 | 685 | warnings = append(warnings, checkWorkspaceBinds(c, seen)...) | |
| 678 | 686 | var ruleWarnings []Warning | |
| @@ -775,15 +783,6 @@ func expandCmd(combo, cmd string) (string, error) { | |||
| 775 | 783 | // set applies one scalar key. Unknown keys and invalid values are errors. | |
| 776 | 784 | func set(c *domain.Config, key, v string) error { | |
| 777 | 785 | switch key { | |
| 778 | - | case "lineage.shells": | |
| 779 | - | c.LineageShells = nil | |
| 780 | - | for _, name := range strings.Split(v, ",") { | |
| 781 | - | name = strings.TrimSpace(name) | |
| 782 | - | if name == "" || len(name) > 16 || strings.ContainsAny(name, "/\t\n") { | |
| 783 | - | return fmt.Errorf("must be comma-separated process names of 1 to 16 bytes") | |
| 784 | - | } | |
| 785 | - | c.LineageShells = append(c.LineageShells, name) | |
| 786 | - | } | |
| 787 | 786 | case "keyboard.layout": | |
| 788 | 787 | c.Keyboard.Layout = v | |
| 789 | 788 | case "keyboard.variant": | |
| @@ -456,17 +456,6 @@ func parseBytes(data []byte) (domain.Config, map[string]string, []Warning, error | |||||
| 456 | entry().Primary = b | 456 | entry().Primary = b | ||
| 457 | continue | 457 | continue | ||
| 458 | } | 458 | } | ||
| 459 | - | if base, ok := strings.CutSuffix(name, ".keep-focus"); ok { | |||
| 460 | - | name = base | |||
| 461 | - | b, err := onOff(value) | |||
| 462 | - | if err != nil { | |||
| 463 | - | warn("%s: %v", key, err) | |||
| 464 | - | continue | |||
| 465 | - | } | |||
| 466 | - | override() | |||
| 467 | - | entry().KeepFocus = b | |||
| 468 | - | continue | |||
| 469 | - | } | |||
| 470 | if base, ok := strings.CutSuffix(name, ".hdr"); ok { | 459 | if base, ok := strings.CutSuffix(name, ".hdr"); ok { | ||
| 471 | name = base | 460 | name = base | ||
| 472 | b, err := onOff(value) | 461 | b, err := onOff(value) | ||
| @@ -673,6 +662,25 @@ func parseBytes(data []byte) (domain.Config, map[string]string, []Warning, error | |||||
| 673 | } | 662 | } | ||
| 674 | override() | 663 | override() | ||
| 675 | } | 664 | } | ||
| 665 | + | // Subkeys may precede the declaration: enforce SDR only after all lines. | |||
| 666 | + | for i := range c.Outputs { | |||
| 667 | + | o := &c.Outputs[i] | |||
| 668 | + | if !o.Virtual { | |||
| 669 | + | continue | |||
| 670 | + | } | |||
| 671 | + | for _, field := range []string{"hdr", "sdr-expand", "sdr-expand-intensity", "sdr-expand-peak", "sdr-decode"} { | |||
| 672 | + | key := "output." + o.Name + "." + field | |||
| 673 | + | if line, ok := seen[key]; ok { | |||
| 674 | + | warnings = append(warnings, Warning{Line: line, Msg: key + ": ignored on virtual output (always SDR)"}) | |||
| 675 | + | delete(raw, key) | |||
| 676 | + | } | |||
| 677 | + | } | |||
| 678 | + | o.HDR = false | |||
| 679 | + | o.SDRExpand = domain.SDRExpandAuto | |||
| 680 | + | o.SDRExpandIntensity = domain.DefaultSDRExpandIntensity | |||
| 681 | + | o.SDRExpandPeak = 0 | |||
| 682 | + | o.SDRDecode = 0 | |||
| 683 | + | } | |||
| 676 | warnings = append(warnings, checkOutputAnchors(c.Outputs, relKeys, offsetLines, seen)...) | 684 | warnings = append(warnings, checkOutputAnchors(c.Outputs, relKeys, offsetLines, seen)...) | ||
| 677 | warnings = append(warnings, checkWorkspaceBinds(c, seen)...) | 685 | warnings = append(warnings, checkWorkspaceBinds(c, seen)...) | ||
| 678 | var ruleWarnings []Warning | 686 | var ruleWarnings []Warning | ||
| @@ -775,15 +783,6 @@ func expandCmd(combo, cmd string) (string, error) { | |||||
| 775 | // set applies one scalar key. Unknown keys and invalid values are errors. | 783 | // set applies one scalar key. Unknown keys and invalid values are errors. | ||
| 776 | func set(c *domain.Config, key, v string) error { | 784 | func set(c *domain.Config, key, v string) error { | ||
| 777 | switch key { | 785 | switch key { | ||
| 778 | - | case "lineage.shells": | |||
| 779 | - | c.LineageShells = nil | |||
| 780 | - | for _, name := range strings.Split(v, ",") { | |||
| 781 | - | name = strings.TrimSpace(name) | |||
| 782 | - | if name == "" || len(name) > 16 || strings.ContainsAny(name, "/\t\n") { | |||
| 783 | - | return fmt.Errorf("must be comma-separated process names of 1 to 16 bytes") | |||
| 784 | - | } | |||
| 785 | - | c.LineageShells = append(c.LineageShells, name) | |||
| 786 | - | } | |||
| 787 | case "keyboard.layout": | 786 | case "keyboard.layout": | ||
| 788 | c.Keyboard.Layout = v | 787 | c.Keyboard.Layout = v | ||
| 789 | case "keyboard.variant": | 788 | case "keyboard.variant": | ||
M internal/adapters/config/config_test.go +1 -15
| @@ -295,7 +295,6 @@ output.HDMI-A-1 = off | |||
| 295 | 295 | output.DP-1 = preferred | |
| 296 | 296 | output.DP-1.scale = 1.5 | |
| 297 | 297 | output.DP-1.primary = on | |
| 298 | - | output.DP-2.keep-focus = on | |
| 299 | 298 | bind.cmd+code:30 = quit | |
| 300 | 299 | render.direct-scanout = off | |
| 301 | 300 | render.tearing = off | |
| @@ -316,7 +315,7 @@ startup = wl-paste --primary --watch cliphist store; waybar ;mako; | |||
| 316 | 315 | t.Fatalf("%+v", c) | |
| 317 | 316 | } | |
| 318 | 317 | // Scale and mode lines combine in either order. | |
| 319 | - | if len(c.Outputs) != 3 || c.Outputs[0].Mode != "5120x2160@165.058" || c.Outputs[0].Scale != 4.0/3 || !c.Outputs[1].Off || c.Outputs[2].Mode != "" || c.Outputs[2].Off || c.Outputs[2].Scale != 1.5 || !c.Outputs[2].Primary || c.Outputs[0].Primary || !c.Outputs[0].KeepFocus || c.Outputs[2].KeepFocus { | |
| 318 | + | if len(c.Outputs) != 3 || c.Outputs[0].Mode != "5120x2160@165.058" || c.Outputs[0].Scale != 4.0/3 || !c.Outputs[1].Off || c.Outputs[2].Mode != "" || c.Outputs[2].Off || c.Outputs[2].Scale != 1.5 || !c.Outputs[2].Primary || c.Outputs[0].Primary { | |
| 320 | 319 | t.Fatalf("%+v", c.Outputs) | |
| 321 | 320 | } | |
| 322 | 321 | if c.Binds["Cmd+code:30"] != "quit" { | |
| @@ -341,7 +340,6 @@ func TestWarningsKeepDefaults(t *testing.T) { | |||
| 341 | 340 | {"output.DP-2 = 1920x1080@0", "output.DP-2"}, | |
| 342 | 341 | {"output.DP-2.scale = 0.5", "between 1 and 4"}, | |
| 343 | 342 | {"output.DP-2.primary = yes", "output.DP-2.primary"}, | |
| 344 | - | {"output.tv.keep-focus = yes", "output.tv.keep-focus"}, | |
| 345 | 343 | {"output.DP-2.scale = 3/0", "between 1 and 4"}, | |
| 346 | 344 | {"bind.cmd+code:x = quit", "evdev key code"}, | |
| 347 | 345 | {"nope = 1", "nope"}, | |
| @@ -1265,15 +1263,3 @@ func TestHintSources(t *testing.T) { | |||
| 1265 | 1263 | } | |
| 1266 | 1264 | } | |
| 1267 | 1265 | } | |
| 1268 | - | ||
| 1269 | - | func TestLineageShells(t *testing.T) { | |
| 1270 | - | c, warnings, err := Parse(strings.NewReader("lineage.shells = wrapper, custom\n")) | |
| 1271 | - | if err != nil || len(warnings) != 0 || len(c.LineageShells) != 2 || c.LineageShells[0] != "wrapper" { | |
| 1272 | - | t.Fatalf("shells: %+v %v %v", c.LineageShells, warnings, err) | |
| 1273 | - | } | |
| 1274 | - | other := c | |
| 1275 | - | other.LineageShells = []string{"different"} | |
| 1276 | - | if c.Equal(other) { | |
| 1277 | - | t.Fatal("shell reload compares equal") | |
| 1278 | - | } | |
| 1279 | - | } | |
| @@ -295,7 +295,6 @@ output.HDMI-A-1 = off | |||||
| 295 | output.DP-1 = preferred | 295 | output.DP-1 = preferred | ||
| 296 | output.DP-1.scale = 1.5 | 296 | output.DP-1.scale = 1.5 | ||
| 297 | output.DP-1.primary = on | 297 | output.DP-1.primary = on | ||
| 298 | - | output.DP-2.keep-focus = on | |||
| 299 | bind.cmd+code:30 = quit | 298 | bind.cmd+code:30 = quit | ||
| 300 | render.direct-scanout = off | 299 | render.direct-scanout = off | ||
| 301 | render.tearing = off | 300 | render.tearing = off | ||
| @@ -316,7 +315,7 @@ startup = wl-paste --primary --watch cliphist store; waybar ;mako; | |||||
| 316 | t.Fatalf("%+v", c) | 315 | t.Fatalf("%+v", c) | ||
| 317 | } | 316 | } | ||
| 318 | // Scale and mode lines combine in either order. | 317 | // Scale and mode lines combine in either order. | ||
| 319 | - | if len(c.Outputs) != 3 || c.Outputs[0].Mode != "5120x2160@165.058" || c.Outputs[0].Scale != 4.0/3 || !c.Outputs[1].Off || c.Outputs[2].Mode != "" || c.Outputs[2].Off || c.Outputs[2].Scale != 1.5 || !c.Outputs[2].Primary || c.Outputs[0].Primary || !c.Outputs[0].KeepFocus || c.Outputs[2].KeepFocus { | 318 | + | if len(c.Outputs) != 3 || c.Outputs[0].Mode != "5120x2160@165.058" || c.Outputs[0].Scale != 4.0/3 || !c.Outputs[1].Off || c.Outputs[2].Mode != "" || c.Outputs[2].Off || c.Outputs[2].Scale != 1.5 || !c.Outputs[2].Primary || c.Outputs[0].Primary { |
| 320 | t.Fatalf("%+v", c.Outputs) | 319 | t.Fatalf("%+v", c.Outputs) | ||
| 321 | } | 320 | } | ||
| 322 | if c.Binds["Cmd+code:30"] != "quit" { | 321 | if c.Binds["Cmd+code:30"] != "quit" { | ||
| @@ -341,7 +340,6 @@ func TestWarningsKeepDefaults(t *testing.T) { | |||||
| 341 | {"output.DP-2 = 1920x1080@0", "output.DP-2"}, | 340 | {"output.DP-2 = 1920x1080@0", "output.DP-2"}, | ||
| 342 | {"output.DP-2.scale = 0.5", "between 1 and 4"}, | 341 | {"output.DP-2.scale = 0.5", "between 1 and 4"}, | ||
| 343 | {"output.DP-2.primary = yes", "output.DP-2.primary"}, | 342 | {"output.DP-2.primary = yes", "output.DP-2.primary"}, | ||
| 344 | - | {"output.tv.keep-focus = yes", "output.tv.keep-focus"}, | |||
| 345 | {"output.DP-2.scale = 3/0", "between 1 and 4"}, | 343 | {"output.DP-2.scale = 3/0", "between 1 and 4"}, | ||
| 346 | {"bind.cmd+code:x = quit", "evdev key code"}, | 344 | {"bind.cmd+code:x = quit", "evdev key code"}, | ||
| 347 | {"nope = 1", "nope"}, | 345 | {"nope = 1", "nope"}, | ||
| @@ -1265,15 +1263,3 @@ func TestHintSources(t *testing.T) { | |||||
| 1265 | } | 1263 | } | ||
| 1266 | } | 1264 | } | ||
| 1267 | } | 1265 | } | ||
| 1268 | - | ||||
| 1269 | - | func TestLineageShells(t *testing.T) { | |||
| 1270 | - | c, warnings, err := Parse(strings.NewReader("lineage.shells = wrapper, custom\n")) | |||
| 1271 | - | if err != nil || len(warnings) != 0 || len(c.LineageShells) != 2 || c.LineageShells[0] != "wrapper" { | |||
| 1272 | - | t.Fatalf("shells: %+v %v %v", c.LineageShells, warnings, err) | |||
| 1273 | - | } | |||
| 1274 | - | other := c | |||
| 1275 | - | other.LineageShells = []string{"different"} | |||
| 1276 | - | if c.Equal(other) { | |||
| 1277 | - | t.Fatal("shell reload compares equal") | |||
| 1278 | - | } | |||
| 1279 | - | } | |||
M internal/adapters/config/virtual_test.go +27 -23
| @@ -60,32 +60,36 @@ func TestVirtualOutputModes(t *testing.T) { | |||
| 60 | 60 | } | |
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | - | func TestVirtualOutputHDRKeys(t *testing.T) { | |
| 64 | - | for _, before := range []bool{true, false} { | |
| 65 | - | t.Run(map[bool]string{true: "before", false: "after"}[before], func(t *testing.T) { | |
| 66 | - | declaration := "output.tv = virtual 1920x1080\n" | |
| 67 | - | subkeys := "output.tv.hdr = on\noutput.tv.sdr-brightness = 300\noutput.tv.sdr-expand = always\noutput.tv.sdr-expand-intensity = 0.9\noutput.tv.sdr-expand-peak = 800\noutput.tv.sdr-decode = srgb\n" | |
| 68 | - | input := declaration + subkeys | |
| 63 | + | func TestVirtualOutputSDRWarnings(t *testing.T) { | |
| 64 | + | for _, field := range []struct{ key, value string }{ | |
| 65 | + | {"hdr", "on"}, {"sdr-expand", "always"}, {"sdr-expand-intensity", "0.9"}, | |
| 66 | + | {"sdr-expand-peak", "800"}, {"sdr-decode", "srgb"}, | |
| 67 | + | } { | |
| 68 | + | for _, before := range []bool{true, false} { | |
| 69 | + | order := "after" | |
| 69 | 70 | if before { | |
| 70 | - | input = subkeys + declaration | |
| 71 | - | } | |
| 72 | - | c, raw, warnings, err := parseBytes([]byte(input)) | |
| 73 | - | if err != nil || len(warnings) != 0 { | |
| 74 | - | t.Fatalf("err=%v warnings=%v", err, warnings) | |
| 75 | - | } | |
| 76 | - | o := c.Outputs[0] | |
| 77 | - | if !o.Virtual || !o.HDR || o.SDRBrightness != 300 || o.SDRExpand != domain.SDRExpandAlways || o.SDRExpandIntensity != 0.9 || o.SDRExpandPeak != 800 || o.SDRDecode != domain.SDRDecodeSRGB { | |
| 78 | - | t.Fatalf("output=%+v", o) | |
| 79 | - | } | |
| 80 | - | if got := o.HDRSettings(); got != (domain.OutputHDRSettings{Enabled: true, SDRBrightness: 300, ExpansionPeakNits: 800}) { | |
| 81 | - | t.Fatalf("settings=%+v", got) | |
| 71 | + | order = "before" | |
| 82 | 72 | } | |
| 83 | - | for _, key := range []string{"hdr", "sdr-brightness", "sdr-expand", "sdr-expand-intensity", "sdr-expand-peak", "sdr-decode"} { | |
| 84 | - | if _, ok := raw["output.tv."+key]; !ok { | |
| 85 | - | t.Fatalf("%s dropped from effective config", key) | |
| 73 | + | t.Run(field.key+"/"+order, func(t *testing.T) { | |
| 74 | + | declaration := "output.tv = virtual 1920x1080\n" | |
| 75 | + | subkey := "output.tv." + field.key + " = " + field.value + "\n" | |
| 76 | + | input, line := declaration+subkey, 2 | |
| 77 | + | if before { | |
| 78 | + | input, line = subkey+declaration, 1 | |
| 86 | 79 | } | |
| 87 | - | } | |
| 88 | - | }) | |
| 80 | + | c, raw, warnings, err := parseBytes([]byte(input)) | |
| 81 | + | if err != nil || len(warnings) != 1 || warnings[0].Line != line || !strings.Contains(warnings[0].Msg, "ignored on virtual output") { | |
| 82 | + | t.Fatalf("err=%v warnings=%v", err, warnings) | |
| 83 | + | } | |
| 84 | + | o := c.Outputs[0] | |
| 85 | + | if !o.Virtual || o.HDR || o.SDRExpand != domain.SDRExpandAuto || o.SDRExpandIntensity != domain.DefaultSDRExpandIntensity || o.SDRExpandPeak != 0 || o.SDRDecode != domain.SDRDecodeGamma22 { | |
| 86 | + | t.Fatalf("output=%+v", o) | |
| 87 | + | } | |
| 88 | + | if _, ok := raw["output.tv."+field.key]; ok { | |
| 89 | + | t.Fatal("ignored key retained in effective config") | |
| 90 | + | } | |
| 91 | + | }) | |
| 92 | + | } | |
| 89 | 93 | } | |
| 90 | 94 | } | |
| 91 | 95 | ||
| @@ -60,32 +60,36 @@ func TestVirtualOutputModes(t *testing.T) { | |||||
| 60 | } | 60 | } | ||
| 61 | } | 61 | } | ||
| 62 | 62 | ||||
| 63 | - | func TestVirtualOutputHDRKeys(t *testing.T) { | 63 | + | func TestVirtualOutputSDRWarnings(t *testing.T) { |
| 64 | - | for _, before := range []bool{true, false} { | 64 | + | for _, field := range []struct{ key, value string }{ |
| 65 | - | t.Run(map[bool]string{true: "before", false: "after"}[before], func(t *testing.T) { | 65 | + | {"hdr", "on"}, {"sdr-expand", "always"}, {"sdr-expand-intensity", "0.9"}, |
| 66 | - | declaration := "output.tv = virtual 1920x1080\n" | 66 | + | {"sdr-expand-peak", "800"}, {"sdr-decode", "srgb"}, |
| 67 | - | subkeys := "output.tv.hdr = on\noutput.tv.sdr-brightness = 300\noutput.tv.sdr-expand = always\noutput.tv.sdr-expand-intensity = 0.9\noutput.tv.sdr-expand-peak = 800\noutput.tv.sdr-decode = srgb\n" | 67 | + | } { |
| 68 | - | input := declaration + subkeys | 68 | + | for _, before := range []bool{true, false} { |
| 69 | + | order := "after" | |||
| 69 | if before { | 70 | if before { | ||
| 70 | - | input = subkeys + declaration | 71 | + | order = "before" |
| 71 | - | } | |||
| 72 | - | c, raw, warnings, err := parseBytes([]byte(input)) | |||
| 73 | - | if err != nil || len(warnings) != 0 { | |||
| 74 | - | t.Fatalf("err=%v warnings=%v", err, warnings) | |||
| 75 | - | } | |||
| 76 | - | o := c.Outputs[0] | |||
| 77 | - | if !o.Virtual || !o.HDR || o.SDRBrightness != 300 || o.SDRExpand != domain.SDRExpandAlways || o.SDRExpandIntensity != 0.9 || o.SDRExpandPeak != 800 || o.SDRDecode != domain.SDRDecodeSRGB { | |||
| 78 | - | t.Fatalf("output=%+v", o) | |||
| 79 | - | } | |||
| 80 | - | if got := o.HDRSettings(); got != (domain.OutputHDRSettings{Enabled: true, SDRBrightness: 300, ExpansionPeakNits: 800}) { | |||
| 81 | - | t.Fatalf("settings=%+v", got) | |||
| 82 | } | 72 | } | ||
| 83 | - | for _, key := range []string{"hdr", "sdr-brightness", "sdr-expand", "sdr-expand-intensity", "sdr-expand-peak", "sdr-decode"} { | 73 | + | t.Run(field.key+"/"+order, func(t *testing.T) { |
| 84 | - | if _, ok := raw["output.tv."+key]; !ok { | 74 | + | declaration := "output.tv = virtual 1920x1080\n" |
| 85 | - | t.Fatalf("%s dropped from effective config", key) | 75 | + | subkey := "output.tv." + field.key + " = " + field.value + "\n" |
| 76 | + | input, line := declaration+subkey, 2 | |||
| 77 | + | if before { | |||
| 78 | + | input, line = subkey+declaration, 1 | |||
| 86 | } | 79 | } | ||
| 87 | - | } | 80 | + | c, raw, warnings, err := parseBytes([]byte(input)) |
| 88 | - | }) | 81 | + | if err != nil || len(warnings) != 1 || warnings[0].Line != line || !strings.Contains(warnings[0].Msg, "ignored on virtual output") { |
| 82 | + | t.Fatalf("err=%v warnings=%v", err, warnings) | |||
| 83 | + | } | |||
| 84 | + | o := c.Outputs[0] | |||
| 85 | + | if !o.Virtual || o.HDR || o.SDRExpand != domain.SDRExpandAuto || o.SDRExpandIntensity != domain.DefaultSDRExpandIntensity || o.SDRExpandPeak != 0 || o.SDRDecode != domain.SDRDecodeGamma22 { | |||
| 86 | + | t.Fatalf("output=%+v", o) | |||
| 87 | + | } | |||
| 88 | + | if _, ok := raw["output.tv."+field.key]; ok { | |||
| 89 | + | t.Fatal("ignored key retained in effective config") | |||
| 90 | + | } | |||
| 91 | + | }) | |||
| 92 | + | } | |||
| 89 | } | 93 | } | ||
| 90 | } | 94 | } | ||
| 91 | 95 | ||||
D internal/adapters/directseat/directseat.go +0 -101
| @@ -1,101 +0,0 @@ | |||
| 1 | - | // Package directseat opens input devices directly, without logind or | |
| 2 | - | // seatd. It serves server mode under systemd linger, where no session | |
| 3 | - | // broker exists. Each device is grabbed exclusively (EVIOCGRAB) so | |
| 4 | - | // keystrokes injected through uinput do not reach the kernel console. | |
| 5 | - | package directseat | |
| 6 | - | ||
| 7 | - | import ( | |
| 8 | - | "errors" | |
| 9 | - | "fmt" | |
| 10 | - | ||
| 11 | - | "bnema.dev/zerowrap" | |
| 12 | - | "golang.org/x/sys/unix" | |
| 13 | - | ||
| 14 | - | "github.com/bnema/neferwl/internal/ports" | |
| 15 | - | ) | |
| 16 | - | ||
| 17 | - | // name is the seat every directly opened device belongs to. | |
| 18 | - | const name = "seat0" | |
| 19 | - | ||
| 20 | - | // eviocgrab is EVIOCGRAB, _IOW('E', 0x90, int); x/sys/unix does not export it. | |
| 21 | - | const eviocgrab = 0x40044590 | |
| 22 | - | ||
| 23 | - | // evdev is the kernel boundary for input device fds. | |
| 24 | - | type evdev interface { | |
| 25 | - | open(path string) (int, error) | |
| 26 | - | grab(fd int) error | |
| 27 | - | ungrab(fd int) error | |
| 28 | - | close(fd int) error | |
| 29 | - | } | |
| 30 | - | ||
| 31 | - | type unixEvdev struct{} | |
| 32 | - | ||
| 33 | - | func (unixEvdev) open(path string) (int, error) { | |
| 34 | - | return unix.Open(path, unix.O_RDWR|unix.O_NONBLOCK|unix.O_CLOEXEC, 0) | |
| 35 | - | } | |
| 36 | - | ||
| 37 | - | func (unixEvdev) grab(fd int) error { return unix.IoctlSetInt(fd, eviocgrab, 1) } | |
| 38 | - | func (unixEvdev) ungrab(fd int) error { return unix.IoctlSetInt(fd, eviocgrab, 0) } | |
| 39 | - | func (unixEvdev) close(fd int) error { return unix.Close(fd) } | |
| 40 | - | ||
| 41 | - | // Seat implements ports.Seat by opening devices itself. It is always | |
| 42 | - | // active: there is no VT to switch away from. | |
| 43 | - | type Seat struct { | |
| 44 | - | log zerowrap.Logger | |
| 45 | - | dev evdev | |
| 46 | - | active chan bool | |
| 47 | - | } | |
| 48 | - | ||
| 49 | - | var _ ports.Seat = (*Seat)(nil) | |
| 50 | - | ||
| 51 | - | // New returns a direct seat. log should carry the seat component. | |
| 52 | - | func New(log zerowrap.Logger) *Seat { return newSeat(log, unixEvdev{}) } | |
| 53 | - | ||
| 54 | - | func newSeat(log zerowrap.Logger, dev evdev) *Seat { | |
| 55 | - | active := make(chan bool, 1) | |
| 56 | - | active <- true | |
| 57 | - | return &Seat{log: log, dev: dev, active: active} | |
| 58 | - | } | |
| 59 | - | ||
| 60 | - | // OpenDevice opens path read-write and grabs it exclusively. It fails | |
| 61 | - | // closed: a device it cannot grab is closed and refused, so its input never | |
| 62 | - | // reaches another client (a console or another session) as well. | |
| 63 | - | func (s *Seat) OpenDevice(path string) (int, error) { | |
| 64 | - | fd, err := s.dev.open(path) | |
| 65 | - | if err != nil { | |
| 66 | - | return -1, fmt.Errorf("open input device %s: %w", path, err) | |
| 67 | - | } | |
| 68 | - | if err := s.dev.grab(fd); err != nil { | |
| 69 | - | if cerr := s.dev.close(fd); cerr != nil { | |
| 70 | - | s.log.Warn().Err(cerr).Int("fd", fd).Msg("close input device") | |
| 71 | - | } | |
| 72 | - | if errors.Is(err, unix.EBUSY) { | |
| 73 | - | err = fmt.Errorf("another client holds an exclusive grab: %w", err) | |
| 74 | - | } | |
| 75 | - | err = fmt.Errorf("grab input device %s: %w", path, err) | |
| 76 | - | s.log.Warn().Err(err).Str("path", path).Msg("input device skipped") | |
| 77 | - | return -1, err | |
| 78 | - | } | |
| 79 | - | return fd, nil | |
| 80 | - | } | |
| 81 | - | ||
| 82 | - | // CloseDevice releases the grab and closes fd. | |
| 83 | - | func (s *Seat) CloseDevice(fd int) { | |
| 84 | - | if err := s.dev.ungrab(fd); err != nil { | |
| 85 | - | s.log.Debug().Err(err).Int("fd", fd).Msg("release grab") | |
| 86 | - | } | |
| 87 | - | if err := s.dev.close(fd); err != nil { | |
| 88 | - | s.log.Warn().Err(err).Int("fd", fd).Msg("close input device") | |
| 89 | - | } | |
| 90 | - | } | |
| 91 | - | ||
| 92 | - | // SwitchVT is a no-op: a direct seat owns no VT. | |
| 93 | - | func (s *Seat) SwitchVT(vt int) { | |
| 94 | - | s.log.Debug().Int("vt", vt).Msg("vt switch ignored without a session broker") | |
| 95 | - | } | |
| 96 | - | ||
| 97 | - | // Name returns the seat name. | |
| 98 | - | func (s *Seat) Name() string { return name } | |
| 99 | - | ||
| 100 | - | // Active yields true once: the seat never goes inactive. | |
| 101 | - | func (s *Seat) Active() <-chan bool { return s.active } | |
| @@ -1,101 +0,0 @@ | |||||
| 1 | - | // Package directseat opens input devices directly, without logind or | |||
| 2 | - | // seatd. It serves server mode under systemd linger, where no session | |||
| 3 | - | // broker exists. Each device is grabbed exclusively (EVIOCGRAB) so | |||
| 4 | - | // keystrokes injected through uinput do not reach the kernel console. | |||
| 5 | - | package directseat | |||
| 6 | - | ||||
| 7 | - | import ( | |||
| 8 | - | "errors" | |||
| 9 | - | "fmt" | |||
| 10 | - | ||||
| 11 | - | "bnema.dev/zerowrap" | |||
| 12 | - | "golang.org/x/sys/unix" | |||
| 13 | - | ||||
| 14 | - | "github.com/bnema/neferwl/internal/ports" | |||
| 15 | - | ) | |||
| 16 | - | ||||
| 17 | - | // name is the seat every directly opened device belongs to. | |||
| 18 | - | const name = "seat0" | |||
| 19 | - | ||||
| 20 | - | // eviocgrab is EVIOCGRAB, _IOW('E', 0x90, int); x/sys/unix does not export it. | |||
| 21 | - | const eviocgrab = 0x40044590 | |||
| 22 | - | ||||
| 23 | - | // evdev is the kernel boundary for input device fds. | |||
| 24 | - | type evdev interface { | |||
| 25 | - | open(path string) (int, error) | |||
| 26 | - | grab(fd int) error | |||
| 27 | - | ungrab(fd int) error | |||
| 28 | - | close(fd int) error | |||
| 29 | - | } | |||
| 30 | - | ||||
| 31 | - | type unixEvdev struct{} | |||
| 32 | - | ||||
| 33 | - | func (unixEvdev) open(path string) (int, error) { | |||
| 34 | - | return unix.Open(path, unix.O_RDWR|unix.O_NONBLOCK|unix.O_CLOEXEC, 0) | |||
| 35 | - | } | |||
| 36 | - | ||||
| 37 | - | func (unixEvdev) grab(fd int) error { return unix.IoctlSetInt(fd, eviocgrab, 1) } | |||
| 38 | - | func (unixEvdev) ungrab(fd int) error { return unix.IoctlSetInt(fd, eviocgrab, 0) } | |||
| 39 | - | func (unixEvdev) close(fd int) error { return unix.Close(fd) } | |||
| 40 | - | ||||
| 41 | - | // Seat implements ports.Seat by opening devices itself. It is always | |||
| 42 | - | // active: there is no VT to switch away from. | |||
| 43 | - | type Seat struct { | |||
| 44 | - | log zerowrap.Logger | |||
| 45 | - | dev evdev | |||
| 46 | - | active chan bool | |||
| 47 | - | } | |||
| 48 | - | ||||
| 49 | - | var _ ports.Seat = (*Seat)(nil) | |||
| 50 | - | ||||
| 51 | - | // New returns a direct seat. log should carry the seat component. | |||
| 52 | - | func New(log zerowrap.Logger) *Seat { return newSeat(log, unixEvdev{}) } | |||
| 53 | - | ||||
| 54 | - | func newSeat(log zerowrap.Logger, dev evdev) *Seat { | |||
| 55 | - | active := make(chan bool, 1) | |||
| 56 | - | active <- true | |||
| 57 | - | return &Seat{log: log, dev: dev, active: active} | |||
| 58 | - | } | |||
| 59 | - | ||||
| 60 | - | // OpenDevice opens path read-write and grabs it exclusively. It fails | |||
| 61 | - | // closed: a device it cannot grab is closed and refused, so its input never | |||
| 62 | - | // reaches another client (a console or another session) as well. | |||
| 63 | - | func (s *Seat) OpenDevice(path string) (int, error) { | |||
| 64 | - | fd, err := s.dev.open(path) | |||
| 65 | - | if err != nil { | |||
| 66 | - | return -1, fmt.Errorf("open input device %s: %w", path, err) | |||
| 67 | - | } | |||
| 68 | - | if err := s.dev.grab(fd); err != nil { | |||
| 69 | - | if cerr := s.dev.close(fd); cerr != nil { | |||
| 70 | - | s.log.Warn().Err(cerr).Int("fd", fd).Msg("close input device") | |||
| 71 | - | } | |||
| 72 | - | if errors.Is(err, unix.EBUSY) { | |||
| 73 | - | err = fmt.Errorf("another client holds an exclusive grab: %w", err) | |||
| 74 | - | } | |||
| 75 | - | err = fmt.Errorf("grab input device %s: %w", path, err) | |||
| 76 | - | s.log.Warn().Err(err).Str("path", path).Msg("input device skipped") | |||
| 77 | - | return -1, err | |||
| 78 | - | } | |||
| 79 | - | return fd, nil | |||
| 80 | - | } | |||
| 81 | - | ||||
| 82 | - | // CloseDevice releases the grab and closes fd. | |||
| 83 | - | func (s *Seat) CloseDevice(fd int) { | |||
| 84 | - | if err := s.dev.ungrab(fd); err != nil { | |||
| 85 | - | s.log.Debug().Err(err).Int("fd", fd).Msg("release grab") | |||
| 86 | - | } | |||
| 87 | - | if err := s.dev.close(fd); err != nil { | |||
| 88 | - | s.log.Warn().Err(err).Int("fd", fd).Msg("close input device") | |||
| 89 | - | } | |||
| 90 | - | } | |||
| 91 | - | ||||
| 92 | - | // SwitchVT is a no-op: a direct seat owns no VT. | |||
| 93 | - | func (s *Seat) SwitchVT(vt int) { | |||
| 94 | - | s.log.Debug().Int("vt", vt).Msg("vt switch ignored without a session broker") | |||
| 95 | - | } | |||
| 96 | - | ||||
| 97 | - | // Name returns the seat name. | |||
| 98 | - | func (s *Seat) Name() string { return name } | |||
| 99 | - | ||||
| 100 | - | // Active yields true once: the seat never goes inactive. | |||
| 101 | - | func (s *Seat) Active() <-chan bool { return s.active } | |||
D internal/adapters/directseat/directseat_test.go +0 -140
| @@ -1,140 +0,0 @@ | |||
| 1 | - | package directseat | |
| 2 | - | ||
| 3 | - | import ( | |
| 4 | - | "bytes" | |
| 5 | - | "errors" | |
| 6 | - | "os" | |
| 7 | - | "path/filepath" | |
| 8 | - | "sync" | |
| 9 | - | "testing" | |
| 10 | - | ||
| 11 | - | "bnema.dev/zerowrap" | |
| 12 | - | "github.com/stretchr/testify/assert" | |
| 13 | - | "github.com/stretchr/testify/require" | |
| 14 | - | "golang.org/x/sys/unix" | |
| 15 | - | ) | |
| 16 | - | ||
| 17 | - | type lockedBuffer struct { | |
| 18 | - | mu sync.Mutex | |
| 19 | - | buf bytes.Buffer | |
| 20 | - | } | |
| 21 | - | ||
| 22 | - | func (b *lockedBuffer) Write(p []byte) (int, error) { | |
| 23 | - | b.mu.Lock() | |
| 24 | - | defer b.mu.Unlock() | |
| 25 | - | return b.buf.Write(p) | |
| 26 | - | } | |
| 27 | - | ||
| 28 | - | func (b *lockedBuffer) String() string { | |
| 29 | - | b.mu.Lock() | |
| 30 | - | defer b.mu.Unlock() | |
| 31 | - | return b.buf.String() | |
| 32 | - | } | |
| 33 | - | ||
| 34 | - | func testLog(out *lockedBuffer) zerowrap.Logger { | |
| 35 | - | return zerowrap.Logger{Logger: zerowrap.New(zerowrap.Config{Level: "debug", Format: "json", Output: out}).With().Str("component", "seat").Logger()} | |
| 36 | - | } | |
| 37 | - | ||
| 38 | - | func TestOpenDeviceGrabs(t *testing.T) { | |
| 39 | - | d := newMockevdev(t) | |
| 40 | - | d.EXPECT().open("/dev/input/event3").Return(7, nil) | |
| 41 | - | d.EXPECT().grab(7).Return(nil) | |
| 42 | - | var out lockedBuffer | |
| 43 | - | fd, err := newSeat(testLog(&out), d).OpenDevice("/dev/input/event3") | |
| 44 | - | require.NoError(t, err) | |
| 45 | - | assert.Equal(t, 7, fd) | |
| 46 | - | assert.NotContains(t, out.String(), `"warn"`) | |
| 47 | - | } | |
| 48 | - | ||
| 49 | - | func TestOpenDeviceGrabBusyRefused(t *testing.T) { | |
| 50 | - | d := newMockevdev(t) | |
| 51 | - | d.EXPECT().open("/dev/input/event3").Return(7, nil) | |
| 52 | - | d.EXPECT().grab(7).Return(unix.EBUSY) | |
| 53 | - | d.EXPECT().close(7).Return(nil).Once() | |
| 54 | - | var out lockedBuffer | |
| 55 | - | fd, err := newSeat(testLog(&out), d).OpenDevice("/dev/input/event3") | |
| 56 | - | require.ErrorIs(t, err, unix.EBUSY) | |
| 57 | - | assert.Contains(t, err.Error(), "another client holds an exclusive grab") | |
| 58 | - | assert.Contains(t, err.Error(), "/dev/input/event3") | |
| 59 | - | assert.Equal(t, -1, fd) | |
| 60 | - | assert.Contains(t, out.String(), `"level":"warn"`) | |
| 61 | - | assert.Contains(t, out.String(), `"component":"seat"`) | |
| 62 | - | } | |
| 63 | - | ||
| 64 | - | func TestOpenDeviceOpenFailure(t *testing.T) { | |
| 65 | - | d := newMockevdev(t) | |
| 66 | - | d.EXPECT().open("/dev/input/event3").Return(-1, unix.EACCES) | |
| 67 | - | _, err := newSeat(testLog(&lockedBuffer{}), d).OpenDevice("/dev/input/event3") | |
| 68 | - | require.ErrorIs(t, err, unix.EACCES) | |
| 69 | - | } | |
| 70 | - | ||
| 71 | - | func TestCloseDeviceReleasesAndCloses(t *testing.T) { | |
| 72 | - | d := newMockevdev(t) | |
| 73 | - | var order []string | |
| 74 | - | d.EXPECT().ungrab(7).RunAndReturn(func(int) error { order = append(order, "ungrab"); return nil }) | |
| 75 | - | d.EXPECT().close(7).RunAndReturn(func(int) error { order = append(order, "close"); return nil }) | |
| 76 | - | newSeat(testLog(&lockedBuffer{}), d).CloseDevice(7) | |
| 77 | - | assert.Equal(t, []string{"ungrab", "close"}, order) | |
| 78 | - | } | |
| 79 | - | ||
| 80 | - | func TestCloseDeviceClosesAfterUngrabFailure(t *testing.T) { | |
| 81 | - | d := newMockevdev(t) | |
| 82 | - | d.EXPECT().ungrab(7).Return(errors.New("not grabbed")) | |
| 83 | - | d.EXPECT().close(7).Return(nil) | |
| 84 | - | newSeat(testLog(&lockedBuffer{}), d).CloseDevice(7) | |
| 85 | - | } | |
| 86 | - | ||
| 87 | - | func TestSeatIdentityAndActive(t *testing.T) { | |
| 88 | - | var out lockedBuffer | |
| 89 | - | s := newSeat(testLog(&out), newMockevdev(t)) | |
| 90 | - | assert.Equal(t, "seat0", s.Name()) | |
| 91 | - | assert.True(t, <-s.Active()) | |
| 92 | - | s.SwitchVT(2) | |
| 93 | - | assert.Contains(t, out.String(), `"level":"debug"`) | |
| 94 | - | } | |
| 95 | - | ||
| 96 | - | // A regular file is not an evdev node: the grab fails with ENOTTY, the | |
| 97 | - | // device is refused and the fd it opened is closed. Never opens a real | |
| 98 | - | // /dev/input device. | |
| 99 | - | func TestRealFileGrabENOTTYRefused(t *testing.T) { | |
| 100 | - | path := filepath.Join(t.TempDir(), "event0") | |
| 101 | - | require.NoError(t, os.WriteFile(path, nil, 0o600)) | |
| 102 | - | before := openFDs(t) | |
| 103 | - | var out lockedBuffer | |
| 104 | - | fd, err := New(testLog(&out)).OpenDevice(path) | |
| 105 | - | require.ErrorIs(t, err, unix.ENOTTY) | |
| 106 | - | assert.Equal(t, -1, fd) | |
| 107 | - | assert.Contains(t, out.String(), "inappropriate ioctl") | |
| 108 | - | assert.Equal(t, before, openFDs(t), "the refused device's fd leaked") | |
| 109 | - | } | |
| 110 | - | ||
| 111 | - | // openFDs lists the process's open descriptors that point at regular files | |
| 112 | - | // named event0 (the test's fake device). | |
| 113 | - | func openFDs(t *testing.T) []string { | |
| 114 | - | t.Helper() | |
| 115 | - | entries, err := os.ReadDir("/proc/self/fd") | |
| 116 | - | require.NoError(t, err) | |
| 117 | - | var fds []string | |
| 118 | - | for _, e := range entries { | |
| 119 | - | if target, err := os.Readlink(filepath.Join("/proc/self/fd", e.Name())); err == nil && filepath.Base(target) == "event0" { | |
| 120 | - | fds = append(fds, e.Name()) | |
| 121 | - | } | |
| 122 | - | } | |
| 123 | - | return fds | |
| 124 | - | } | |
| 125 | - | ||
| 126 | - | // The kernel boundary opens devices read-write, non-blocking and close-on-exec. | |
| 127 | - | func TestUnixOpenFlags(t *testing.T) { | |
| 128 | - | path := filepath.Join(t.TempDir(), "event0") | |
| 129 | - | require.NoError(t, os.WriteFile(path, nil, 0o600)) | |
| 130 | - | fd, err := unixEvdev{}.open(path) | |
| 131 | - | require.NoError(t, err) | |
| 132 | - | defer unix.Close(fd) | |
| 133 | - | flags, err := unix.FcntlInt(uintptr(fd), unix.F_GETFL, 0) | |
| 134 | - | require.NoError(t, err) | |
| 135 | - | assert.Equal(t, unix.O_RDWR, flags&unix.O_ACCMODE) | |
| 136 | - | assert.NotZero(t, flags&unix.O_NONBLOCK) | |
| 137 | - | fdflags, err := unix.FcntlInt(uintptr(fd), unix.F_GETFD, 0) | |
| 138 | - | require.NoError(t, err) | |
| 139 | - | assert.NotZero(t, fdflags&unix.FD_CLOEXEC) | |
| 140 | - | } | |
| @@ -1,140 +0,0 @@ | |||||
| 1 | - | package directseat | |||
| 2 | - | ||||
| 3 | - | import ( | |||
| 4 | - | "bytes" | |||
| 5 | - | "errors" | |||
| 6 | - | "os" | |||
| 7 | - | "path/filepath" | |||
| 8 | - | "sync" | |||
| 9 | - | "testing" | |||
| 10 | - | ||||
| 11 | - | "bnema.dev/zerowrap" | |||
| 12 | - | "github.com/stretchr/testify/assert" | |||
| 13 | - | "github.com/stretchr/testify/require" | |||
| 14 | - | "golang.org/x/sys/unix" | |||
| 15 | - | ) | |||
| 16 | - | ||||
| 17 | - | type lockedBuffer struct { | |||
| 18 | - | mu sync.Mutex | |||
| 19 | - | buf bytes.Buffer | |||
| 20 | - | } | |||
| 21 | - | ||||
| 22 | - | func (b *lockedBuffer) Write(p []byte) (int, error) { | |||
| 23 | - | b.mu.Lock() | |||
| 24 | - | defer b.mu.Unlock() | |||
| 25 | - | return b.buf.Write(p) | |||
| 26 | - | } | |||
| 27 | - | ||||
| 28 | - | func (b *lockedBuffer) String() string { | |||
| 29 | - | b.mu.Lock() | |||
| 30 | - | defer b.mu.Unlock() | |||
| 31 | - | return b.buf.String() | |||
| 32 | - | } | |||
| 33 | - | ||||
| 34 | - | func testLog(out *lockedBuffer) zerowrap.Logger { | |||
| 35 | - | return zerowrap.Logger{Logger: zerowrap.New(zerowrap.Config{Level: "debug", Format: "json", Output: out}).With().Str("component", "seat").Logger()} | |||
| 36 | - | } | |||
| 37 | - | ||||
| 38 | - | func TestOpenDeviceGrabs(t *testing.T) { | |||
| 39 | - | d := newMockevdev(t) | |||
| 40 | - | d.EXPECT().open("/dev/input/event3").Return(7, nil) | |||
| 41 | - | d.EXPECT().grab(7).Return(nil) | |||
| 42 | - | var out lockedBuffer | |||
| 43 | - | fd, err := newSeat(testLog(&out), d).OpenDevice("/dev/input/event3") | |||
| 44 | - | require.NoError(t, err) | |||
| 45 | - | assert.Equal(t, 7, fd) | |||
| 46 | - | assert.NotContains(t, out.String(), `"warn"`) | |||
| 47 | - | } | |||
| 48 | - | ||||
| 49 | - | func TestOpenDeviceGrabBusyRefused(t *testing.T) { | |||
| 50 | - | d := newMockevdev(t) | |||
| 51 | - | d.EXPECT().open("/dev/input/event3").Return(7, nil) | |||
| 52 | - | d.EXPECT().grab(7).Return(unix.EBUSY) | |||
| 53 | - | d.EXPECT().close(7).Return(nil).Once() | |||
| 54 | - | var out lockedBuffer | |||
| 55 | - | fd, err := newSeat(testLog(&out), d).OpenDevice("/dev/input/event3") | |||
| 56 | - | require.ErrorIs(t, err, unix.EBUSY) | |||
| 57 | - | assert.Contains(t, err.Error(), "another client holds an exclusive grab") | |||
| 58 | - | assert.Contains(t, err.Error(), "/dev/input/event3") | |||
| 59 | - | assert.Equal(t, -1, fd) | |||
| 60 | - | assert.Contains(t, out.String(), `"level":"warn"`) | |||
| 61 | - | assert.Contains(t, out.String(), `"component":"seat"`) | |||
| 62 | - | } | |||
| 63 | - | ||||
| 64 | - | func TestOpenDeviceOpenFailure(t *testing.T) { | |||
| 65 | - | d := newMockevdev(t) | |||
| 66 | - | d.EXPECT().open("/dev/input/event3").Return(-1, unix.EACCES) | |||
| 67 | - | _, err := newSeat(testLog(&lockedBuffer{}), d).OpenDevice("/dev/input/event3") | |||
| 68 | - | require.ErrorIs(t, err, unix.EACCES) | |||
| 69 | - | } | |||
| 70 | - | ||||
| 71 | - | func TestCloseDeviceReleasesAndCloses(t *testing.T) { | |||
| 72 | - | d := newMockevdev(t) | |||
| 73 | - | var order []string | |||
| 74 | - | d.EXPECT().ungrab(7).RunAndReturn(func(int) error { order = append(order, "ungrab"); return nil }) | |||
| 75 | - | d.EXPECT().close(7).RunAndReturn(func(int) error { order = append(order, "close"); return nil }) | |||
| 76 | - | newSeat(testLog(&lockedBuffer{}), d).CloseDevice(7) | |||
| 77 | - | assert.Equal(t, []string{"ungrab", "close"}, order) | |||
| 78 | - | } | |||
| 79 | - | ||||
| 80 | - | func TestCloseDeviceClosesAfterUngrabFailure(t *testing.T) { | |||
| 81 | - | d := newMockevdev(t) | |||
| 82 | - | d.EXPECT().ungrab(7).Return(errors.New("not grabbed")) | |||
| 83 | - | d.EXPECT().close(7).Return(nil) | |||
| 84 | - | newSeat(testLog(&lockedBuffer{}), d).CloseDevice(7) | |||
| 85 | - | } | |||
| 86 | - | ||||
| 87 | - | func TestSeatIdentityAndActive(t *testing.T) { | |||
| 88 | - | var out lockedBuffer | |||
| 89 | - | s := newSeat(testLog(&out), newMockevdev(t)) | |||
| 90 | - | assert.Equal(t, "seat0", s.Name()) | |||
| 91 | - | assert.True(t, <-s.Active()) | |||
| 92 | - | s.SwitchVT(2) | |||
| 93 | - | assert.Contains(t, out.String(), `"level":"debug"`) | |||
| 94 | - | } | |||
| 95 | - | ||||
| 96 | - | // A regular file is not an evdev node: the grab fails with ENOTTY, the | |||
| 97 | - | // device is refused and the fd it opened is closed. Never opens a real | |||
| 98 | - | // /dev/input device. | |||
| 99 | - | func TestRealFileGrabENOTTYRefused(t *testing.T) { | |||
| 100 | - | path := filepath.Join(t.TempDir(), "event0") | |||
| 101 | - | require.NoError(t, os.WriteFile(path, nil, 0o600)) | |||
| 102 | - | before := openFDs(t) | |||
| 103 | - | var out lockedBuffer | |||
| 104 | - | fd, err := New(testLog(&out)).OpenDevice(path) | |||
| 105 | - | require.ErrorIs(t, err, unix.ENOTTY) | |||
| 106 | - | assert.Equal(t, -1, fd) | |||
| 107 | - | assert.Contains(t, out.String(), "inappropriate ioctl") | |||
| 108 | - | assert.Equal(t, before, openFDs(t), "the refused device's fd leaked") | |||
| 109 | - | } | |||
| 110 | - | ||||
| 111 | - | // openFDs lists the process's open descriptors that point at regular files | |||
| 112 | - | // named event0 (the test's fake device). | |||
| 113 | - | func openFDs(t *testing.T) []string { | |||
| 114 | - | t.Helper() | |||
| 115 | - | entries, err := os.ReadDir("/proc/self/fd") | |||
| 116 | - | require.NoError(t, err) | |||
| 117 | - | var fds []string | |||
| 118 | - | for _, e := range entries { | |||
| 119 | - | if target, err := os.Readlink(filepath.Join("/proc/self/fd", e.Name())); err == nil && filepath.Base(target) == "event0" { | |||
| 120 | - | fds = append(fds, e.Name()) | |||
| 121 | - | } | |||
| 122 | - | } | |||
| 123 | - | return fds | |||
| 124 | - | } | |||
| 125 | - | ||||
| 126 | - | // The kernel boundary opens devices read-write, non-blocking and close-on-exec. | |||
| 127 | - | func TestUnixOpenFlags(t *testing.T) { | |||
| 128 | - | path := filepath.Join(t.TempDir(), "event0") | |||
| 129 | - | require.NoError(t, os.WriteFile(path, nil, 0o600)) | |||
| 130 | - | fd, err := unixEvdev{}.open(path) | |||
| 131 | - | require.NoError(t, err) | |||
| 132 | - | defer unix.Close(fd) | |||
| 133 | - | flags, err := unix.FcntlInt(uintptr(fd), unix.F_GETFL, 0) | |||
| 134 | - | require.NoError(t, err) | |||
| 135 | - | assert.Equal(t, unix.O_RDWR, flags&unix.O_ACCMODE) | |||
| 136 | - | assert.NotZero(t, flags&unix.O_NONBLOCK) | |||
| 137 | - | fdflags, err := unix.FcntlInt(uintptr(fd), unix.F_GETFD, 0) | |||
| 138 | - | require.NoError(t, err) | |||
| 139 | - | assert.NotZero(t, fdflags&unix.FD_CLOEXEC) | |||
| 140 | - | } | |||
D internal/adapters/directseat/evdev_mock_test.go +0 -258
| @@ -1,258 +0,0 @@ | |||
| 1 | - | // Code generated by mockery; DO NOT EDIT. | |
| 2 | - | // github.com/vektra/mockery | |
| 3 | - | // template: testify | |
| 4 | - | ||
| 5 | - | package directseat | |
| 6 | - | ||
| 7 | - | import ( | |
| 8 | - | mock "github.com/stretchr/testify/mock" | |
| 9 | - | ) | |
| 10 | - | ||
| 11 | - | // newMockevdev creates a new instance of mockevdev. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. | |
| 12 | - | // The first argument is typically a *testing.T value. | |
| 13 | - | func newMockevdev(t interface { | |
| 14 | - | mock.TestingT | |
| 15 | - | Cleanup(func()) | |
| 16 | - | }) *mockevdev { | |
| 17 | - | if helper, ok := t.(interface{ Helper() }); ok { | |
| 18 | - | helper.Helper() | |
| 19 | - | } | |
| 20 | - | ||
| 21 | - | mock := &mockevdev{} | |
| 22 | - | mock.Mock.Test(t) | |
| 23 | - | ||
| 24 | - | t.Cleanup(func() { | |
| 25 | - | if helper, ok := t.(interface{ Helper() }); ok { | |
| 26 | - | helper.Helper() | |
| 27 | - | } | |
| 28 | - | mock.AssertExpectations(t) | |
| 29 | - | }) | |
| 30 | - | ||
| 31 | - | return mock | |
| 32 | - | } | |
| 33 | - | ||
| 34 | - | // mockevdev is an autogenerated mock type for the evdev type | |
| 35 | - | type mockevdev struct { | |
| 36 | - | mock.Mock | |
| 37 | - | } | |
| 38 | - | ||
| 39 | - | type mockevdev_Expecter struct { | |
| 40 | - | mock *mock.Mock | |
| 41 | - | } | |
| 42 | - | ||
| 43 | - | func (_m *mockevdev) EXPECT() *mockevdev_Expecter { | |
| 44 | - | return &mockevdev_Expecter{mock: &_m.Mock} | |
| 45 | - | } | |
| 46 | - | ||
| 47 | - | // close provides a mock function for the type mockevdev | |
| 48 | - | func (_mock *mockevdev) close(fd int) error { | |
| 49 | - | ret := _mock.Called(fd) | |
| 50 | - | ||
| 51 | - | if len(ret) == 0 { | |
| 52 | - | panic("no return value specified for close") | |
| 53 | - | } | |
| 54 | - | ||
| 55 | - | var r0 error | |
| 56 | - | if returnFunc, ok := ret.Get(0).(func(int) error); ok { | |
| 57 | - | r0 = returnFunc(fd) | |
| 58 | - | } else { | |
| 59 | - | r0 = ret.Error(0) | |
| 60 | - | } | |
| 61 | - | return r0 | |
| 62 | - | } | |
| 63 | - | ||
| 64 | - | // mockevdev_close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'close' | |
| 65 | - | type mockevdev_close_Call struct { | |
| 66 | - | *mock.Call | |
| 67 | - | } | |
| 68 | - | ||
| 69 | - | // close is a helper method to define mock.On call | |
| 70 | - | // - fd int | |
| 71 | - | func (_e *mockevdev_Expecter) close(fd any) *mockevdev_close_Call { | |
| 72 | - | return &mockevdev_close_Call{Call: _e.mock.On("close", fd)} | |
| 73 | - | } | |
| 74 | - | ||
| 75 | - | func (_c *mockevdev_close_Call) Run(run func(fd int)) *mockevdev_close_Call { | |
| 76 | - | _c.Call.Run(func(args mock.Arguments) { | |
| 77 | - | var arg0 int | |
| 78 | - | if args[0] != nil { | |
| 79 | - | arg0 = args[0].(int) | |
| 80 | - | } | |
| 81 | - | run( | |
| 82 | - | arg0, | |
| 83 | - | ) | |
| 84 | - | }) | |
| 85 | - | return _c | |
| 86 | - | } | |
| 87 | - | ||
| 88 | - | func (_c *mockevdev_close_Call) Return(err error) *mockevdev_close_Call { | |
| 89 | - | _c.Call.Return(err) | |
| 90 | - | return _c | |
| 91 | - | } | |
| 92 | - | ||
| 93 | - | func (_c *mockevdev_close_Call) RunAndReturn(run func(fd int) error) *mockevdev_close_Call { | |
| 94 | - | _c.Call.Return(run) | |
| 95 | - | return _c | |
| 96 | - | } | |
| 97 | - | ||
| 98 | - | // grab provides a mock function for the type mockevdev | |
| 99 | - | func (_mock *mockevdev) grab(fd int) error { | |
| 100 | - | ret := _mock.Called(fd) | |
| 101 | - | ||
| 102 | - | if len(ret) == 0 { | |
| 103 | - | panic("no return value specified for grab") | |
| 104 | - | } | |
| 105 | - | ||
| 106 | - | var r0 error | |
| 107 | - | if returnFunc, ok := ret.Get(0).(func(int) error); ok { | |
| 108 | - | r0 = returnFunc(fd) | |
| 109 | - | } else { | |
| 110 | - | r0 = ret.Error(0) | |
| 111 | - | } | |
| 112 | - | return r0 | |
| 113 | - | } | |
| 114 | - | ||
| 115 | - | // mockevdev_grab_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'grab' | |
| 116 | - | type mockevdev_grab_Call struct { | |
| 117 | - | *mock.Call | |
| 118 | - | } | |
| 119 | - | ||
| 120 | - | // grab is a helper method to define mock.On call | |
| 121 | - | // - fd int | |
| 122 | - | func (_e *mockevdev_Expecter) grab(fd any) *mockevdev_grab_Call { | |
| 123 | - | return &mockevdev_grab_Call{Call: _e.mock.On("grab", fd)} | |
| 124 | - | } | |
| 125 | - | ||
| 126 | - | func (_c *mockevdev_grab_Call) Run(run func(fd int)) *mockevdev_grab_Call { | |
| 127 | - | _c.Call.Run(func(args mock.Arguments) { | |
| 128 | - | var arg0 int | |
| 129 | - | if args[0] != nil { | |
| 130 | - | arg0 = args[0].(int) | |
| 131 | - | } | |
| 132 | - | run( | |
| 133 | - | arg0, | |
| 134 | - | ) | |
| 135 | - | }) | |
| 136 | - | return _c | |
| 137 | - | } | |
| 138 | - | ||
| 139 | - | func (_c *mockevdev_grab_Call) Return(err error) *mockevdev_grab_Call { | |
| 140 | - | _c.Call.Return(err) | |
| 141 | - | return _c | |
| 142 | - | } | |
| 143 | - | ||
| 144 | - | func (_c *mockevdev_grab_Call) RunAndReturn(run func(fd int) error) *mockevdev_grab_Call { | |
| 145 | - | _c.Call.Return(run) | |
| 146 | - | return _c | |
| 147 | - | } | |
| 148 | - | ||
| 149 | - | // open provides a mock function for the type mockevdev | |
| 150 | - | func (_mock *mockevdev) open(path string) (int, error) { | |
| 151 | - | ret := _mock.Called(path) | |
| 152 | - | ||
| 153 | - | if len(ret) == 0 { | |
| 154 | - | panic("no return value specified for open") | |
| 155 | - | } | |
| 156 | - | ||
| 157 | - | var r0 int | |
| 158 | - | var r1 error | |
| 159 | - | if returnFunc, ok := ret.Get(0).(func(string) (int, error)); ok { | |
| 160 | - | return returnFunc(path) | |
| 161 | - | } | |
| 162 | - | if returnFunc, ok := ret.Get(0).(func(string) int); ok { | |
| 163 | - | r0 = returnFunc(path) | |
| 164 | - | } else { | |
| 165 | - | r0 = ret.Get(0).(int) | |
| 166 | - | } | |
| 167 | - | if returnFunc, ok := ret.Get(1).(func(string) error); ok { | |
| 168 | - | r1 = returnFunc(path) | |
| 169 | - | } else { | |
| 170 | - | r1 = ret.Error(1) | |
| 171 | - | } | |
| 172 | - | return r0, r1 | |
| 173 | - | } | |
| 174 | - | ||
| 175 | - | // mockevdev_open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'open' | |
| 176 | - | type mockevdev_open_Call struct { | |
| 177 | - | *mock.Call | |
| 178 | - | } | |
| 179 | - | ||
| 180 | - | // open is a helper method to define mock.On call | |
| 181 | - | // - path string | |
| 182 | - | func (_e *mockevdev_Expecter) open(path any) *mockevdev_open_Call { | |
| 183 | - | return &mockevdev_open_Call{Call: _e.mock.On("open", path)} | |
| 184 | - | } | |
| 185 | - | ||
| 186 | - | func (_c *mockevdev_open_Call) Run(run func(path string)) *mockevdev_open_Call { | |
| 187 | - | _c.Call.Run(func(args mock.Arguments) { | |
| 188 | - | var arg0 string | |
| 189 | - | if args[0] != nil { | |
| 190 | - | arg0 = args[0].(string) | |
| 191 | - | } | |
| 192 | - | run( | |
| 193 | - | arg0, | |
| 194 | - | ) | |
| 195 | - | }) | |
| 196 | - | return _c | |
| 197 | - | } | |
| 198 | - | ||
| 199 | - | func (_c *mockevdev_open_Call) Return(n int, err error) *mockevdev_open_Call { | |
| 200 | - | _c.Call.Return(n, err) | |
| 201 | - | return _c | |
| 202 | - | } | |
| 203 | - | ||
| 204 | - | func (_c *mockevdev_open_Call) RunAndReturn(run func(path string) (int, error)) *mockevdev_open_Call { | |
| 205 | - | _c.Call.Return(run) | |
| 206 | - | return _c | |
| 207 | - | } | |
| 208 | - | ||
| 209 | - | // ungrab provides a mock function for the type mockevdev | |
| 210 | - | func (_mock *mockevdev) ungrab(fd int) error { | |
| 211 | - | ret := _mock.Called(fd) | |
| 212 | - | ||
| 213 | - | if len(ret) == 0 { | |
| 214 | - | panic("no return value specified for ungrab") | |
| 215 | - | } | |
| 216 | - | ||
| 217 | - | var r0 error | |
| 218 | - | if returnFunc, ok := ret.Get(0).(func(int) error); ok { | |
| 219 | - | r0 = returnFunc(fd) | |
| 220 | - | } else { | |
| 221 | - | r0 = ret.Error(0) | |
| 222 | - | } | |
| 223 | - | return r0 | |
| 224 | - | } | |
| 225 | - | ||
| 226 | - | // mockevdev_ungrab_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ungrab' | |
| 227 | - | type mockevdev_ungrab_Call struct { | |
| 228 | - | *mock.Call | |
| 229 | - | } | |
| 230 | - | ||
| 231 | - | // ungrab is a helper method to define mock.On call | |
| 232 | - | // - fd int | |
| 233 | - | func (_e *mockevdev_Expecter) ungrab(fd any) *mockevdev_ungrab_Call { | |
| 234 | - | return &mockevdev_ungrab_Call{Call: _e.mock.On("ungrab", fd)} | |
| 235 | - | } | |
| 236 | - | ||
| 237 | - | func (_c *mockevdev_ungrab_Call) Run(run func(fd int)) *mockevdev_ungrab_Call { | |
| 238 | - | _c.Call.Run(func(args mock.Arguments) { | |
| 239 | - | var arg0 int | |
| 240 | - | if args[0] != nil { | |
| 241 | - | arg0 = args[0].(int) | |
| 242 | - | } | |
| 243 | - | run( | |
| 244 | - | arg0, | |
| 245 | - | ) | |
| 246 | - | }) | |
| 247 | - | return _c | |
| 248 | - | } | |
| 249 | - | ||
| 250 | - | func (_c *mockevdev_ungrab_Call) Return(err error) *mockevdev_ungrab_Call { | |
| 251 | - | _c.Call.Return(err) | |
| 252 | - | return _c | |
| 253 | - | } | |
| 254 | - | ||
| 255 | - | func (_c *mockevdev_ungrab_Call) RunAndReturn(run func(fd int) error) *mockevdev_ungrab_Call { | |
| 256 | - | _c.Call.Return(run) | |
| 257 | - | return _c | |
| 258 | - | } | |
| @@ -1,258 +0,0 @@ | |||||
| 1 | - | // Code generated by mockery; DO NOT EDIT. | |||
| 2 | - | // github.com/vektra/mockery | |||
| 3 | - | // template: testify | |||
| 4 | - | ||||
| 5 | - | package directseat | |||
| 6 | - | ||||
| 7 | - | import ( | |||
| 8 | - | mock "github.com/stretchr/testify/mock" | |||
| 9 | - | ) | |||
| 10 | - | ||||
| 11 | - | // newMockevdev creates a new instance of mockevdev. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. | |||
| 12 | - | // The first argument is typically a *testing.T value. | |||
| 13 | - | func newMockevdev(t interface { | |||
| 14 | - | mock.TestingT | |||
| 15 | - | Cleanup(func()) | |||
| 16 | - | }) *mockevdev { | |||
| 17 | - | if helper, ok := t.(interface{ Helper() }); ok { | |||
| 18 | - | helper.Helper() | |||
| 19 | - | } | |||
| 20 | - | ||||
| 21 | - | mock := &mockevdev{} | |||
| 22 | - | mock.Mock.Test(t) | |||
| 23 | - | ||||
| 24 | - | t.Cleanup(func() { | |||
| 25 | - | if helper, ok := t.(interface{ Helper() }); ok { | |||
| 26 | - | helper.Helper() | |||
| 27 | - | } | |||
| 28 | - | mock.AssertExpectations(t) | |||
| 29 | - | }) | |||
| 30 | - | ||||
| 31 | - | return mock | |||
| 32 | - | } | |||
| 33 | - | ||||
| 34 | - | // mockevdev is an autogenerated mock type for the evdev type | |||
| 35 | - | type mockevdev struct { | |||
| 36 | - | mock.Mock | |||
| 37 | - | } | |||
| 38 | - | ||||
| 39 | - | type mockevdev_Expecter struct { | |||
| 40 | - | mock *mock.Mock | |||
| 41 | - | } | |||
| 42 | - | ||||
| 43 | - | func (_m *mockevdev) EXPECT() *mockevdev_Expecter { | |||
| 44 | - | return &mockevdev_Expecter{mock: &_m.Mock} | |||
| 45 | - | } | |||
| 46 | - | ||||
| 47 | - | // close provides a mock function for the type mockevdev | |||
| 48 | - | func (_mock *mockevdev) close(fd int) error { | |||
| 49 | - | ret := _mock.Called(fd) | |||
| 50 | - | ||||
| 51 | - | if len(ret) == 0 { | |||
| 52 | - | panic("no return value specified for close") | |||
| 53 | - | } | |||
| 54 | - | ||||
| 55 | - | var r0 error | |||
| 56 | - | if returnFunc, ok := ret.Get(0).(func(int) error); ok { | |||
| 57 | - | r0 = returnFunc(fd) | |||
| 58 | - | } else { | |||
| 59 | - | r0 = ret.Error(0) | |||
| 60 | - | } | |||
| 61 | - | return r0 | |||
| 62 | - | } | |||
| 63 | - | ||||
| 64 | - | // mockevdev_close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'close' | |||
| 65 | - | type mockevdev_close_Call struct { | |||
| 66 | - | *mock.Call | |||
| 67 | - | } | |||
| 68 | - | ||||
| 69 | - | // close is a helper method to define mock.On call | |||
| 70 | - | // - fd int | |||
| 71 | - | func (_e *mockevdev_Expecter) close(fd any) *mockevdev_close_Call { | |||
| 72 | - | return &mockevdev_close_Call{Call: _e.mock.On("close", fd)} | |||
| 73 | - | } | |||
| 74 | - | ||||
| 75 | - | func (_c *mockevdev_close_Call) Run(run func(fd int)) *mockevdev_close_Call { | |||
| 76 | - | _c.Call.Run(func(args mock.Arguments) { | |||
| 77 | - | var arg0 int | |||
| 78 | - | if args[0] != nil { | |||
| 79 | - | arg0 = args[0].(int) | |||
| 80 | - | } | |||
| 81 | - | run( | |||
| 82 | - | arg0, | |||
| 83 | - | ) | |||
| 84 | - | }) | |||
| 85 | - | return _c | |||
| 86 | - | } | |||
| 87 | - | ||||
| 88 | - | func (_c *mockevdev_close_Call) Return(err error) *mockevdev_close_Call { | |||
| 89 | - | _c.Call.Return(err) | |||
| 90 | - | return _c | |||
| 91 | - | } | |||
| 92 | - | ||||
| 93 | - | func (_c *mockevdev_close_Call) RunAndReturn(run func(fd int) error) *mockevdev_close_Call { | |||
| 94 | - | _c.Call.Return(run) | |||
| 95 | - | return _c | |||
| 96 | - | } | |||
| 97 | - | ||||
| 98 | - | // grab provides a mock function for the type mockevdev | |||
| 99 | - | func (_mock *mockevdev) grab(fd int) error { | |||
| 100 | - | ret := _mock.Called(fd) | |||
| 101 | - | ||||
| 102 | - | if len(ret) == 0 { | |||
| 103 | - | panic("no return value specified for grab") | |||
| 104 | - | } | |||
| 105 | - | ||||
| 106 | - | var r0 error | |||
| 107 | - | if returnFunc, ok := ret.Get(0).(func(int) error); ok { | |||
| 108 | - | r0 = returnFunc(fd) | |||
| 109 | - | } else { | |||
| 110 | - | r0 = ret.Error(0) | |||
| 111 | - | } | |||
| 112 | - | return r0 | |||
| 113 | - | } | |||
| 114 | - | ||||
| 115 | - | // mockevdev_grab_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'grab' | |||
| 116 | - | type mockevdev_grab_Call struct { | |||
| 117 | - | *mock.Call | |||
| 118 | - | } | |||
| 119 | - | ||||
| 120 | - | // grab is a helper method to define mock.On call | |||
| 121 | - | // - fd int | |||
| 122 | - | func (_e *mockevdev_Expecter) grab(fd any) *mockevdev_grab_Call { | |||
| 123 | - | return &mockevdev_grab_Call{Call: _e.mock.On("grab", fd)} | |||
| 124 | - | } | |||
| 125 | - | ||||
| 126 | - | func (_c *mockevdev_grab_Call) Run(run func(fd int)) *mockevdev_grab_Call { | |||
| 127 | - | _c.Call.Run(func(args mock.Arguments) { | |||
| 128 | - | var arg0 int | |||
| 129 | - | if args[0] != nil { | |||
| 130 | - | arg0 = args[0].(int) | |||
| 131 | - | } | |||
| 132 | - | run( | |||
| 133 | - | arg0, | |||
| 134 | - | ) | |||
| 135 | - | }) | |||
| 136 | - | return _c | |||
| 137 | - | } | |||
| 138 | - | ||||
| 139 | - | func (_c *mockevdev_grab_Call) Return(err error) *mockevdev_grab_Call { | |||
| 140 | - | _c.Call.Return(err) | |||
| 141 | - | return _c | |||
| 142 | - | } | |||
| 143 | - | ||||
| 144 | - | func (_c *mockevdev_grab_Call) RunAndReturn(run func(fd int) error) *mockevdev_grab_Call { | |||
| 145 | - | _c.Call.Return(run) | |||
| 146 | - | return _c | |||
| 147 | - | } | |||
| 148 | - | ||||
| 149 | - | // open provides a mock function for the type mockevdev | |||
| 150 | - | func (_mock *mockevdev) open(path string) (int, error) { | |||
| 151 | - | ret := _mock.Called(path) | |||
| 152 | - | ||||
| 153 | - | if len(ret) == 0 { | |||
| 154 | - | panic("no return value specified for open") | |||
| 155 | - | } | |||
| 156 | - | ||||
| 157 | - | var r0 int | |||
| 158 | - | var r1 error | |||
| 159 | - | if returnFunc, ok := ret.Get(0).(func(string) (int, error)); ok { | |||
| 160 | - | return returnFunc(path) | |||
| 161 | - | } | |||
| 162 | - | if returnFunc, ok := ret.Get(0).(func(string) int); ok { | |||
| 163 | - | r0 = returnFunc(path) | |||
| 164 | - | } else { | |||
| 165 | - | r0 = ret.Get(0).(int) | |||
| 166 | - | } | |||
| 167 | - | if returnFunc, ok := ret.Get(1).(func(string) error); ok { | |||
| 168 | - | r1 = returnFunc(path) | |||
| 169 | - | } else { | |||
| 170 | - | r1 = ret.Error(1) | |||
| 171 | - | } | |||
| 172 | - | return r0, r1 | |||
| 173 | - | } | |||
| 174 | - | ||||
| 175 | - | // mockevdev_open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'open' | |||
| 176 | - | type mockevdev_open_Call struct { | |||
| 177 | - | *mock.Call | |||
| 178 | - | } | |||
| 179 | - | ||||
| 180 | - | // open is a helper method to define mock.On call | |||
| 181 | - | // - path string | |||
| 182 | - | func (_e *mockevdev_Expecter) open(path any) *mockevdev_open_Call { | |||
| 183 | - | return &mockevdev_open_Call{Call: _e.mock.On("open", path)} | |||
| 184 | - | } | |||
| 185 | - | ||||
| 186 | - | func (_c *mockevdev_open_Call) Run(run func(path string)) *mockevdev_open_Call { | |||
| 187 | - | _c.Call.Run(func(args mock.Arguments) { | |||
| 188 | - | var arg0 string | |||
| 189 | - | if args[0] != nil { | |||
| 190 | - | arg0 = args[0].(string) | |||
| 191 | - | } | |||
| 192 | - | run( | |||
| 193 | - | arg0, | |||
| 194 | - | ) | |||
| 195 | - | }) | |||
| 196 | - | return _c | |||
| 197 | - | } | |||
| 198 | - | ||||
| 199 | - | func (_c *mockevdev_open_Call) Return(n int, err error) *mockevdev_open_Call { | |||
| 200 | - | _c.Call.Return(n, err) | |||
| 201 | - | return _c | |||
| 202 | - | } | |||
| 203 | - | ||||
| 204 | - | func (_c *mockevdev_open_Call) RunAndReturn(run func(path string) (int, error)) *mockevdev_open_Call { | |||
| 205 | - | _c.Call.Return(run) | |||
| 206 | - | return _c | |||
| 207 | - | } | |||
| 208 | - | ||||
| 209 | - | // ungrab provides a mock function for the type mockevdev | |||
| 210 | - | func (_mock *mockevdev) ungrab(fd int) error { | |||
| 211 | - | ret := _mock.Called(fd) | |||
| 212 | - | ||||
| 213 | - | if len(ret) == 0 { | |||
| 214 | - | panic("no return value specified for ungrab") | |||
| 215 | - | } | |||
| 216 | - | ||||
| 217 | - | var r0 error | |||
| 218 | - | if returnFunc, ok := ret.Get(0).(func(int) error); ok { | |||
| 219 | - | r0 = returnFunc(fd) | |||
| 220 | - | } else { | |||
| 221 | - | r0 = ret.Error(0) | |||
| 222 | - | } | |||
| 223 | - | return r0 | |||
| 224 | - | } | |||
| 225 | - | ||||
| 226 | - | // mockevdev_ungrab_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ungrab' | |||
| 227 | - | type mockevdev_ungrab_Call struct { | |||
| 228 | - | *mock.Call | |||
| 229 | - | } | |||
| 230 | - | ||||
| 231 | - | // ungrab is a helper method to define mock.On call | |||
| 232 | - | // - fd int | |||
| 233 | - | func (_e *mockevdev_Expecter) ungrab(fd any) *mockevdev_ungrab_Call { | |||
| 234 | - | return &mockevdev_ungrab_Call{Call: _e.mock.On("ungrab", fd)} | |||
| 235 | - | } | |||
| 236 | - | ||||
| 237 | - | func (_c *mockevdev_ungrab_Call) Run(run func(fd int)) *mockevdev_ungrab_Call { | |||
| 238 | - | _c.Call.Run(func(args mock.Arguments) { | |||
| 239 | - | var arg0 int | |||
| 240 | - | if args[0] != nil { | |||
| 241 | - | arg0 = args[0].(int) | |||
| 242 | - | } | |||
| 243 | - | run( | |||
| 244 | - | arg0, | |||
| 245 | - | ) | |||
| 246 | - | }) | |||
| 247 | - | return _c | |||
| 248 | - | } | |||
| 249 | - | ||||
| 250 | - | func (_c *mockevdev_ungrab_Call) Return(err error) *mockevdev_ungrab_Call { | |||
| 251 | - | _c.Call.Return(err) | |||
| 252 | - | return _c | |||
| 253 | - | } | |||
| 254 | - | ||||
| 255 | - | func (_c *mockevdev_ungrab_Call) RunAndReturn(run func(fd int) error) *mockevdev_ungrab_Call { | |||
| 256 | - | _c.Call.Return(run) | |||
| 257 | - | return _c | |||
| 258 | - | } | |||
D internal/adapters/drm/capture_cursor_test.go +0 -75
| @@ -1,75 +0,0 @@ | |||
| 1 | - | package drm | |
| 2 | - | ||
| 3 | - | import ( | |
| 4 | - | "github.com/bnema/neferwl/internal/domain" | |
| 5 | - | "testing" | |
| 6 | - | ) | |
| 7 | - | ||
| 8 | - | func TestCaptureCursorSnapshot(t *testing.T) { | |
| 9 | - | var storage domain.CaptureCursor | |
| 10 | - | c := newCursor(nil, 64) | |
| 11 | - | c.image = true | |
| 12 | - | c.captureImage = domain.CursorImage{W: 1, H: 1, HotX: 2, Pixels: []byte{1, 2, 3, 255}} | |
| 13 | - | c.Move(10, 20) | |
| 14 | - | s := c.snapshot(&storage) | |
| 15 | - | if s == nil || s.X != 10 || s.Y != 20 || s.Image.HotX != 2 || s.Image.Pixels[2] != 3 { | |
| 16 | - | t.Fatalf("snapshot: %+v", s) | |
| 17 | - | } | |
| 18 | - | c.Hide() | |
| 19 | - | if c.snapshot(&storage) != nil { | |
| 20 | - | t.Fatal("away cursor captured") | |
| 21 | - | } | |
| 22 | - | c.Move(30, 40) | |
| 23 | - | c.image = false | |
| 24 | - | if c.snapshot(&storage) != nil { | |
| 25 | - | t.Fatal("security-invalidated cursor captured") | |
| 26 | - | } | |
| 27 | - | } | |
| 28 | - | ||
| 29 | - | func TestCaptureCursorIdleAllocations(t *testing.T) { | |
| 30 | - | c := newCursor(nil, 64) | |
| 31 | - | c.image = true | |
| 32 | - | c.captureImage = domain.CursorImage{W: 1, H: 1, Pixels: []byte{0, 0, 255, 255}} | |
| 33 | - | var storage domain.CaptureCursor | |
| 34 | - | noCursor := []domain.CaptureRequest{{Cursor: false}} | |
| 35 | - | for _, tc := range []struct { | |
| 36 | - | name string | |
| 37 | - | normal, excluded []domain.CaptureRequest | |
| 38 | - | }{ | |
| 39 | - | {name: "idle"}, {name: "cursor-free", normal: noCursor, excluded: noCursor}, | |
| 40 | - | } { | |
| 41 | - | t.Run(tc.name, func(t *testing.T) { | |
| 42 | - | storage.X = -123 | |
| 43 | - | // Holding the motion lock proves that the idle path does not snapshot. | |
| 44 | - | c.mu.Lock() | |
| 45 | - | cycle := func() { | |
| 46 | - | if got := c.captureCursor(&storage, tc.normal, tc.excluded); got != nil { | |
| 47 | - | t.Fatal("unexpected cursor") | |
| 48 | - | } | |
| 49 | - | } | |
| 50 | - | allocs := testing.AllocsPerRun(100, cycle) | |
| 51 | - | c.mu.Unlock() | |
| 52 | - | if allocs != 0 || storage.X != -123 { | |
| 53 | - | t.Fatalf("allocs=%v storage=%+v", allocs, storage) | |
| 54 | - | } | |
| 55 | - | result := testing.Benchmark(func(b *testing.B) { | |
| 56 | - | for b.Loop() { | |
| 57 | - | cycle() | |
| 58 | - | } | |
| 59 | - | }) | |
| 60 | - | t.Logf("%s %s", result.String(), result.MemString()) | |
| 61 | - | }) | |
| 62 | - | } | |
| 63 | - | for _, excluded := range []bool{false, true} { | |
| 64 | - | requests := []domain.CaptureRequest{{Cursor: true}} | |
| 65 | - | var normal, scoped []domain.CaptureRequest | |
| 66 | - | if excluded { | |
| 67 | - | scoped = requests | |
| 68 | - | } else { | |
| 69 | - | normal = requests | |
| 70 | - | } | |
| 71 | - | if got := c.captureCursor(&storage, normal, scoped); got != &storage || got.Image.W != 1 { | |
| 72 | - | t.Fatalf("owner snapshot: %+v", got) | |
| 73 | - | } | |
| 74 | - | } | |
| 75 | - | } | |
| @@ -1,75 +0,0 @@ | |||||
| 1 | - | package drm | |||
| 2 | - | ||||
| 3 | - | import ( | |||
| 4 | - | "github.com/bnema/neferwl/internal/domain" | |||
| 5 | - | "testing" | |||
| 6 | - | ) | |||
| 7 | - | ||||
| 8 | - | func TestCaptureCursorSnapshot(t *testing.T) { | |||
| 9 | - | var storage domain.CaptureCursor | |||
| 10 | - | c := newCursor(nil, 64) | |||
| 11 | - | c.image = true | |||
| 12 | - | c.captureImage = domain.CursorImage{W: 1, H: 1, HotX: 2, Pixels: []byte{1, 2, 3, 255}} | |||
| 13 | - | c.Move(10, 20) | |||
| 14 | - | s := c.snapshot(&storage) | |||
| 15 | - | if s == nil || s.X != 10 || s.Y != 20 || s.Image.HotX != 2 || s.Image.Pixels[2] != 3 { | |||
| 16 | - | t.Fatalf("snapshot: %+v", s) | |||
| 17 | - | } | |||
| 18 | - | c.Hide() | |||
| 19 | - | if c.snapshot(&storage) != nil { | |||
| 20 | - | t.Fatal("away cursor captured") | |||
| 21 | - | } | |||
| 22 | - | c.Move(30, 40) | |||
| 23 | - | c.image = false | |||
| 24 | - | if c.snapshot(&storage) != nil { | |||
| 25 | - | t.Fatal("security-invalidated cursor captured") | |||
| 26 | - | } | |||
| 27 | - | } | |||
| 28 | - | ||||
| 29 | - | func TestCaptureCursorIdleAllocations(t *testing.T) { | |||
| 30 | - | c := newCursor(nil, 64) | |||
| 31 | - | c.image = true | |||
| 32 | - | c.captureImage = domain.CursorImage{W: 1, H: 1, Pixels: []byte{0, 0, 255, 255}} | |||
| 33 | - | var storage domain.CaptureCursor | |||
| 34 | - | noCursor := []domain.CaptureRequest{{Cursor: false}} | |||
| 35 | - | for _, tc := range []struct { | |||
| 36 | - | name string | |||
| 37 | - | normal, excluded []domain.CaptureRequest | |||
| 38 | - | }{ | |||
| 39 | - | {name: "idle"}, {name: "cursor-free", normal: noCursor, excluded: noCursor}, | |||
| 40 | - | } { | |||
| 41 | - | t.Run(tc.name, func(t *testing.T) { | |||
| 42 | - | storage.X = -123 | |||
| 43 | - | // Holding the motion lock proves that the idle path does not snapshot. | |||
| 44 | - | c.mu.Lock() | |||
| 45 | - | cycle := func() { | |||
| 46 | - | if got := c.captureCursor(&storage, tc.normal, tc.excluded); got != nil { | |||
| 47 | - | t.Fatal("unexpected cursor") | |||
| 48 | - | } | |||
| 49 | - | } | |||
| 50 | - | allocs := testing.AllocsPerRun(100, cycle) | |||
| 51 | - | c.mu.Unlock() | |||
| 52 | - | if allocs != 0 || storage.X != -123 { | |||
| 53 | - | t.Fatalf("allocs=%v storage=%+v", allocs, storage) | |||
| 54 | - | } | |||
| 55 | - | result := testing.Benchmark(func(b *testing.B) { | |||
| 56 | - | for b.Loop() { | |||
| 57 | - | cycle() | |||
| 58 | - | } | |||
| 59 | - | }) | |||
| 60 | - | t.Logf("%s %s", result.String(), result.MemString()) | |||
| 61 | - | }) | |||
| 62 | - | } | |||
| 63 | - | for _, excluded := range []bool{false, true} { | |||
| 64 | - | requests := []domain.CaptureRequest{{Cursor: true}} | |||
| 65 | - | var normal, scoped []domain.CaptureRequest | |||
| 66 | - | if excluded { | |||
| 67 | - | scoped = requests | |||
| 68 | - | } else { | |||
| 69 | - | normal = requests | |||
| 70 | - | } | |||
| 71 | - | if got := c.captureCursor(&storage, normal, scoped); got != &storage || got.Image.W != 1 { | |||
| 72 | - | t.Fatalf("owner snapshot: %+v", got) | |||
| 73 | - | } | |||
| 74 | - | } | |||
| 75 | - | } | |||
M internal/adapters/drm/card.go +9 -2
| @@ -350,10 +350,17 @@ func (c *Card) ReadEvents(ctx context.Context) error { | |||
| 350 | 350 | return nil | |
| 351 | 351 | } | |
| 352 | 352 | ||
| 353 | + | func normalizedHDRSettings(settings HDRSettings) HDRSettings { | |
| 354 | + | if settings.SDRBrightness == 0 { | |
| 355 | + | settings.SDRBrightness = domain.DefaultSDRBrightness | |
| 356 | + | } | |
| 357 | + | return settings | |
| 358 | + | } | |
| 359 | + | ||
| 353 | 360 | // outputNeedsRestart applies the same replacement path to mode and HDR | |
| 354 | 361 | // configuration changes; Release drops the old output before reopening it. | |
| 355 | - | func outputNeedsRestart(o *Output, mode modeInfo, settings domain.OutputHDRSettings) bool { | |
| 356 | - | settings = settings.Normalized() | |
| 362 | + | func outputNeedsRestart(o *Output, mode modeInfo, settings HDRSettings) bool { | |
| 363 | + | settings = normalizedHDRSettings(settings) | |
| 357 | 364 | // ExpansionPeakNits affects composition and reported caps, not KMS state. | |
| 358 | 365 | // Its live update is delivered to the owner instead of replacing the output. | |
| 359 | 366 | return o.mode != mode || o.hdr.settings.Enabled != settings.Enabled || o.hdr.settings.SDRBrightness != settings.SDRBrightness | |
| @@ -350,10 +350,17 @@ func (c *Card) ReadEvents(ctx context.Context) error { | |||||
| 350 | return nil | 350 | return nil | ||
| 351 | } | 351 | } | ||
| 352 | 352 | ||||
| 353 | + | func normalizedHDRSettings(settings HDRSettings) HDRSettings { | |||
| 354 | + | if settings.SDRBrightness == 0 { | |||
| 355 | + | settings.SDRBrightness = domain.DefaultSDRBrightness | |||
| 356 | + | } | |||
| 357 | + | return settings | |||
| 358 | + | } | |||
| 359 | + | ||||
| 353 | // outputNeedsRestart applies the same replacement path to mode and HDR | 360 | // outputNeedsRestart applies the same replacement path to mode and HDR | ||
| 354 | // configuration changes; Release drops the old output before reopening it. | 361 | // configuration changes; Release drops the old output before reopening it. | ||
| 355 | - | func outputNeedsRestart(o *Output, mode modeInfo, settings domain.OutputHDRSettings) bool { | 362 | + | func outputNeedsRestart(o *Output, mode modeInfo, settings HDRSettings) bool { |
| 356 | - | settings = settings.Normalized() | 363 | + | settings = normalizedHDRSettings(settings) |
| 357 | // ExpansionPeakNits affects composition and reported caps, not KMS state. | 364 | // ExpansionPeakNits affects composition and reported caps, not KMS state. | ||
| 358 | // Its live update is delivered to the owner instead of replacing the output. | 365 | // Its live update is delivered to the owner instead of replacing the output. | ||
| 359 | return o.mode != mode || o.hdr.settings.Enabled != settings.Enabled || o.hdr.settings.SDRBrightness != settings.SDRBrightness | 366 | return o.mode != mode || o.hdr.settings.Enabled != settings.Enabled || o.hdr.settings.SDRBrightness != settings.SDRBrightness | ||
M internal/adapters/drm/colorop_test.go +5 -5
| @@ -892,7 +892,7 @@ func TestSetupColor(t *testing.T) { | |||
| 892 | 892 | t.Run("HDR makes the matrix blob, the multiplier and the identity 3D LUT", func(t *testing.T) { | |
| 893 | 893 | o, k, _ := colorOutput(t, false, nil) | |
| 894 | 894 | o.ctmBlob, o.lut3dBlob, o.colorMult = 0, 0, 0 | |
| 895 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 160} | |
| 895 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 160} | |
| 896 | 896 | o.hdr.cap.Capable = true | |
| 897 | 897 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, ctmBytes(bt709ToBT2020)) })).Return(uint32(61), nil).Once() | |
| 898 | 898 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, lut3dIdentityBytes(17)) })).Return(uint32(62), nil).Once() | |
| @@ -906,7 +906,7 @@ func TestSetupColor(t *testing.T) { | |||
| 906 | 906 | colorPlane(k, o.primary, pColorPipe, opBase, []opSpec{opSRGB, opMult, opCTM, opPQ}) | |
| 907 | 907 | o.hdr.on = true | |
| 908 | 908 | o.readColor() | |
| 909 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 160} | |
| 909 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 160} | |
| 910 | 910 | o.hdr.cap.Capable = true | |
| 911 | 911 | k.EXPECT().createBlob(mock.Anything).Return(uint32(61), nil).Once() | |
| 912 | 912 | o.setupColor() | |
| @@ -943,7 +943,7 @@ func TestSetupColor(t *testing.T) { | |||
| 943 | 943 | if o.overlay == nil || o.overlay.pipeline == nil || o.primary.pipeline == nil { | |
| 944 | 944 | t.Fatal("pipelines not matched") | |
| 945 | 945 | } | |
| 946 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 203} | |
| 946 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 203} | |
| 947 | 947 | o.hdr.cap.Capable = true | |
| 948 | 948 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, ctmBytes(bt709ToBT2020)) })).Return(uint32(61), nil).Once() | |
| 949 | 949 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, lut3dIdentityBytes(uint32(tc.lut))) })).Return(uint32(62), nil).Once() | |
| @@ -957,7 +957,7 @@ func TestSetupColor(t *testing.T) { | |||
| 957 | 957 | t.Run("3D LUT blob failure turns the pipelines off", func(t *testing.T) { | |
| 958 | 958 | o, k, _ := colorOutput(t, true, nil) | |
| 959 | 959 | o.ctmBlob, o.lut3dBlob = 0, 0 | |
| 960 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 203} | |
| 960 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 203} | |
| 961 | 961 | o.hdr.cap.Capable = true | |
| 962 | 962 | k.EXPECT().createBlob(mock.Anything).Return(uint32(61), nil).Once() | |
| 963 | 963 | k.EXPECT().createBlob(mock.Anything).Return(uint32(0), unix.ENOMEM).Once() | |
| @@ -969,7 +969,7 @@ func TestSetupColor(t *testing.T) { | |||
| 969 | 969 | t.Run("blob failure turns the pipelines off", func(t *testing.T) { | |
| 970 | 970 | o, k, _ := colorOutput(t, true, nil) | |
| 971 | 971 | o.ctmBlob = 0 | |
| 972 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 203} | |
| 972 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 203} | |
| 973 | 973 | o.hdr.cap.Capable = true | |
| 974 | 974 | k.EXPECT().createBlob(mock.Anything).Return(uint32(0), unix.ENOMEM).Once() | |
| 975 | 975 | o.setupColor() | |
| @@ -892,7 +892,7 @@ func TestSetupColor(t *testing.T) { | |||||
| 892 | t.Run("HDR makes the matrix blob, the multiplier and the identity 3D LUT", func(t *testing.T) { | 892 | t.Run("HDR makes the matrix blob, the multiplier and the identity 3D LUT", func(t *testing.T) { | ||
| 893 | o, k, _ := colorOutput(t, false, nil) | 893 | o, k, _ := colorOutput(t, false, nil) | ||
| 894 | o.ctmBlob, o.lut3dBlob, o.colorMult = 0, 0, 0 | 894 | o.ctmBlob, o.lut3dBlob, o.colorMult = 0, 0, 0 | ||
| 895 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 160} | 895 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 160} |
| 896 | o.hdr.cap.Capable = true | 896 | o.hdr.cap.Capable = true | ||
| 897 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, ctmBytes(bt709ToBT2020)) })).Return(uint32(61), nil).Once() | 897 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, ctmBytes(bt709ToBT2020)) })).Return(uint32(61), nil).Once() | ||
| 898 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, lut3dIdentityBytes(17)) })).Return(uint32(62), nil).Once() | 898 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, lut3dIdentityBytes(17)) })).Return(uint32(62), nil).Once() | ||
| @@ -906,7 +906,7 @@ func TestSetupColor(t *testing.T) { | |||||
| 906 | colorPlane(k, o.primary, pColorPipe, opBase, []opSpec{opSRGB, opMult, opCTM, opPQ}) | 906 | colorPlane(k, o.primary, pColorPipe, opBase, []opSpec{opSRGB, opMult, opCTM, opPQ}) | ||
| 907 | o.hdr.on = true | 907 | o.hdr.on = true | ||
| 908 | o.readColor() | 908 | o.readColor() | ||
| 909 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 160} | 909 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 160} |
| 910 | o.hdr.cap.Capable = true | 910 | o.hdr.cap.Capable = true | ||
| 911 | k.EXPECT().createBlob(mock.Anything).Return(uint32(61), nil).Once() | 911 | k.EXPECT().createBlob(mock.Anything).Return(uint32(61), nil).Once() | ||
| 912 | o.setupColor() | 912 | o.setupColor() | ||
| @@ -943,7 +943,7 @@ func TestSetupColor(t *testing.T) { | |||||
| 943 | if o.overlay == nil || o.overlay.pipeline == nil || o.primary.pipeline == nil { | 943 | if o.overlay == nil || o.overlay.pipeline == nil || o.primary.pipeline == nil { | ||
| 944 | t.Fatal("pipelines not matched") | 944 | t.Fatal("pipelines not matched") | ||
| 945 | } | 945 | } | ||
| 946 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 203} | 946 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 203} |
| 947 | o.hdr.cap.Capable = true | 947 | o.hdr.cap.Capable = true | ||
| 948 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, ctmBytes(bt709ToBT2020)) })).Return(uint32(61), nil).Once() | 948 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, ctmBytes(bt709ToBT2020)) })).Return(uint32(61), nil).Once() | ||
| 949 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, lut3dIdentityBytes(uint32(tc.lut))) })).Return(uint32(62), nil).Once() | 949 | k.EXPECT().createBlob(mock.MatchedBy(func(b []byte) bool { return slices.Equal(b, lut3dIdentityBytes(uint32(tc.lut))) })).Return(uint32(62), nil).Once() | ||
| @@ -957,7 +957,7 @@ func TestSetupColor(t *testing.T) { | |||||
| 957 | t.Run("3D LUT blob failure turns the pipelines off", func(t *testing.T) { | 957 | t.Run("3D LUT blob failure turns the pipelines off", func(t *testing.T) { | ||
| 958 | o, k, _ := colorOutput(t, true, nil) | 958 | o, k, _ := colorOutput(t, true, nil) | ||
| 959 | o.ctmBlob, o.lut3dBlob = 0, 0 | 959 | o.ctmBlob, o.lut3dBlob = 0, 0 | ||
| 960 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 203} | 960 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 203} |
| 961 | o.hdr.cap.Capable = true | 961 | o.hdr.cap.Capable = true | ||
| 962 | k.EXPECT().createBlob(mock.Anything).Return(uint32(61), nil).Once() | 962 | k.EXPECT().createBlob(mock.Anything).Return(uint32(61), nil).Once() | ||
| 963 | k.EXPECT().createBlob(mock.Anything).Return(uint32(0), unix.ENOMEM).Once() | 963 | k.EXPECT().createBlob(mock.Anything).Return(uint32(0), unix.ENOMEM).Once() | ||
| @@ -969,7 +969,7 @@ func TestSetupColor(t *testing.T) { | |||||
| 969 | t.Run("blob failure turns the pipelines off", func(t *testing.T) { | 969 | t.Run("blob failure turns the pipelines off", func(t *testing.T) { | ||
| 970 | o, k, _ := colorOutput(t, true, nil) | 970 | o, k, _ := colorOutput(t, true, nil) | ||
| 971 | o.ctmBlob = 0 | 971 | o.ctmBlob = 0 | ||
| 972 | - | o.hdr.settings = domain.OutputHDRSettings{Enabled: true, SDRBrightness: 203} | 972 | + | o.hdr.settings = HDRSettings{Enabled: true, SDRBrightness: 203} |
| 973 | o.hdr.cap.Capable = true | 973 | o.hdr.cap.Capable = true | ||
| 974 | k.EXPECT().createBlob(mock.Anything).Return(uint32(0), unix.ENOMEM).Once() | 974 | k.EXPECT().createBlob(mock.Anything).Return(uint32(0), unix.ENOMEM).Once() | ||
| 975 | o.setupColor() | 975 | o.setupColor() | ||
M internal/adapters/drm/cursor.go +3 -44
| @@ -5,7 +5,6 @@ import ( | |||
| 5 | 5 | "slices" | |
| 6 | 6 | "sync" | |
| 7 | 7 | ||
| 8 | - | "github.com/bnema/neferwl/internal/domain" | |
| 9 | 8 | "github.com/bnema/neferwl/internal/ports" | |
| 10 | 9 | ) | |
| 11 | 10 | ||
| @@ -47,10 +46,9 @@ type Cursor struct { | |||
| 47 | 46 | hotX, hotY int | |
| 48 | 47 | // last is a copy of the loaded image, written again into new images | |
| 49 | 48 | // when the allocator changes. | |
| 50 | - | captureImage domain.CursorImage // owner-only SDR image, independent of KMS allocation | |
| 51 | - | last laterImage | |
| 52 | - | applied cursorState // what the last commit put on the plane | |
| 53 | - | commits int | |
| 49 | + | last laterImage | |
| 50 | + | applied cursorState // what the last commit put on the plane | |
| 51 | + | commits int | |
| 54 | 52 | // screen is the image the plane scans out (0: none); flight is what | |
| 55 | 53 | // the pending commit puts on it when flying. An image is written only | |
| 56 | 54 | // when it is neither, so the plane never shows a half-written image. | |
| @@ -94,19 +92,6 @@ func (c *Cursor) TakeStats() CursorStats { | |||
| 94 | 92 | return s | |
| 95 | 93 | } | |
| 96 | 94 | ||
| 97 | - | // snapshot samples physical hotspot motion under its lock; the SDR image is | |
| 98 | - | // owned by this output goroutine, not by the input goroutine or KMS plane. | |
| 99 | - | func (c *Cursor) snapshot(dst *domain.CaptureCursor) *domain.CaptureCursor { | |
| 100 | - | c.mu.Lock() | |
| 101 | - | x, y, away := c.x, c.y, c.away | |
| 102 | - | c.mu.Unlock() | |
| 103 | - | if away || !c.image || c.captureImage.W == 0 || c.captureImage.H == 0 { | |
| 104 | - | return nil | |
| 105 | - | } | |
| 106 | - | *dst = domain.CaptureCursor{Image: c.captureImage, X: x, Y: y} | |
| 107 | - | return dst | |
| 108 | - | } | |
| 109 | - | ||
| 110 | 95 | // Limit is the largest image side the cursor plane accepts. | |
| 111 | 96 | func (c *Cursor) Limit() int { return c.size } | |
| 112 | 97 | ||
| @@ -196,13 +181,6 @@ func (c *Cursor) useFallback(hdrNits float64) (bool, error) { | |||
| 196 | 181 | // none). | |
| 197 | 182 | // hdrNits is the SDR white of an HDR output (0: SDR). | |
| 198 | 183 | func (c *Cursor) setImage(pixels []byte, w, h, hotX, hotY int, hdrNits float64) error { | |
| 199 | - | c.captureImage = domain.CursorImage{} | |
| 200 | - | if w > 0 && h > 0 && len(pixels) >= w*h*4 { | |
| 201 | - | // Loader images are immutable (also shared by the headless cursor). | |
| 202 | - | // Prefer our replay/queued copy below when one is required for KMS. | |
| 203 | - | // Snapshots are uploaded synchronously before the owner changes images. | |
| 204 | - | c.captureImage = domain.CursorImage{W: w, H: h, HotX: hotX, HotY: hotY, Pixels: pixels[:w*h*4]} | |
| 205 | - | } | |
| 206 | 184 | c.later = nil | |
| 207 | 185 | if w <= 0 || h <= 0 || len(pixels) < w*h*4 { | |
| 208 | 186 | c.image = false | |
| @@ -215,7 +193,6 @@ func (c *Cursor) setImage(pixels []byte, w, h, hotX, hotY int, hdrNits float64) | |||
| 215 | 193 | next := c.freeSlot() | |
| 216 | 194 | if next < 0 { | |
| 217 | 195 | c.later = &laterImage{pixels: slices.Clone(pixels[:w*h*4]), w: w, h: h, hotX: hotX, hotY: hotY} | |
| 218 | - | c.captureImage.Pixels = c.later.pixels | |
| 219 | 196 | return nil | |
| 220 | 197 | } | |
| 221 | 198 | if err := c.imgs.write(next, pixels, w, h, hdrNits); err != nil { | |
| @@ -224,7 +201,6 @@ func (c *Cursor) setImage(pixels []byte, w, h, hotX, hotY int, hdrNits float64) | |||
| 224 | 201 | c.cur, c.image, c.hotX, c.hotY = next, true, hotX, hotY | |
| 225 | 202 | if c.alloc == allocDumb && !c.off { | |
| 226 | 203 | c.last = laterImage{pixels: append(c.last.pixels[:0], pixels[:w*h*4]...), w: w, h: h, hotX: hotX, hotY: hotY} | |
| 227 | - | c.captureImage.Pixels = c.last.pixels | |
| 228 | 204 | } | |
| 229 | 205 | return nil | |
| 230 | 206 | } | |
| @@ -310,23 +286,6 @@ func (c *Cursor) free() { | |||
| 310 | 286 | } | |
| 311 | 287 | c.fbs = [2]uint32{} | |
| 312 | 288 | c.image, c.later = false, nil | |
| 313 | - | c.captureImage = domain.CursorImage{} | |
| 314 | 289 | c.last = laterImage{} | |
| 315 | 290 | c.screen, c.flying = 0, false | |
| 316 | 291 | } | |
| 317 | - | ||
| 318 | - | // captureCursor samples only admitted displayed-frame requests. Hidden children | |
| 319 | - | // have no output cursor. dst belongs to the output owner, not to a frame lease. | |
| 320 | - | func (c *Cursor) captureCursor(dst *domain.CaptureCursor, normal, excluded []domain.CaptureRequest) *domain.CaptureCursor { | |
| 321 | - | if c == nil { | |
| 322 | - | return nil | |
| 323 | - | } | |
| 324 | - | for _, group := range [2][]domain.CaptureRequest{normal, excluded} { | |
| 325 | - | for _, q := range group { | |
| 326 | - | if q.Cursor { | |
| 327 | - | return c.snapshot(dst) | |
| 328 | - | } | |
| 329 | - | } | |
| 330 | - | } | |
| 331 | - | return nil | |
| 332 | - | } | |
| @@ -5,7 +5,6 @@ import ( | |||||
| 5 | "slices" | 5 | "slices" | ||
| 6 | "sync" | 6 | "sync" | ||
| 7 | 7 | ||||
| 8 | - | "github.com/bnema/neferwl/internal/domain" | |||
| 9 | "github.com/bnema/neferwl/internal/ports" | 8 | "github.com/bnema/neferwl/internal/ports" | ||
| 10 | ) | 9 | ) | ||
| 11 | 10 | ||||
| @@ -47,10 +46,9 @@ type Cursor struct { | |||||
| 47 | hotX, hotY int | 46 | hotX, hotY int | ||
| 48 | // last is a copy of the loaded image, written again into new images | 47 | // last is a copy of the loaded image, written again into new images | ||
| 49 | // when the allocator changes. | 48 | // when the allocator changes. | ||
| 50 | - | captureImage domain.CursorImage // owner-only SDR image, independent of KMS allocation | 49 | + | last laterImage |
| 51 | - | last laterImage | 50 | + | applied cursorState // what the last commit put on the plane |
| 52 | - | applied cursorState // what the last commit put on the plane | 51 | + | commits int |
| 53 | - | commits int | |||
| 54 | // screen is the image the plane scans out (0: none); flight is what | 52 | // screen is the image the plane scans out (0: none); flight is what | ||
| 55 | // the pending commit puts on it when flying. An image is written only | 53 | // the pending commit puts on it when flying. An image is written only | ||
| 56 | // when it is neither, so the plane never shows a half-written image. | 54 | // when it is neither, so the plane never shows a half-written image. | ||
| @@ -94,19 +92,6 @@ func (c *Cursor) TakeStats() CursorStats { | |||||
| 94 | return s | 92 | return s | ||
| 95 | } | 93 | } | ||
| 96 | 94 | ||||
| 97 | - | // snapshot samples physical hotspot motion under its lock; the SDR image is | |||
| 98 | - | // owned by this output goroutine, not by the input goroutine or KMS plane. | |||
| 99 | - | func (c *Cursor) snapshot(dst *domain.CaptureCursor) *domain.CaptureCursor { | |||
| 100 | - | c.mu.Lock() | |||
| 101 | - | x, y, away := c.x, c.y, c.away | |||
| 102 | - | c.mu.Unlock() | |||
| 103 | - | if away || !c.image || c.captureImage.W == 0 || c.captureImage.H == 0 { | |||
| 104 | - | return nil | |||
| 105 | - | } | |||
| 106 | - | *dst = domain.CaptureCursor{Image: c.captureImage, X: x, Y: y} | |||
| 107 | - | return dst | |||
| 108 | - | } | |||
| 109 | - | ||||
| 110 | // Limit is the largest image side the cursor plane accepts. | 95 | // Limit is the largest image side the cursor plane accepts. | ||
| 111 | func (c *Cursor) Limit() int { return c.size } | 96 | func (c *Cursor) Limit() int { return c.size } | ||
| 112 | 97 | ||||
| @@ -196,13 +181,6 @@ func (c *Cursor) useFallback(hdrNits float64) (bool, error) { | |||||
| 196 | // none). | 181 | // none). | ||
| 197 | // hdrNits is the SDR white of an HDR output (0: SDR). | 182 | // hdrNits is the SDR white of an HDR output (0: SDR). | ||
| 198 | func (c *Cursor) setImage(pixels []byte, w, h, hotX, hotY int, hdrNits float64) error { | 183 | func (c *Cursor) setImage(pixels []byte, w, h, hotX, hotY int, hdrNits float64) error { | ||
| 199 | - | c.captureImage = domain.CursorImage{} | |||
| 200 | - | if w > 0 && h > 0 && len(pixels) >= w*h*4 { | |||
| 201 | - | // Loader images are immutable (also shared by the headless cursor). | |||
| 202 | - | // Prefer our replay/queued copy below when one is required for KMS. | |||
| 203 | - | // Snapshots are uploaded synchronously before the owner changes images. | |||
| 204 | - | c.captureImage = domain.CursorImage{W: w, H: h, HotX: hotX, HotY: hotY, Pixels: pixels[:w*h*4]} | |||
| 205 | - | } | |||
| 206 | c.later = nil | 184 | c.later = nil | ||
| 207 | if w <= 0 || h <= 0 || len(pixels) < w*h*4 { | 185 | if w <= 0 || h <= 0 || len(pixels) < w*h*4 { | ||
| 208 | c.image = false | 186 | c.image = false | ||
| @@ -215,7 +193,6 @@ func (c *Cursor) setImage(pixels []byte, w, h, hotX, hotY int, hdrNits float64) | |||||
| 215 | next := c.freeSlot() | 193 | next := c.freeSlot() | ||
| 216 | if next < 0 { | 194 | if next < 0 { | ||
| 217 | c.later = &laterImage{pixels: slices.Clone(pixels[:w*h*4]), w: w, h: h, hotX: hotX, hotY: hotY} | 195 | c.later = &laterImage{pixels: slices.Clone(pixels[:w*h*4]), w: w, h: h, hotX: hotX, hotY: hotY} | ||
| 218 | - | c.captureImage.Pixels = c.later.pixels | |||
| 219 | return nil | 196 | return nil | ||
| 220 | } | 197 | } | ||
| 221 | if err := c.imgs.write(next, pixels, w, h, hdrNits); err != nil { | 198 | if err := c.imgs.write(next, pixels, w, h, hdrNits); err != nil { | ||
| @@ -224,7 +201,6 @@ func (c *Cursor) setImage(pixels []byte, w, h, hotX, hotY int, hdrNits float64) | |||||
| 224 | c.cur, c.image, c.hotX, c.hotY = next, true, hotX, hotY | 201 | c.cur, c.image, c.hotX, c.hotY = next, true, hotX, hotY | ||
| 225 | if c.alloc == allocDumb && !c.off { | 202 | if c.alloc == allocDumb && !c.off { | ||
| 226 | c.last = laterImage{pixels: append(c.last.pixels[:0], pixels[:w*h*4]...), w: w, h: h, hotX: hotX, hotY: hotY} | 203 | c.last = laterImage{pixels: append(c.last.pixels[:0], pixels[:w*h*4]...), w: w, h: h, hotX: hotX, hotY: hotY} | ||
| 227 | - | c.captureImage.Pixels = c.last.pixels | |||
| 228 | } | 204 | } | ||
| 229 | return nil | 205 | return nil | ||
| 230 | } | 206 | } | ||
| @@ -310,23 +286,6 @@ func (c *Cursor) free() { | |||||
| 310 | } | 286 | } | ||
| 311 | c.fbs = [2]uint32{} | 287 | c.fbs = [2]uint32{} | ||
| 312 | c.image, c.later = false, nil | 288 | c.image, c.later = false, nil | ||
| 313 | - | c.captureImage = domain.CursorImage{} | |||
| 314 | c.last = laterImage{} | 289 | c.last = laterImage{} | ||
| 315 | c.screen, c.flying = 0, false | 290 | c.screen, c.flying = 0, false | ||
| 316 | } | 291 | } | ||
| 317 | - | ||||
| 318 | - | // captureCursor samples only admitted displayed-frame requests. Hidden children | |||
| 319 | - | // have no output cursor. dst belongs to the output owner, not to a frame lease. | |||
| 320 | - | func (c *Cursor) captureCursor(dst *domain.CaptureCursor, normal, excluded []domain.CaptureRequest) *domain.CaptureCursor { | |||
| 321 | - | if c == nil { | |||
| 322 | - | return nil | |||
| 323 | - | } | |||
| 324 | - | for _, group := range [2][]domain.CaptureRequest{normal, excluded} { | |||
| 325 | - | for _, q := range group { | |||
| 326 | - | if q.Cursor { | |||
| 327 | - | return c.snapshot(dst) | |||
| 328 | - | } | |||
| 329 | - | } | |||
| 330 | - | } | |||
| 331 | - | return nil | |||
| 332 | - | } | |||
M internal/adapters/drm/edid_corpus_test.go +1 -1
| @@ -41,7 +41,7 @@ func TestEDIDCorpus(t *testing.T) { | |||
| 41 | 41 | if tt.file != "" && math.Abs(m.HDR.MaxFrameAverage-tt.average) > 1 { | |
| 42 | 42 | t.Fatalf("frame-average = %g, want %g", m.HDR.MaxFrameAverage, tt.average) | |
| 43 | 43 | } | |
| 44 | - | caps := domain.NewOutputHDRCaps("", domain.OutputHDRSettings{ExpansionPeakNits: 0, SDRBrightness: 203}, detectHDR(m, props).facts(), false).Caps | |
| 44 | + | caps := detectHDR(m, props).caps(0, 203) | |
| 45 | 45 | if caps.Tier != tt.tier || caps.PeakSource != tt.source || math.Abs(caps.PeakNits-tt.peak) > 1 || math.Abs(caps.Headroom-tt.peak/203) > 0.005 || caps.Expandable() != tt.expandable { | |
| 46 | 46 | t.Fatalf("caps = %+v (expandable %t), want tier=%s source=%s peak=%g headroom=%g expandable=%t", caps, caps.Expandable(), tt.tier, tt.source, tt.peak, tt.peak/203, tt.expandable) | |
| 47 | 47 | } | |
| @@ -41,7 +41,7 @@ func TestEDIDCorpus(t *testing.T) { | |||||
| 41 | if tt.file != "" && math.Abs(m.HDR.MaxFrameAverage-tt.average) > 1 { | 41 | if tt.file != "" && math.Abs(m.HDR.MaxFrameAverage-tt.average) > 1 { | ||
| 42 | t.Fatalf("frame-average = %g, want %g", m.HDR.MaxFrameAverage, tt.average) | 42 | t.Fatalf("frame-average = %g, want %g", m.HDR.MaxFrameAverage, tt.average) | ||
| 43 | } | 43 | } | ||
| 44 | - | caps := domain.NewOutputHDRCaps("", domain.OutputHDRSettings{ExpansionPeakNits: 0, SDRBrightness: 203}, detectHDR(m, props).facts(), false).Caps | 44 | + | caps := detectHDR(m, props).caps(0, 203) |
| 45 | if caps.Tier != tt.tier || caps.PeakSource != tt.source || math.Abs(caps.PeakNits-tt.peak) > 1 || math.Abs(caps.Headroom-tt.peak/203) > 0.005 || caps.Expandable() != tt.expandable { | 45 | if caps.Tier != tt.tier || caps.PeakSource != tt.source || math.Abs(caps.PeakNits-tt.peak) > 1 || math.Abs(caps.Headroom-tt.peak/203) > 0.005 || caps.Expandable() != tt.expandable { | ||
| 46 | t.Fatalf("caps = %+v (expandable %t), want tier=%s source=%s peak=%g headroom=%g expandable=%t", caps, caps.Expandable(), tt.tier, tt.source, tt.peak, tt.peak/203, tt.expandable) | 46 | t.Fatalf("caps = %+v (expandable %t), want tier=%s source=%s peak=%g headroom=%g expandable=%t", caps, caps.Expandable(), tt.tier, tt.source, tt.peak, tt.peak/203, tt.expandable) | ||
| 47 | } | 47 | } | ||
M internal/adapters/drm/frame_submit.go +0 -6
| @@ -42,9 +42,6 @@ func (o *Output) submitFrame(ctx context.Context, r ports.Renderer, scene domain | |||
| 42 | 42 | // displayed frame. | |
| 43 | 43 | // A request whose capture indicator the scene does not show yet is held | |
| 44 | 44 | // (the caller keeps it, see capture.Waiting). | |
| 45 | - | if pipeline != nil { | |
| 46 | - | pipeline.Cursor = nil | |
| 47 | - | } | |
| 48 | 45 | ready, _ := pipeline.Hold(scene, requests, time.Now()) | |
| 49 | 46 | if len(scene.CaptureIndicators) > 0 { | |
| 50 | 47 | // The captures of this frame are delivered only once the frame that | |
| @@ -59,9 +56,6 @@ func (o *Output) submitFrame(ctx context.Context, r ports.Renderer, scene domain | |||
| 59 | 56 | }() | |
| 60 | 57 | } | |
| 61 | 58 | normal, excluded, hidden := pipeline.Split(scene, ready) | |
| 62 | - | if pipeline != nil { | |
| 63 | - | pipeline.Cursor = o.cursor.captureCursor(&o.captureCursor, normal, excluded) | |
| 64 | - | } | |
| 65 | 59 | pipeline.Retire(scene) | |
| 66 | 60 | if len(hidden) > 0 { | |
| 67 | 61 | if !o.sceneCurrent(scene) || o.protected { | |
| @@ -42,9 +42,6 @@ func (o *Output) submitFrame(ctx context.Context, r ports.Renderer, scene domain | |||||
| 42 | // displayed frame. | 42 | // displayed frame. | ||
| 43 | // A request whose capture indicator the scene does not show yet is held | 43 | // A request whose capture indicator the scene does not show yet is held | ||
| 44 | // (the caller keeps it, see capture.Waiting). | 44 | // (the caller keeps it, see capture.Waiting). | ||
| 45 | - | if pipeline != nil { | |||
| 46 | - | pipeline.Cursor = nil | |||
| 47 | - | } | |||
| 48 | ready, _ := pipeline.Hold(scene, requests, time.Now()) | 45 | ready, _ := pipeline.Hold(scene, requests, time.Now()) | ||
| 49 | if len(scene.CaptureIndicators) > 0 { | 46 | if len(scene.CaptureIndicators) > 0 { | ||
| 50 | // The captures of this frame are delivered only once the frame that | 47 | // The captures of this frame are delivered only once the frame that | ||
| @@ -59,9 +56,6 @@ func (o *Output) submitFrame(ctx context.Context, r ports.Renderer, scene domain | |||||
| 59 | }() | 56 | }() | ||
| 60 | } | 57 | } | ||
| 61 | normal, excluded, hidden := pipeline.Split(scene, ready) | 58 | normal, excluded, hidden := pipeline.Split(scene, ready) | ||
| 62 | - | if pipeline != nil { | |||
| 63 | - | pipeline.Cursor = o.cursor.captureCursor(&o.captureCursor, normal, excluded) | |||
| 64 | - | } | |||
| 65 | pipeline.Retire(scene) | 59 | pipeline.Retire(scene) | ||
| 66 | if len(hidden) > 0 { | 60 | if len(hidden) > 0 { | ||
| 67 | if !o.sceneCurrent(scene) || o.protected { | 61 | if !o.sceneCurrent(scene) || o.protected { | ||
M internal/adapters/drm/hdr.go +8 -9
| @@ -52,7 +52,7 @@ func maxFrameAverage(h HDRMetadata) float64 { | |||
| 52 | 52 | type hdrState struct { | |
| 53 | 53 | cap hdrCapability | |
| 54 | 54 | props connectorHDRProps | |
| 55 | - | settings domain.OutputHDRSettings | |
| 55 | + | settings HDRSettings | |
| 56 | 56 | // failed disables retries until this Output is replaced; on is the | |
| 57 | 57 | // currently selected signal encoding, including on VT resume. | |
| 58 | 58 | on, failed bool | |
| @@ -147,13 +147,14 @@ func (m *hdrOutputMetadata) bytes() []byte { | |||
| 147 | 147 | return unsafe.Slice((*byte)(unsafe.Pointer(m)), unsafe.Sizeof(*m)) | |
| 148 | 148 | } | |
| 149 | 149 | ||
| 150 | - | // facts converts connector/EDID detection into pure capability facts without | |
| 150 | + | // caps converts connector/EDID detection into pure capability facts without | |
| 151 | 151 | // changing the HDR signaling decision. | |
| 152 | - | func (c hdrCapability) facts() domain.HDRCapsInput { | |
| 153 | - | return domain.HDRCapsInput{ | |
| 152 | + | func (c hdrCapability) caps(peakNits, sdrWhiteNits float64) domain.HDRCaps { | |
| 153 | + | return domain.ResolveHDRCaps(domain.HDRCapsInput{ | |
| 154 | 154 | Capable: c.Capable, Reason: c.Reason, | |
| 155 | - | MaxLuminance: c.MaxLuminance, MaxFrameAverage: c.MaxFrameAverage, MinLuminance: c.MinLuminance, | |
| 156 | - | } | |
| 155 | + | MaxLuminance: c.MaxLuminance, MaxFrameAverage: c.MaxFrameAverage, | |
| 156 | + | MinLuminance: c.MinLuminance, ConfigPeakNits: peakNits, SDRWhiteNits: sdrWhiteNits, | |
| 157 | + | }) | |
| 157 | 158 | } | |
| 158 | 159 | ||
| 159 | 160 | // sendHDRCaps shares the lossless lifecycle stream. Cancellation releases a | |
| @@ -162,7 +163,7 @@ func (o *Output) sendHDRCaps() { | |||
| 162 | 163 | if o.Events == nil { | |
| 163 | 164 | return | |
| 164 | 165 | } | |
| 165 | - | event := domain.NewOutputHDRCaps(o.conn.name, o.hdr.settings, o.hdr.cap.facts(), o.hdr.on && !o.off) | |
| 166 | + | event := domain.OutputHDRCaps{Output: o.conn.name, Caps: o.hdr.cap.caps(o.hdr.settings.ExpansionPeakNits, float64(o.hdr.settings.SDRBrightness)), Active: o.hdr.on && !o.off} | |
| 166 | 167 | ctx := o.eventContext | |
| 167 | 168 | if ctx == nil { | |
| 168 | 169 | ctx = context.Background() | |
| @@ -196,8 +197,6 @@ func (o *Output) updateExpansionPeak(peak float64) { | |||
| 196 | 197 | } | |
| 197 | 198 | ||
| 198 | 199 | // applyExpansionPeak runs on the output owner, alongside lifecycle reporting. | |
| 199 | - | // | |
| 200 | - | //hexcheck:ignore suspicious-business-logic-in-adapter stores the owner-delivered peak and republishes caps; resolution policy is domain.NewOutputHDRCaps | |
| 201 | 200 | func (o *Output) applyExpansionPeak(peak float64) { | |
| 202 | 201 | if peak == o.hdr.settings.ExpansionPeakNits { | |
| 203 | 202 | return | |
| @@ -52,7 +52,7 @@ func maxFrameAverage(h HDRMetadata) float64 { | |||||
| 52 | type hdrState struct { | 52 | type hdrState struct { | ||
| 53 | cap hdrCapability | 53 | cap hdrCapability | ||
| 54 | props connectorHDRProps | 54 | props connectorHDRProps | ||
| 55 | - | settings domain.OutputHDRSettings | 55 | + | settings HDRSettings |
| 56 | // failed disables retries until this Output is replaced; on is the | 56 | // failed disables retries until this Output is replaced; on is the | ||
| 57 | // currently selected signal encoding, including on VT resume. | 57 | // currently selected signal encoding, including on VT resume. | ||
| 58 | on, failed bool | 58 | on, failed bool | ||
| @@ -147,13 +147,14 @@ func (m *hdrOutputMetadata) bytes() []byte { | |||||
| 147 | return unsafe.Slice((*byte)(unsafe.Pointer(m)), unsafe.Sizeof(*m)) | 147 | return unsafe.Slice((*byte)(unsafe.Pointer(m)), unsafe.Sizeof(*m)) | ||
| 148 | } | 148 | } | ||
| 149 | 149 | ||||
| 150 | - | // facts converts connector/EDID detection into pure capability facts without | 150 | + | // caps converts connector/EDID detection into pure capability facts without |
| 151 | // changing the HDR signaling decision. | 151 | // changing the HDR signaling decision. | ||
| 152 | - | func (c hdrCapability) facts() domain.HDRCapsInput { | 152 | + | func (c hdrCapability) caps(peakNits, sdrWhiteNits float64) domain.HDRCaps { |
| 153 | - | return domain.HDRCapsInput{ | 153 | + | return domain.ResolveHDRCaps(domain.HDRCapsInput{ |
| 154 | Capable: c.Capable, Reason: c.Reason, | 154 | Capable: c.Capable, Reason: c.Reason, | ||
| 155 | - | MaxLuminance: c.MaxLuminance, MaxFrameAverage: c.MaxFrameAverage, MinLuminance: c.MinLuminance, | 155 | + | MaxLuminance: c.MaxLuminance, MaxFrameAverage: c.MaxFrameAverage, |
| 156 | - | } | 156 | + | MinLuminance: c.MinLuminance, ConfigPeakNits: peakNits, SDRWhiteNits: sdrWhiteNits, |
| 157 | + | }) | |||
| 157 | } | 158 | } | ||
| 158 | 159 | ||||
| 159 | // sendHDRCaps shares the lossless lifecycle stream. Cancellation releases a | 160 | // sendHDRCaps shares the lossless lifecycle stream. Cancellation releases a | ||
| @@ -162,7 +163,7 @@ func (o *Output) sendHDRCaps() { | |||||
| 162 | if o.Events == nil { | 163 | if o.Events == nil { | ||
| 163 | return | 164 | return | ||
| 164 | } | 165 | } | ||
| 165 | - | event := domain.NewOutputHDRCaps(o.conn.name, o.hdr.settings, o.hdr.cap.facts(), o.hdr.on && !o.off) | 166 | + | event := domain.OutputHDRCaps{Output: o.conn.name, Caps: o.hdr.cap.caps(o.hdr.settings.ExpansionPeakNits, float64(o.hdr.settings.SDRBrightness)), Active: o.hdr.on && !o.off} |
| 166 | ctx := o.eventContext | 167 | ctx := o.eventContext | ||
| 167 | if ctx == nil { | 168 | if ctx == nil { | ||
| 168 | ctx = context.Background() | 169 | ctx = context.Background() | ||
| @@ -196,8 +197,6 @@ func (o *Output) updateExpansionPeak(peak float64) { | |||||
| 196 | } | 197 | } | ||
| 197 | 198 | ||||
| 198 | // applyExpansionPeak runs on the output owner, alongside lifecycle reporting. | 199 | // applyExpansionPeak runs on the output owner, alongside lifecycle reporting. | ||
| 199 | - | // | |||
| 200 | - | //hexcheck:ignore suspicious-business-logic-in-adapter stores the owner-delivered peak and republishes caps; resolution policy is domain.NewOutputHDRCaps | |||
| 201 | func (o *Output) applyExpansionPeak(peak float64) { | 200 | func (o *Output) applyExpansionPeak(peak float64) { | ||
| 202 | if peak == o.hdr.settings.ExpansionPeakNits { | 201 | if peak == o.hdr.settings.ExpansionPeakNits { | ||
| 203 | return | 202 | return | ||
M internal/adapters/drm/hdr_caps_test.go +5 -5
M internal/adapters/drm/hdr_test.go +10 -10
M internal/adapters/drm/kms.go +8 -1
M internal/adapters/drm/output.go +4 -5
M internal/adapters/drm/protection_retry_test.go +1 -1
M internal/adapters/drm/supervisor/drm_test.go +2 -1
M internal/adapters/drm/supervisor/supervisor.go +6 -2
M internal/adapters/headless/cursor.go +0 -28
M internal/adapters/headless/cursor_test.go +0 -73
M internal/adapters/headless/output.go +50 -158
M internal/adapters/headless/output_test.go +2 -2
M internal/adapters/headless/security_test.go +1 -1
M internal/adapters/headlessinput/input.go +2 -18
M internal/adapters/headlessinput/security_test.go +5 -7
M internal/adapters/launcher/session.go +1 -40
M internal/adapters/launcher/session_test.go +1 -33
M internal/adapters/outputkit/capture/capture.go +0 -7
M internal/adapters/outputkit/capture/excluded.go +1 -3
M internal/adapters/outputkit/capture/pipeline.go +10 -156
D internal/adapters/outputkit/capture/pipeline_cursor_test.go +0 -69
D internal/adapters/outputkit/capture/pipeline_dmabuf_test.go +0 -132
D internal/adapters/outputkit/capture/pipeline_pq_test.go +0 -104
M internal/adapters/outputkit/headlessbackend/backend.go +3 -7
M internal/adapters/outputkit/headlessbackend/backend_test.go +0 -27
M internal/adapters/outputkit/virtuals/virtuals.go +12 -29
M internal/adapters/outputkit/virtuals/virtuals_test.go +0 -124
D internal/adapters/peerexe/ancestry.go +0 -84
D internal/adapters/peerexe/ancestry_test.go +0 -85
D internal/adapters/screencast/allocator.go +0 -178
D internal/adapters/screencast/allocator_test.go +0 -176
M internal/adapters/screencast/harness_test.go +2 -20
M internal/adapters/screencast/producer.go +25 -95
D internal/adapters/screencast/producer_hdr_test.go +0 -153
M internal/adapters/screencast/producer_test.go +6 -40
M internal/adapters/screencast/screencast.go +0 -5
M internal/adapters/screencast/seams.go +0 -1
M internal/adapters/screencast/shutdown_test.go +3 -13
M internal/adapters/screencast/stream.go +10 -29
M internal/adapters/screencast/video_source_mock_test.go +0 -57
M internal/adapters/statefile/statefile.go +9 -12
M internal/adapters/statefile/statefile_test.go +0 -46
M internal/adapters/vulkan/capture.go +10 -63
D internal/adapters/vulkan/capture_cursor.go +0 -198
D internal/adapters/vulkan/capture_cursor_test.go +0 -243
D internal/adapters/vulkan/capture_dmabuf.go +0 -382
D internal/adapters/vulkan/capture_dmabuf_test.go +0 -185
D internal/adapters/vulkan/capture_import_test.go +0 -141
D internal/adapters/vulkan/capture_pq.go +0 -136
D internal/adapters/vulkan/capture_pq_test.go +0 -69
D internal/adapters/vulkan/capture_trim_test.go +0 -119
D internal/adapters/vulkan/cast_alloc.go +0 -244
D internal/adapters/vulkan/cast_alloc_test.go +0 -167
D internal/adapters/vulkan/cast_sync_test.go +0 -112
M internal/adapters/vulkan/compose.go +0 -5
M internal/adapters/vulkan/copy.go +22 -38
M internal/adapters/vulkan/dmabuf.go +1 -8
D internal/adapters/vulkan/dmabuf_fences_mock_test.go +0 -258
M internal/adapters/vulkan/frame.go +0 -8
M internal/adapters/vulkan/gpu.go +1 -8
M internal/adapters/vulkan/hdr.go +3 -5
M internal/adapters/vulkan/renderer.go +2 -7
D internal/adapters/vulkan/shaders/capture_cursor.frag +0 -30
D internal/adapters/vulkan/shaders/capture_cursor.frag.spv +0 -0 binary file: no text diff
M internal/adapters/vulkan/trim.go +0 -40
M internal/adapters/wayland/colormanagement_test.go +0 -46
M internal/adapters/wayland/dmabuf.go +0 -1
M internal/adapters/wayland/globals.go +0 -1
M internal/adapters/wayland/outputs.go +0 -3
D internal/adapters/wayland/process.go +0 -37
D internal/adapters/wayland/process_test.go +0 -48
M internal/adapters/wayland/screencast.go +9 -34
M internal/adapters/wayland/screencast_test.go +13 -59
M internal/adapters/wayland/screencopy.go +11 -96
D internal/adapters/wayland/screencopy_dmabuf_test.go +0 -197
M internal/adapters/wayland/seat.go +1 -0
M internal/adapters/wayland/server.go +1 -28
M internal/adapters/wayland/session_lock.go +0 -1
D internal/adapters/wayland/virtualpointer.go +0 -335
D internal/adapters/wayland/virtualpointer_test.go +0 -374
M internal/adapters/wayland/wire_client_test.go +0 -4
M internal/adapters/wayland/x11window.go +5 -20
M internal/adapters/wayland/x11window_test.go +1 -42
M internal/adapters/wayland/xdg.go +1 -5
M internal/adapters/wayland/xwm/events.go +1 -16
M internal/adapters/wayland/xwm/focus.go +2 -7
M internal/adapters/wayland/xwm/host.go +1 -4
M internal/adapters/wayland/xwm/mapflow.go +1 -22
M internal/adapters/wayland/xwm/mapflow_test.go +1 -83
M internal/adapters/wayland/xwm/props.go +5 -5
M internal/adapters/wayland/xwm/streams_test.go +1 -4
M internal/adapters/wayland/xwm/table.go +1 -1
M internal/adapters/wayland/xwm/testdata/streams/property_unchanged.hex +949 -949
M internal/adapters/wayland/xwm/testdata/streams/steady.hex +2000 -2000
M internal/app/app.go +3 -13
M internal/app/gpuopen.go +1 -19
M internal/app/gpuopen_test.go +0 -32
D internal/app/placement_trace_test.go +0 -23
D internal/app/pointer_target_test.go +0 -115
D internal/app/pointercli_test.go +0 -139
D internal/app/screencast_hdr_test.go +0 -150
M internal/app/screencast_test.go +14 -162
D internal/app/server_test.go +0 -106
M internal/app/session.go +30 -46
D internal/app/testdata/x11probe/lineage.go +0 -105
M internal/app/testdata/x11probe/main.go +4 -150
D internal/app/wayvnc_test.go +0 -322
M internal/app/wiring.go +3 -6
D internal/app/xwayland_fullscreen_group_test.go +0 -170
D internal/app/xwayland_keepfocus_test.go +0 -167
D internal/app/xwayland_lineage_test.go +0 -211
M internal/app/xwayland_test.go +3 -80
M internal/cli/cli.go +1 -1
M internal/cli/cli_test.go +0 -32
D internal/cli/pointer.go +0 -195
D internal/cli/pointer_test.go +0 -89
D internal/cli/pointer_wayland.go +0 -233
M internal/cli/run.go +5 -28
D internal/core/ancestry_test.go +0 -143
D internal/core/backendplan.go +0 -70
D internal/core/backendplan_test.go +0 -26
M internal/core/client.go +2 -21
M internal/core/configdiff_test.go +0 -6
M internal/core/configures.go +0 -5
M internal/core/configures_test.go +0 -2
M internal/core/core.go +2 -18
M internal/core/devicefocus_test.go +0 -26
M internal/core/drag.go +2 -2
D internal/core/drag_held_test.go +0 -31
M internal/core/drag_test.go +2 -11
D internal/core/focus_domain_test.go +0 -108
M internal/core/fullscreen_app_test.go +0 -340
D internal/core/fullscreen_slide_test.go +0 -131
M internal/core/gpuplan.go +1 -8
M internal/core/gpuplan_test.go +2 -7
M internal/core/input.go +0 -1
M internal/core/isolation_test.go +0 -17
D internal/core/launcher_return_test.go +0 -116
M internal/core/layout/column_width.go +1 -1
M internal/core/layout/cover.go +5 -22
D internal/core/layout/held_test.go +0 -72
M internal/core/layout/layout_base.go +3 -3
M internal/core/layout/layout_iface.go +0 -2
M internal/core/layout/layout_nav.go +1 -1
M internal/core/layout/layout_reads.go +0 -5
M internal/core/layout/layout_registry.go +0 -5
M internal/core/layout/types.go +0 -3
D internal/core/lineage.go +0 -228
D internal/core/lineage_focus.go +0 -67
D internal/core/lineage_focus_test.go +0 -57
D internal/core/lineage_observer_test.go +0 -62
D internal/core/lineage_test.go +0 -261
M internal/core/monitor.go +0 -9
M internal/core/outputoverrides.go +1 -8
D internal/core/overview_fullscreen_group_test.go +0 -138
D internal/core/placement_trace.go +0 -24
D internal/core/placement_trace_test.go +0 -38
M internal/core/publish_alloc_test.go +0 -15
M internal/core/rules.go +16 -64
M internal/core/rules_match_test.go +4 -4
M internal/core/rules_test.go +22 -169
M internal/core/scene.go +1 -2
M internal/core/screens.go +1 -2
M internal/core/screens_test.go +2 -2
M internal/core/security.go +1 -9
M internal/core/spawn_placement.go +15 -70
D internal/core/stash_capture_lineage_test.go +0 -129
M internal/core/state.go +4 -9
D internal/core/state_cover_test.go +0 -53
M internal/core/state_geometry_test.go +2 -30
M internal/core/transition.go +11 -33
M internal/core/virtual_test.go +0 -1
D internal/core/virtualpointer.go +0 -125
D internal/core/virtualpointer_test.go +0 -143
D internal/core/virtualpointer_unavailable_test.go +0 -109
M internal/core/windows.go +1 -1
M internal/core/workspace/border.go +3 -6
M internal/core/workspace/cover.go +0 -9
M internal/core/workspace/focus.go +0 -4
D internal/core/workspace/fullscreen_group.go +0 -169
D internal/core/workspace/fullscreen_group_test.go +0 -794
M internal/core/workspace/layout.go +7 -19
M internal/core/workspace/maximize.go +1 -14
M internal/core/workspace/new_from_internal_test.go +1 -1
M internal/core/workspace/stash.go +1 -7
M internal/core/workspace/workspace_layout.go +0 -1
M internal/core/workspace/workspace_operations.go +1 -23
M internal/core/workspace/workspace_rules.go +1 -1
M internal/core/workspace/workspace_spawn.go +0 -54
D internal/core/x11active.go +0 -98
D internal/core/x11active_test.go +0 -378
D internal/domain/backend.go +0 -21
D internal/domain/backend_test.go +0 -17
D internal/domain/capture_cursor.go +0 -11
M internal/domain/capture_messages.go +1 -31
D internal/domain/capture_messages_test.go +0 -27
D internal/domain/cast_formats.go +0 -23
D internal/domain/cast_formats_test.go +0 -23
M internal/domain/config.go +2 -7
D internal/domain/hdr_settings.go +0 -33
D internal/domain/hdr_settings_test.go +0 -44
D internal/domain/placement.go +0 -10
D internal/domain/proc.go +0 -20
M internal/domain/screencast_messages.go +8 -10
M internal/domain/state.go +3 -9
M internal/mocks/ports/devices_mock.go +0 -601
M internal/ports/client_commands.go +0 -8
M internal/ports/client_events.go +0 -3
M internal/ports/devices.go +0 -41
M internal/ports/pointer_events.go +0 -19
M packaging/arch/PKGBUILD +0 -1
M packaging/aur/neferwl-git/PKGBUILD +0 -1
D packaging/neferwl-server.service +0 -21
M packaging/neferwl.service +0 -3
M tools/go.mod +1 -1
M tools/go.sum +2 -2
Comments00 unresolved
no comments yet.