Skip to content

refactor(computer): keep the display open for the length of a hold - #1796

Merged
edenreich merged 4 commits into
mainfrom
refactor/hold-display-controller
Nov 10, 2026
Merged

edenreich merged 4 commits into
mainfrom
refactor/hold-display-controller

Conversation

@edenreich

@edenreich edenreich commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ScreenControl.Drive set the display up from scratch for every person input: detect the display, open a controller, read the screen size, act, close. Typing sends one input per character, so a sentence repeated that dozens of times. A hold now opens its display once and reuses it.

Resolves #1793

Changes

  • internal/computer/held_display.go - heldDisplay, the display a person drives during one hold. It opens on the first input, serves the inputs that follow one at a time, and closes at the hand-back.
  • internal/computer/screen_control.go - Drive runs its input through the held display, TakeOver begins the hold and HandBack ends it. A button still pressed at the hand-back is released on the display that is already open.

Behaviour notes:

  • Taking over does not open the display, so a person can claim a screen whose display is briefly away.
  • The open display is reused for two seconds, then reopened on the next input, which reads the screen size again. A screen resized mid-hold is driven at its new size within that window.
  • An input that arrives after the hand-back is refused without opening a display.

On GNOME Wayland opening a controller costs two round trips to the shell for the screen size, which is what each reused input now skips. The gain is not measured.

Testing

  • task precommit:run and task test pass. New tests cover one display across several inputs, the reopen once it is stale, the close at the hand-back, releasing a held button on the open display, and the refusal after a hand-back.
  • Not verified on a real computer.

Not included

The screenshot capture loop does the same setup for every capture. It is named in the issue but is not part of its acceptance criteria, and is left as it is.

no docs ticket: internal-only refactor

A person who holds the screen can press a pointer button, move and let go, which drags. A button still down when the screen is handed back is released.

Resolves #1792
A hold opens its display on the first input and reuses it for the inputs that follow, instead of detecting the display and reading the screen size for every one. It closes at the hand-back and reopens once it is two seconds old, so a resized screen is driven at its new size.

Resolves #1793
A hold opens its display on the first input and reuses it for the inputs that follow, instead of detecting the display and reading the screen size for every one. It closes at the hand-back and reopens once it is two seconds old, so a resized screen is driven at its new size.

Resolves #1793
@edenreich
edenreich marked this pull request as ready for review November 10, 2026 00:38
@edenreich
edenreich requested a review from a team as a code owner November 10, 2026 00:38
@edenreich
edenreich merged commit 5589a74 into main Nov 10, 2026
1 check passed
@edenreich
edenreich deleted the refactor/hold-display-controller branch November 10, 2026 00:39
@edenreich edenreich moved this from Todo to Done in 2026 Nov 10, 2026
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.253.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[TASK] Refactor keep the display controller open for the length of a hold

1 participant