Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland protocol objects versioning & XDG Shell initial size #2254

Merged
merged 6 commits into from
Sep 19, 2022
Merged

Wayland protocol objects versioning & XDG Shell initial size #2254

merged 6 commits into from
Sep 19, 2022

Conversation

PolyMeilex
Copy link
Contributor

This PR introduces support for running on a wide variety of versions of core protocols.
Druid can now run on both Weston and Mutter.

While at it, I also fixed the initial size of top levels, they are no longer 1px x 1px, they now use the size provided by the user.

Copy link
Contributor

@james-lawrence james-lawrence left a comment

Choose a reason for hiding this comment

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

minor comment otherwise LGTM.

druid-shell/src/backend/wayland/application.rs Outdated Show resolved Hide resolved
// We don't care about obscure pre version 4 compositors
// and just damage the whole surface instead of
// translating from buffer coordinates to surface coordinates
self.wl_surface.borrow().damage(0, 0, i32::MAX, i32::MAX);
Copy link
Collaborator

Choose a reason for hiding this comment

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

druid actually uses the damaged region in order to optimize its own drawing, so I think if you damage the whole surface here then you'll end up with a partially rendered window. Which is probably no big deal if all real compositors support this. But I think it at least deserves a warning...

Copy link
Contributor Author

@PolyMeilex PolyMeilex Sep 18, 2022

Choose a reason for hiding this comment

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

Would self.invalidate() do the job? The same way we do it for force == true a few lines abowe.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, I guess that should take care of telling druid that it needs to draw everything. I'm a little confused about that invalidate() though, because shouldn't we also be calling self.wl_surface.borrow().damage(...) in that branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should be called, as far as I can tell what happens when no damage is sent is not specified in the protocol. So compositor may just do nothing in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jneem
Copy link
Collaborator

jneem commented Sep 18, 2022

Thanks for the PR! It would be great if the wayland backend received consistent love :)

The CI is complaining that you need to run cargo fmt, and besides that I just have one small question...

@jneem jneem merged commit e2ca51d into linebender:master Sep 19, 2022
liias pushed a commit to Browsers-software/druid that referenced this pull request Sep 20, 2022
…der#2254)

* wayland: Fix WlSeat versioning

* wayland: Fix XdgShell versioning

* wayland: Fix XdgToplevel initial size

* wayland: Fix WlCompositor versioning

* wayland: Fix WlOutput versioning

* Address review comments
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.

3 participants