Skip to content

wayland: Simplify geometry updates during interactive resize

Currently, when resizing a window on wayland, the following sequence of actions occurs

  • call handleInteractiveMoveResize(), which will invoke doInteractiveResizeSync()
  • XdgToplevelClient::doInteractiveResizeSync() will schedule a configure event
  • when the configure event is acknowledged, the frame geometry will be updated (and gravitated) and AbstractClient::performInteractiveMoveResize() will be called
  • AbstractClient::performInteractiveMoveResize() will call resize() (again) and emit the clientStepUserMoveResize() signal

that last resize() call is problematic when resizing wayland windows with aspect ratio, e.g. mpv. It may result in an endless feedback loop.

As the first step towards improving resizing of windows with aspect ratio on wayland, this merge request intends to simplify interactive resize logic. That's achieved by

  • dropping the window geometry tip. Reason: allows to decouple the clientStepUserMoveResize() signal from configure events more easily. See the relevant commit for why it was dropped
  • locking the clientStepUserMoveResize() signal to move resize geometry changes. This allows AbstractClient subclasses not to call performInteractiveMoveResize() and thus simplify code a bit. The users of the clientStepUserMoveResize() signal should handle that.

The reason why XdgToplevelClient calls performInteractiveMoveResize() is because ShellClient (predecessor to WaylandClient subclasses) used to not update geometry in true async fashion.

With this merge request, interactive resize will look as follows

  • call handleInteractiveMoveResize(), which will invoke doInteractiveResizeSync() and emit clientStepUserMoveResize() afterwards
  • XdgToplevelClient::doInteractiveResizeSync() will schedule a configure event
  • when the configure event is acknowledged, the frame geometry will be updated (and gravitated)

Besides that, some X11-specific logic has been moved from handleInteractiveMoveResize() to X11Client .

As I said, it's the first step towards fixing resizing of mpv, the next steps would be to augment resize requests with gravity and put the gravity in each configure event.

Merge request reports