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

List:       kde-core-devel
Subject:    KAcceleratorManager does not automanage some popups
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2007-07-13 17:43:15
Message-ID: 200707131943.15998.aacid () kde ! org
[Download RAW message or body]

It is failing both in 3.5 and 4.0 branch on RMB popup menu of kpdf/okular 
(possibly on other places too)

The attached patch fixes the problem for me, but i have to admit i don't have 
much Accelerator-foo so reviews are VERY welcome.

Any objections in committing it to both 3.5 and 4.0 branch?

Albert

["40.patch" (text/x-diff)]

Index: shortcuts/kacceleratormanager.cpp
===================================================================
--- shortcuts/kacceleratormanager.cpp	(revision 686582)
+++ shortcuts/kacceleratormanager.cpp	(working copy)
@@ -268,7 +268,7 @@
     // Ignore unless we have the direct parent
     if(qobject_cast<QWidget *>(w->parent()) != widget) continue;
 
-    if ( !w->isVisibleTo( widget ) || w->isTopLevel() )
+    if ( !w->isVisibleTo( widget ) || (w->isTopLevel() && dynamic_cast<QMenu*>(w) == \
NULL) )  continue;
 
     if ( KAcceleratorManagerPrivate::ignored_widgets.find( w ) != \
KAcceleratorManagerPrivate::ignored_widgets.end() )


["35.patch" (text/x-diff)]

Index: kaccelmanager.cpp
===================================================================
--- kaccelmanager.cpp	(revision 687464)
+++ kaccelmanager.cpp	(working copy)
@@ -267,7 +267,7 @@
   {
     QWidget *w = static_cast<QWidget*>(it);
 
-    if ( !w->isVisibleTo( widget ) || w->isTopLevel() )
+    if ( !w->isVisibleTo( widget ) || (w->isTopLevel() && \
dynamic_cast<QPopupMenu*>(w) == NULL) )  continue;
 
     if ( KAcceleratorManagerPrivate::ignored_widgets.find( w ) != \
KAcceleratorManagerPrivate::ignored_widgets.end() )



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

Configure | About | News | Add a list | Sponsored by KoreLogic