-
Notifications
You must be signed in to change notification settings - Fork 343
Crash when menu popup open and cursor gets out quickly #2161
Comments
https://imgur.com/a/UVfMX5t screen setup just before the crash |
Thanks for tracking this down — this is the same bug as swaywm/sway#5294, introduced in swaywm/sway@091f580. It'd probably be worth opening this as a PR. |
Well, I figured out adding that check because on
stated surface = 0x0 so NULL, but the root cause surface is null in this case is unknown to me. I never had been fill a pull request so I'm not sure to propose a PR now. Can you help us with the PR? Thanks for your kind help :) |
There's a bit of a guide over in CONTRIBUTING.md that you can take a look over; it should (hopefully) make things clear. I'm not super familiar with wlroots code so I can't tell you for sure if your fix is correct (whoever reviews the PR can do that :), but conditional on swaywm/sway@091f580 being correct, your fix doesn't look wrong — to me, at least. That commit purposefully sends in a |
Thanks Xyene for your guide, |
Going to close this ticket for now since we already have another open, but thanks for submitting the patch! |
We are not allowed to do what we did in swaywm#5222 and pass a `NULL` surface wlr_seat_pointer_notify_enter(), and it's causing crashes when an xdg-shell popup is active (see swaywm#5294 and swaywm/wlroots#2161). Instead, solve swaywm#5220 using the new wlroots API introduced in swaywm/wlroots#2217.
This is necessary for some grabs, which currently have no way of knowing when the pointer/keyboard focus has left a surface. For example, without this, a drag-and-drop grab can erroneously drop into a window that the cursor is no longer over. This is the plumbing needed to properly fix swaywm/sway#5220. The existing fix, swaywm/sway#5222, relies on every grab's `enter()` hook allowing a `NULL` surface. This is not guaranteed by the API and, in fact, is not the case for the xdg-shell popup grab and results in a crash when the cursor leaves a surface and does not immediately enter another one while a popup is open (#2161). This fix also adds an assertion to wlr_seat_pointer_notify_enter() that ensures it's never called with a `NULL` surface. This will make Sway crash much more until it fixes its usage of the API, so we should land this at the same time as a fix in Sway (which I haven't posted yet).
We are not allowed to do what we did in #5222 and pass a `NULL` surface wlr_seat_pointer_notify_enter(), and it's causing crashes when an xdg-shell popup is active (see #5294 and swaywm/wlroots#2161). Instead, solve #5220 using the new wlroots API introduced in swaywm/wlroots#2217.
I got a consistent crash when open Thunar, open the menu and down some levels and move suddenly the cursor to the rightmost edge of the screen. I got the coredump and also managed to add a simple check on the code.
I changed the line 21 to add a simple check
Original line:
if (wl_resource_get_client(surface->resource) == popup_grab->client) {
Change:
if (surface != NULL && wl_resource_get_client(surface->resource) == popup_grab->client) {
With this change, I can not longer reproduce the crash.
The text was updated successfully, but these errors were encountered: