[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: Review Request 129960: Work round missing right click event after dismissing a context menu
From: Emmanuel Pescosta <emmanuelpescosta099 () gmail ! com>
Date: 2017-02-20 16:16:26
Message-ID: 20170220161626.3284.44019 () mimi ! kde ! org
[Download RAW message or body]
--===============1489624587916175437==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129960/#review102563
-----------------------------------------------------------
Ship it!
Ship It!
- Emmanuel Pescosta
On Feb. 20, 2017, 4:59 p.m., David Edmundson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129960/
> -----------------------------------------------------------
>
> (Updated Feb. 20, 2017, 4:59 p.m.)
>
>
> Review request for Dolphin.
>
>
> Repository: dolphin
>
>
> Description
> -------
>
> There is a bug that can happen in the following situation:
> - user right clicks to open a menu
>
> - that context menu grabs input
>
> - the QGrabphicsView also notes the mouse was pressed, but not that the
> mouse was released because it doesn't have mouse events any more
>
> - when a user clicks to dismiss the menu and then without moving clicks
> quickly again to send, we don't get another press event because the
> QGraphicsScene still thinks the mouse is pressed from the first time the
> context menu was shown and
> QGraphicsScenePrivate::lastMouseGrabberItemHasImplicitMouseGrab still
> points to the old object.
>
> This is a known bug in QGraphicsView and you can see
> QGraphicsScenePrivate::sendMouseEvent has a workaround to reset the
> lastMouseGrabberItemHasImplicitMouseGrab on mouse moves, with the
> comment: "This is a temporary fix for until we get proper mouse
> grab events."
>
> Realistically this isn't going to happen in QGraphicsView now.
>
> We do get a double click event though. By checking for double click
> events we can grab those missed clicks. It doesn't cause any other side
> effects because normally the context menu will fire after the first
> click and this rarely gets processed.
>
>
> Diffs
> -----
>
> src/kitemviews/kitemlistcontroller.cpp 1c86ff03ff9b0b12bb0d2927f8e4ed1e0b67b38d
>
> Diff: https://git.reviewboard.kde.org/r/129960/diff/
>
>
> Testing
> -------
>
> Opened dolphin. Right clicked on lots of things quickly. Set my double click \
> interval to 2seconds to make this easier to reproduce. Got context menus all the \
> time.
>
> Thanks,
>
> David Edmundson
>
>
--===============1489624587916175437==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/129960/">https://git.reviewboard.kde.org/r/129960/</a>
</td>
</tr>
</table>
<br />
<p>
Ship it!
</p>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ship It!</pre> <br />
<p>- Emmanuel Pescosta</p>
<br />
<p>On February 20th, 2017, 4:59 p.m. CET, David Edmundson wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for Dolphin.</div>
<div>By David Edmundson.</div>
<p style="color: grey;"><i>Updated Feb. 20, 2017, 4:59 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
dolphin
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">There is a bug that can happen in the following \
situation:
- user right clicks to open a menu</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">- that context menu grabs input</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">- the \
QGrabphicsView also notes the mouse was pressed, but not that the mouse was released \
because it doesn't have mouse events any more</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">- \
when a user clicks to dismiss the menu and then without moving clicks quickly again \
to send, we don't get another press event because the QGraphicsScene still thinks the \
mouse is pressed from the first time the context menu was shown and
QGraphicsScenePrivate::lastMouseGrabberItemHasImplicitMouseGrab still
points to the old object.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">This is a known bug in QGraphicsView and you can see \
QGraphicsScenePrivate::sendMouseEvent has a workaround to reset the \
lastMouseGrabberItemHasImplicitMouseGrab on mouse moves, with the
comment: "This is a temporary fix for until we get proper mouse
grab events."</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Realistically this isn't going to happen in \
QGraphicsView now.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">We do get a double click event though. \
By checking for double click events we can grab those missed clicks. It doesn't cause \
any other side effects because normally the context menu will fire after the first
click and this rarely gets processed.</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Opened dolphin. Right clicked on lots of things \
quickly. Set my double click interval to 2seconds to make this easier to reproduce. \
Got context menus all the time.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/kitemviews/kitemlistcontroller.cpp <span style="color: \
grey">(1c86ff03ff9b0b12bb0d2927f8e4ed1e0b67b38d)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/129960/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============1489624587916175437==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic