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: map windows with correct geometry #176

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

alyssais
Copy link
Contributor

Consider a simple client that doesn't use set_window_geometry, committing after attaching a buffer to a window surface.

Window::geometry falls back to Window::bbox, but when Shell::map_window called Window::geometry, Window::bbox hadn't been set yet, because that only happened later in <State as CompositorHandler>::commit, so the window would be mapped with a size of (0, 0).

This resulted in server-side decorations not being drawn for such clients until they were re-focused or resized.

The fix is to add an extra call to Window::on_commit before mapping it, so that its bbox is set correctly when Shell::map_window asks for its geometry.

Consider a simple client that doesn't use set_window_geometry,
committing after attaching a buffer to a window surface.

Window::geometry falls back to Window::bbox, but when
Shell::map_window called Window::geometry, Window::bbox hadn't been
set yet, because that only happened later in
<State as CompositorHandler>::commit, so the window would be mapped
with a size of (0, 0).

This resulted in server-side decorations not being drawn for such
clients until they were re-focused or resized.

The fix is to add an extra call to Window::on_commit() before mapping
it, so that its bbox is set correctly when Shell::map_window asks for
its geometry.
Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

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

Nice catch! Thanks

@Drakulix Drakulix merged commit ef361ae into pop-os:master_jammy Sep 21, 2023
1 check passed
@alyssais alyssais deleted the geometry branch September 21, 2023 16:25
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.

2 participants