[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: Re: Review Request: Fix appmenu popup grabbing
From: Thomas_Lübking <thomas.luebking () web ! de>
Date: 2012-11-26 18:11:22
Message-ID: 20121126181122.11599.30532 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107455/
-----------------------------------------------------------
(Updated Nov. 26, 2012, 6:11 p.m.)
Review request for kwin, Cedric Bellegarde and Martin Gräßlin.
Changes
-------
Updated patch, hooking onto paintEvent(), reacting on clicked (queued)
Turned out using the press signal is about as reliable as hooking onto the show event \
- resp. the show event on the Glib dispatcher, since the unix dispatcher of course \
works .... *grrrr*
Acting on click implicitly prevents multiple calls and zombie menus
Description
-------
Basically QMenu::exec() != QMenu::popup()
Since you can probably not use the nested evetloop (?) because of kded and the lack \
of threads thereover, you'll have to fake ::exec in the async function.
1. you cannot attempt to grab the pointer right after the ::popup() call since it's \
async, ie. the menu is not really shown when you call this 2. since you grab the \
mouse on the VerticalMenu, you'll have to now somehow ensure the leaf menu gets it
The present workaround btw. worked no way reliably here, but in maybe 1 of 4 cases.
NOTICE:
---------------
the current behavior exposes another problem when you press the button (this \
"surprsingly" works) and then move the pointer with the pressed button, the menu will \
be spawned again (the input is grabbed but async, so the eventloop receives more show \
calls or whatever) leaving zombie menus behind.
This addresses bug 310476.
http://bugs.kde.org/show_bug.cgi?id=310476
Diffs (updated)
-----
appmenu/verticalmenu.h f7c3b9a
appmenu/verticalmenu.cpp 0afae9e
kwin/libkdecorations/kcommondecoration.cpp 546e93d
kwin/libkdecorations/kdecoration.cpp 7b835c9
Diff: http://git.reviewboard.kde.org/r/107455/diff/
Testing
-------
Thanks,
Thomas Lübking
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/107455/">http://git.reviewboard.kde.org/r/107455/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for kwin, Cedric Bellegarde and Martin Gräßlin.</div>
<div>By Thomas Lübking.</div>
<p style="color: grey;"><i>Updated Nov. 26, 2012, 6:11 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Updated patch, hooking onto paintEvent(), reacting on clicked (queued)
Turned out using the press signal is about as reliable as hooking onto the show event \
- resp. the show event on the Glib dispatcher, since the unix dispatcher of course \
works .... *grrrr*
Acting on click implicitly prevents multiple calls and zombie menus</pre>
</td>
</tr>
</table>
<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;">Basically QMenu::exec() != QMenu::popup() Since you can probably not use \
the nested evetloop (?) because of kded and the lack of threads thereover, you'll \
have to fake ::exec in the async function.
1. you cannot attempt to grab the pointer right after the ::popup() call since \
it's async, ie. the menu is not really shown when you call this 2. since you grab \
the mouse on the VerticalMenu, you'll have to now somehow ensure the leaf menu \
gets it
The present workaround btw. worked no way reliably here, but in maybe 1 of 4 cases.
NOTICE:
---------------
the current behavior exposes another problem when you press the button (this \
"surprsingly" works) and then move the pointer with the pressed button, the \
menu will be spawned again (the input is grabbed but async, so the eventloop receives \
more show calls or whatever) leaving zombie menus behind.</pre> </td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=310476">310476</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> \
(updated)</h1> <ul style="margin-left: 3em; padding-left: 0;">
<li>appmenu/verticalmenu.h <span style="color: grey">(f7c3b9a)</span></li>
<li>appmenu/verticalmenu.cpp <span style="color: grey">(0afae9e)</span></li>
<li>kwin/libkdecorations/kcommondecoration.cpp <span style="color: \
grey">(546e93d)</span></li>
<li>kwin/libkdecorations/kdecoration.cpp <span style="color: \
grey">(7b835c9)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/107455/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic