Skip to content

Conversation

@madsmtm
Copy link
Member

@madsmtm madsmtm commented Jan 19, 2026

There is a very natural thing to do if we receive a damage rectangle outside supported bounds: Clamp it to be inside. This is also what's done by Wayland IIUC, and probably on other platforms as well, so let's do it in Softbuffer as well, and avoid the needless error case.

This also allows us to make present forward directly to present_with_damage, which is a nice internal simplification.

Finally, this exposed latent bugs with out-of-bounds damage regions on Windows, Web and X11, I've fixed those as well.

Tested on:

  • Android Doesn't use damage
  • CoreGraphics Doesn't use damage
  • KMS/DRM
  • Orbital Doesn't use damage
  • Wayland
  • Web
  • Win32
  • X11

@madsmtm madsmtm added the enhancement New feature or request label Jan 19, 2026
@madsmtm madsmtm force-pushed the madsmtm/remove-damage-out-of-range branch 2 times, most recently from 551b385 to ab88d81 Compare January 19, 2026 19:27
@MarijnS95
Copy link
Member

This is also what's done by Wayland IIUC

Maybe explicitly linking this portion of the documentation:

The compositor ignores the parts of the damage that fall outside of the surface.

@madsmtm madsmtm force-pushed the madsmtm/remove-damage-out-of-range branch from ab88d81 to 65b9295 Compare January 20, 2026 19:33
@madsmtm madsmtm force-pushed the madsmtm/remove-damage-out-of-range branch from 65b9295 to 55ce8e9 Compare January 20, 2026 19:51
Makes it clearer what we're actually doing with the damage rectangles.
@madsmtm madsmtm force-pushed the madsmtm/remove-damage-out-of-range branch from eb25983 to 2d736ea Compare January 21, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

3 participants