The on-screen keyboard's coming and going is rough: the content stays, then jumps, about 110 ms after the resize #1

Open
opened 2026-11-18 05:44:55 +00:00 by jorijnvdgraaf · 0 comments

Each time the on-screen keyboard comes or goes, the app's first frame at the new size reaches the compositor about 110 ms after the window is resized, and for the last 15 to 36 ms of that the old picture is shown squashed or stretched to the new size. Nothing moves with the keyboard: the content stays, then jumps.

Measured on a Fairphone 6 (Plasma Mobile 6.8.2, KWin 6.8.2, plasma-keyboard 6.8.2) with 0.0.0's tree (ca5cd72) under WAYLAND_DEBUG=1: 22 resizes, 11 each way, median 112 ms from the compositor's configure to the first buffer of the new size (88 to 190 ms).

Where the time goes

  • About 85 ms (60 to 155) is Crafter.Graphics rebuilding its swapchain inside its configure listener, before onResize reaches the app. The app's loop handles nothing else in that time. Catcrafts/Crafter.Graphics#199
  • About 27 ms (15 to 36) is from the app's request for a frame to that frame's buffer. resizeSub (interfaces/ImsdMessages.Ui-App.cppm) calls Dirty(), which asks for a frame callback through FrameDriver::RequestRedraw (interfaces/ImsdMessages.Ui-Loop.cppm), and the frame is drawn when the callback comes. The saved trace does not split the wait for the callback from the drawing.
  • That request's commit is also what puts the old picture at the new size: the library has sent the viewport's new destination by then, and the new buffer comes with the frame. The same library issue.
  • On this phone's scale the window is also a pixel larger than the compositor configures it, and twice that night it grew from 392 x 796 to 400 x 800 in eight rebuilds. Catcrafts/Crafter.Graphics#201

What the app can do

  • Take the library's fixes with a pin bump when they are in, and measure again. Most of the wait and the scaled picture are theirs.
  • Move the content with the keyboard: slide the list and the compose bar over the change of height instead of jumping. A Wayland client is not told how far the keyboard's own animation is, so the slide would run beside it with a duration tuned on the phone.
  • Perhaps draw the frame after a resize from the loop at once and not at the next frame callback. It saves at most the callback's wait, and a window that is not on screen must not be drawn that way: its present can wait for the compositor and hold the loop.

Not part of this: the hide key bringing the keyboard straight back, fixed in 0.0.0 (ca5cd72).

Context: asked for after the phone test of 0.0.0, 2026-11-18.

**Each time the on-screen keyboard comes or goes, the app's first frame at the new size reaches the compositor about 110 ms after the window is resized, and for the last 15 to 36 ms of that the old picture is shown squashed or stretched to the new size.** Nothing moves with the keyboard: the content stays, then jumps. Measured on a Fairphone 6 (Plasma Mobile 6.8.2, KWin 6.8.2, plasma-keyboard 6.8.2) with 0.0.0's tree (ca5cd72) under `WAYLAND_DEBUG=1`: 22 resizes, 11 each way, median 112 ms from the compositor's configure to the first buffer of the new size (88 to 190 ms). **Where the time goes** - About 85 ms (60 to 155) is Crafter.Graphics rebuilding its swapchain inside its configure listener, before `onResize` reaches the app. The app's loop handles nothing else in that time. Catcrafts/Crafter.Graphics#199 - About 27 ms (15 to 36) is from the app's request for a frame to that frame's buffer. `resizeSub` (`interfaces/ImsdMessages.Ui-App.cppm`) calls `Dirty()`, which asks for a frame callback through `FrameDriver::RequestRedraw` (`interfaces/ImsdMessages.Ui-Loop.cppm`), and the frame is drawn when the callback comes. The saved trace does not split the wait for the callback from the drawing. - That request's commit is also what puts the old picture at the new size: the library has sent the viewport's new destination by then, and the new buffer comes with the frame. The same library issue. - On this phone's scale the window is also a pixel larger than the compositor configures it, and twice that night it grew from 392 x 796 to 400 x 800 in eight rebuilds. Catcrafts/Crafter.Graphics#201 **What the app can do** - Take the library's fixes with a pin bump when they are in, and measure again. Most of the wait and the scaled picture are theirs. - Move the content with the keyboard: slide the list and the compose bar over the change of height instead of jumping. A Wayland client is not told how far the keyboard's own animation is, so the slide would run beside it with a duration tuned on the phone. - Perhaps draw the frame after a resize from the loop at once and not at the next frame callback. It saves at most the callback's wait, and a window that is not on screen must not be drawn that way: its present can wait for the compositor and hold the loop. **Not part of this**: the hide key bringing the keyboard straight back, fixed in 0.0.0 (ca5cd72). **Context**: asked for after the phone test of 0.0.0, 2026-11-18.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Catcrafts/imsd-messages#1
No description provided.