-
Notifications
You must be signed in to change notification settings - Fork 343
xdg-surface: handle inert toplevels and popups in when committing #2454
Conversation
Just tested this (this branch applied on top of latest wlroots master + wayfire master). The crash after dismissing the dialog is gone, but there is a new crash when closing a toplevel that used to have a dialog. This happens in my simplified example: https://github.com/dkondor/wlroots/blob/issue-2432/issue-2432/wlr-crasher-2.c To reproduce, close the blue dialog either by clicking on it or by activating another app. After that, when the main toplevel is closed (clicking on it or even Ctrl-C from terminal), wayfire crashes. I cannot test my original issues with cairo-dock, since trying to start it already crashes wayfire with this patch. |
Stackrace:
|
@dkondor I think I saw the problem, |
Yes, it's working now; also, my original issue with cairo-dock is resolved as well. Thanks! |
Should it send a protocol error, too? See: #2057 |
No, it shouldn't. This is simply a race condition which neither wlroots nor the client can prevent, and necessitates an inert state of objects on the wlroots side. @travankor does this also fix your issue with chromium on Wayland? |
I can't test that anymore since the bug only worked on v80 and previous releases. And I cleaned my package cache in September, unfortunately, because of disk space running out. |
I did not know that you can destroy and re-create the xdg_toplevel without doing the same for xdg_surface. Unfortunately, this means we just need to remove one of the errors for clients, let me know if you find this acceptable. |
Can we add an explanation of why this is necessary to the commit message? Otherwise I won't remember. Something among those lines:
|
I updated the patch as you suggested. Thanks for the in-depth review, I know so little about the xdg-shell implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the in-depth review, I know so little about the xdg-shell implementation.
No problem, the xdg-shell implementation isn't the most straightforward part of wlroots sadly.
xdg_popups can be destroyed by the compositor when closed. When this happens, wlroots makes the xdg_popup surface inert and resets the xdg_surface role to NONE. Currently, wlroots sends a protocol error and asserts that an xdg_surface has a role when committed. This is racy if at the same time the client commits an xdg_popup and the compositor closes it. This patch removes the assertion and ignores commits on xdg_surfaces without a role set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to push?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
This is an attempt toFixes #2432@dkondor please test