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

Handle destroyed subsurfaces #3199

Merged
merged 2 commits into from
Nov 28, 2018

Conversation

emersion
Copy link
Member

Damage subsurfaces when they are destroyed. Since subsurfaces don't have an
unmap event we need to do that on destroy.

We also don't want to keep a sway_view_child when the wlr_subsurface has been
destroyed.

Fixes #3197

@ghost
Copy link

ghost commented Nov 26, 2018

Works fine.

Copy link
Contributor

@J0nnyMak0 J0nnyMak0 left a comment

Choose a reason for hiding this comment

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

This is looking good. Problem with menus is fixed. thanks.

if (child->view->container != NULL) {
view_child_damage(child, true);
}
view_child_destroy(child);
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this mean we call view_child_destroy twice now? view_child_init already sets up a listener on the surface's destroy event and calls it from the destroy handler.

Copy link
Member Author

Choose a reason for hiding this comment

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

We have two objects: the wl_surface itself and the wl_subsurface. This listener is listening on the subsurface destroy event.

Destructors remove all listeners, so we should be fine if one is called before the other.

sway/tree/view.c Outdated Show resolved Hide resolved
Damage subsurfaces when they are destroyed. Since subsurfaces don't have an
unmap event we need to do that on destroy.

We also don't want to keep a sway_view_child when the wlr_subsurface has been
destroyed.

Fixes swaywm#3197
@jnpkrn
Copy link
Contributor

jnpkrn commented Nov 28, 2018

Works, thanks.

@RyanDwyer RyanDwyer merged commit f737854 into swaywm:master Nov 28, 2018
@RyanDwyer
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants