<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - SIGSEGV in wl_resource_post_event during wl_argument_from_va_list"
href="https://bugs.freedesktop.org/show_bug.cgi?id=76662#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - SIGSEGV in wl_resource_post_event during wl_argument_from_va_list"
href="https://bugs.freedesktop.org/show_bug.cgi?id=76662">bug 76662</a>
from <span class="vcard"><a class="email" href="mailto:krh@bitplanet.net" title="Kristian Høgsberg <krh@bitplanet.net>"> <span class="fn">Kristian Høgsberg</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=76662#c4">comment #4</a>)
<span class="quote">> It seems the problem is related to the popup grab not ending at the moment
> the button is released after a menu item was clicked. In popup_grab_button()
> there's a statement
>
> if (/* there's focus */) {
> /* send button event */
> } else if (state == WL_POINTER_BUTTON_STATE_RELEASED &&
> (shseat->popup_grab.initial_up ||
> time - shseat->seat->pointer->grab_time > 500)) {
> popup_grab_end(grab->pointer);
> }
>
> If that was just two separate 'if' statements, the grab would end at the
> moment the button is released. I couldn't really figure out why the 'else
> if' is there looking through the git history, but I take there's something
> I'm not seeing.</span >
The first case handles buttons up/down in any of the grab owners surfaces.
This never ends the grab and just sends the event to the client to process.
The else branch deals with button events outside the grab owners windows, which
cancels the grab if it's a release event and we've either
1) seen the release event from the click that triggered the popup, or
2) it's the release event from the initial click and it comes later than
500ms after the click (click-and-drag menu use case)
<span class="quote">> The way it is now, the grab ends only when the destroy animation finishes or
> the user click somewhere else. In the latter case, if the click is in a
> surface that belongs to another client, the click event is swallowed.</span ></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>