Skip to content

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

Closed

Description

@edenreich

Summary

ScreenControl.Drive (internal/computer/screen_control.go) sets up the display from scratch for every single person input: it runs display.DetectDisplay(), gets a controller, reads the screen dimensions, computes the frame size, performs the input and closes the controller. Typing sends one input per character, so a sentence repeats that work dozens of times, and each input's reply waits on it.

Requested: keep what does not change between inputs for the length of a hold, so an input only pays for itself.

  • Detect the display and get the controller once when the hold starts, and close it on hand-back.
  • Cache the screen and frame dimensions for the hold, refreshed if the screen is resized.

The screenshot capture loop (screenshot_server.go, captureScreenshot) does the same detect-and-open on every capture and reads the screen dimensions twice per capture. It now runs twice a second during a hold, so it is worth the same treatment.

Follow-up of #1787.

Acceptance Criteria

  • A hold detects the display and opens its controller once, not once per input
  • The controller is closed when the screen is handed back
  • A screen resized during a hold is still driven with the right dimensions
  • Behaviour of a person's inputs is unchanged, covered by the existing tests

Activity

  1. added
    refactor
    on Nov 10, 2026
  2. added theissue type on Nov 10, 2026
  3. moved this from Todo to In progress in 2026on Nov 10, 2026
  4. moved this from In progress to QA in 2026on Nov 10, 2026
  5. added a commit that references this issue on Nov 10, 2026
    4f643fb
  6. moved this from QA to Done in 2026on Nov 10, 2026
  7. inference-gateway-releaser commented on Nov 10, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.253.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorreleased

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions