Skip to content

Conversation

jserv
Copy link
Contributor

@jserv jserv commented Oct 19, 2025

This commit adds first-run damage marking to ensure screen content is rendered on startup instead of remaining blank until user interaction. For mouse coordinate scaling, this scales EV_ABS coordinates from the device range (0-32767) to actual screen resolution for correct cursor positioning in touchscreen environments.

Close #62


Summary by cubic

Fix blank initial screen by marking full-screen damage on first run, and scale EV_ABS touch/mouse coordinates to the display resolution for accurate cursor placement.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 2 files

Prompt for AI agents (all 3 issues)

Understand the root cause of the following 3 issues and fix them.


<file name="backend/linux_input.c">

<violation number="1" location="backend/linux_input.c:88">
This hard-codes the absolute-axis range to 32767, so devices with different ABS_X maxima end up with wildly mis-scaled coordinates (e.g., 0–4095 devices only move the cursor across ~12% of the screen). Please scale using the device’s actual ABS info instead of a fixed constant.</violation>

<violation number="2" location="backend/linux_input.c:96">
Scaling ABS_Y by a hard-coded 32767 fails on devices whose reported ABS_Y range is smaller or larger, causing the cursor to stick to the top/bottom of the screen. Please derive the scale factor from the device’s actual ABS info.</violation>
</file>

<file name="backend/fbdev.c">

<violation number="1" location="backend/fbdev.c:208">
Using a static first_run flag here makes the initial damage run only once per process; if the fbdev backend is torn down and reinitialized, the new screen never gets its startup damage and renders blank until user input. Please store this flag in the per-context state instead of a function-static boolean.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

This replaces hard-coded 32767 with device-specific absolute axis ranges
queried via EVIOCGABS ioctl. This fixes coordinate scaling for devices
with different ABS_X/ABS_Y maxima.

It moves first_run flag to twin_fbdev_t structure to support proper
reinitialization when backend is torn down and recreated, preventing
blank screens on subsequent initializations.

Close #62
@huaxinliao
Copy link
Collaborator

Next weekend, I will verify the latest patch on the Raspberry Pi to ensure that its behavior meets expectations.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix mismatch screen width and height and buffer synchronization when using Linux framebuffer backend

2 participants