[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Review Request: Add appmenu support to kwin
From:       Bellegarde_Cédric <gnumdk () gmail ! com>
Date:       2012-08-31 7:41:57
Message-ID: 20120831074157.4257.70085 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Aug. 28, 2012, 10:06 a.m., Bellegarde Cédric wrote:
> > Ok more information about QMenu focus issue...
> > 
> > Kded-appmenu do not have any bug with this, when calling showMenu with qdbus, \
> > it's working... 
> > The bug seems to be in this patch but don't know why... Like if kwin was grabing \
> > mouse+keyboard while a button is pressed, is this true ?
> 
> Thomas Lübking wrote:
> don`t think so, but qabstactbutton likely will - and kcommondecorationbutton is one
> 
> Bellegarde Cédric wrote:
> I've looked at qabstractbutton code and can't find any mouse+keyboard grabing...
> 
> It seems that kwin while buttons clicked do not accept focus change from clients.
> 
> I try to connect appMenuButtonPressed() to released() signal with no luck.
> 
> Showing menu when it become available (so without click) works.
> 
> Help is really welcome.
> 
> Thomas Lübking wrote:
> this is not about focus at all - popups _never_ get the focus but gain it for \
> server exclusive input handling (ie. grabbing input) 
> when attempting the grabfailing input event, check for qDebug() << \
> QWidget::mouseGrabber() to see what currently has the mouse. If there's none, kwin \
> is not the issue (and pot. not even input grabbing) 
> Bellegarde Cédric wrote:
> Ok, it seems that QMenu only grabs input on fist show() but fails on laters...
> 
> This python code show issue. First time menu is shown, input is grabbed, second \
> time it fails... 
> Is this a Qt Bug or am i missing something ?
> 
> #!/usr/bin/python2
> # -*- coding: utf-8 -*-
> import sys
> from PyQt4.QtGui import QApplication, QErrorMessage
> from PyQt4.QtCore import *
> from PyQt4.QtGui import *
> import thread
> import time
> 
> if __name__ == '__main__':
> app = QApplication(sys.argv)
> menu = QMenu()
> menu.addAction("plop")
> menu.addAction("plop")
> menu.addAction("plop")
> menu.addAction("plop")
> menu.popup(QPoint(100,100))
> time.sleep(5)
> menu.hide()
> time.sleep(5)
> menu.popup(QPoint(100,100))
> res = app.exec_()
> sys.exit(res)
> 

Forget my last comment, it's not the real issue... 

Let's look at this code:
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import sys
from PyQt4.QtGui import QApplication, QErrorMessage
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import thread
import time

def hide():
    print "HIDE"
    sys.exit()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    menu = QMenu()
    menu.addAction("plop")
    menu.addAction("plop")
    menu.addAction("plop")
    menu.addAction("plop")
    menu.popup(QPoint(100,100))
    menu.aboutToHide.connect(hide)
    res = app.exec_()
    sys.exit(res)

If you run:
$ sleep 2 && python2 test.py

and click anywhere on any application, menu popup will not get keyboard/mouse \
"focus"... It's the issue i have in kded-module.

Klipper while calling popup menu with global shortcut do not have this issue and i \
can't understand why when looking at source code.


- Bellegarde


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104344/#review18156
-----------------------------------------------------------


On Aug. 27, 2012, 2:02 p.m., Bellegarde Cédric wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104344/
> -----------------------------------------------------------
> 
> (Updated Aug. 27, 2012, 2:02 p.m.)
> 
> 
> Review request for kwin.
> 
> 
> Description
> -------
> 
> Here a patch to add appmenu support to kwin via a menu button in titlebar
> 
> Works by Lionel Chauvin and me, original review request: \
> https://git.reviewboard.kde.org/r/101162/ 
> It depends on:
> http://quickgit.kde.org/index.php?p=kded-appmenu.git
> 
> It looks like this:
> https://www.youtube.com/watch?v=x1bm7Q6_SH4&hd=1
> 
> New version, all drawing code moved to kded-appmenu as asked.
> 
> 
> Diffs
> -----
> 
> kcontrol/style/finetuning.ui 2d384bc 
> kcontrol/style/kcmstyle.h cd1472f 
> kcontrol/style/kcmstyle.cpp 849a49b 
> kwin/CMakeLists.txt ce69e84 
> kwin/client.h f31707b 
> kwin/client.cpp c541595 
> kwin/clients/oxygen/oxygenbutton.h ea11717 
> kwin/clients/oxygen/oxygenbutton.cpp 28aa8b1 
> kwin/clients/oxygen/oxygenclient.h 98e60cc 
> kwin/clients/oxygen/oxygenclient.cpp 5fbb4fb 
> kwin/clients/oxygen/oxygenfactory.h b38b097 
> kwin/clients/oxygen/oxygenfactory.cpp 5502a6a 
> kwin/config-kwin.h.cmake e5ed2a6 
> kwin/kcmkwin/kwindecoration/buttons.cpp 2d12244 
> kwin/libkdecorations/kcommondecoration.h 3fe9fcf 
> kwin/libkdecorations/kcommondecoration.cpp 13a4c49 
> kwin/libkdecorations/kdecoration.h 614b902 
> kwin/libkdecorations/kdecoration.cpp 71f4f8d 
> kwin/workspace.h 16630f7 
> kwin/workspace.cpp cf3f308 
> 
> Diff: http://git.reviewboard.kde.org/r/104344/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Bellegarde Cédric
> 
> 


[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/104344/">http://git.reviewboard.kde.org/r/104344/</a>
  </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On August 28th, 2012, 10:06 a.m., <b>Bellegarde \
Cédric</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Ok more information about QMenu focus issue...

Kded-appmenu do not have any bug with this, when calling showMenu with qdbus, \
it&#39;s working...

The bug seems to be in this patch but don&#39;t know why... Like if kwin was grabing \
mouse+keyboard while a button is pressed, is this true ?</pre>  </blockquote>




 <p>On August 28th, 2012, 10:21 a.m., <b>Thomas Lübking</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">don`t think so, but \
qabstactbutton likely will - and kcommondecorationbutton is one</pre>  </blockquote>





 <p>On August 28th, 2012, 1:51 p.m., <b>Bellegarde Cédric</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;ve looked at \
qabstractbutton code and can&#39;t find any mouse+keyboard grabing...

It seems that kwin while buttons clicked do not accept focus change from clients.

I try to connect appMenuButtonPressed() to released() signal with no luck.

Showing menu when it become available (so without click) works.

Help is really welcome.</pre>
 </blockquote>





 <p>On August 28th, 2012, 4:48 p.m., <b>Thomas Lübking</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this is not about focus \
at all - popups _never_ get the focus but gain it for server exclusive input handling \
(ie. grabbing input)

when attempting the grabfailing input event, check for qDebug() &lt;&lt; \
QWidget::mouseGrabber() to see what currently has the mouse. If there&#39;s none, \
kwin is not the issue (and pot. not even input grabbing)</pre>  </blockquote>





 <p>On August 30th, 2012, 8:29 a.m., <b>Bellegarde Cédric</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ok, it seems that QMenu \
only grabs input on fist show() but fails on laters...

This python code show issue. First time menu is shown, input is grabbed, second time \
it fails...

Is this a Qt Bug or am i missing something ?

#!/usr/bin/python2
# -*- coding: utf-8 -*-
import sys
from PyQt4.QtGui import QApplication, QErrorMessage
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import thread
import time

if __name__ == &#39;__main__&#39;:
    app = QApplication(sys.argv)
    menu = QMenu()
    menu.addAction(&quot;plop&quot;)
    menu.addAction(&quot;plop&quot;)
    menu.addAction(&quot;plop&quot;)
    menu.addAction(&quot;plop&quot;)
    menu.popup(QPoint(100,100))
    time.sleep(5)
    menu.hide()
    time.sleep(5)
    menu.popup(QPoint(100,100))
    res = app.exec_()
    sys.exit(res)
</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Forget my last comment, \
it&#39;s not the real issue... 

Let&#39;s look at this code:
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import sys
from PyQt4.QtGui import QApplication, QErrorMessage
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import thread
import time

def hide():
    print &quot;HIDE&quot;
    sys.exit()

if __name__ == &#39;__main__&#39;:
    app = QApplication(sys.argv)
    menu = QMenu()
    menu.addAction(&quot;plop&quot;)
    menu.addAction(&quot;plop&quot;)
    menu.addAction(&quot;plop&quot;)
    menu.addAction(&quot;plop&quot;)
    menu.popup(QPoint(100,100))
    menu.aboutToHide.connect(hide)
    res = app.exec_()
    sys.exit(res)

If you run:
$ sleep 2 &amp;&amp; python2 test.py

and click anywhere on any application, menu popup will not get keyboard/mouse \
&quot;focus&quot;... It&#39;s the issue i have in kded-module.

Klipper while calling popup menu with global shortcut do not have this issue and i \
can&#39;t understand why when looking at source code.</pre> <br />








<p>- Bellegarde</p>


<br />
<p>On August 27th, 2012, 2:02 p.m., Bellegarde Cédric wrote:</p>






<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.</div>
<div>By Bellegarde Cédric.</div>


<p style="color: grey;"><i>Updated Aug. 27, 2012, 2:02 p.m.</i></p>






<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;">Here a patch to add appmenu support to kwin via a menu button in \
titlebar

Works by Lionel Chauvin and me, original review request: \
https://git.reviewboard.kde.org/r/101162/

It depends on:
http://quickgit.kde.org/index.php?p=kded-appmenu.git

It looks like this:
https://www.youtube.com/watch?v=x1bm7Q6_SH4&amp;hd=1

New version, all drawing code moved to kded-appmenu as asked.</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>kcontrol/style/finetuning.ui <span style="color: grey">(2d384bc)</span></li>

 <li>kcontrol/style/kcmstyle.h <span style="color: grey">(cd1472f)</span></li>

 <li>kcontrol/style/kcmstyle.cpp <span style="color: grey">(849a49b)</span></li>

 <li>kwin/CMakeLists.txt <span style="color: grey">(ce69e84)</span></li>

 <li>kwin/client.h <span style="color: grey">(f31707b)</span></li>

 <li>kwin/client.cpp <span style="color: grey">(c541595)</span></li>

 <li>kwin/clients/oxygen/oxygenbutton.h <span style="color: \
grey">(ea11717)</span></li>

 <li>kwin/clients/oxygen/oxygenbutton.cpp <span style="color: \
grey">(28aa8b1)</span></li>

 <li>kwin/clients/oxygen/oxygenclient.h <span style="color: \
grey">(98e60cc)</span></li>

 <li>kwin/clients/oxygen/oxygenclient.cpp <span style="color: \
grey">(5fbb4fb)</span></li>

 <li>kwin/clients/oxygen/oxygenfactory.h <span style="color: \
grey">(b38b097)</span></li>

 <li>kwin/clients/oxygen/oxygenfactory.cpp <span style="color: \
grey">(5502a6a)</span></li>

 <li>kwin/config-kwin.h.cmake <span style="color: grey">(e5ed2a6)</span></li>

 <li>kwin/kcmkwin/kwindecoration/buttons.cpp <span style="color: \
grey">(2d12244)</span></li>

 <li>kwin/libkdecorations/kcommondecoration.h <span style="color: \
grey">(3fe9fcf)</span></li>

 <li>kwin/libkdecorations/kcommondecoration.cpp <span style="color: \
grey">(13a4c49)</span></li>

 <li>kwin/libkdecorations/kdecoration.h <span style="color: \
grey">(614b902)</span></li>

 <li>kwin/libkdecorations/kdecoration.cpp <span style="color: \
grey">(71f4f8d)</span></li>

 <li>kwin/workspace.h <span style="color: grey">(16630f7)</span></li>

 <li>kwin/workspace.cpp <span style="color: grey">(cf3f308)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/104344/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