[Eric] Hack for metacity / autocomplete focus bug

Phil Thompson phil at riverbankcomputing.com
Tue May 5 09:23:13 BST 2009


On Tue, 05 May 2009 10:13:37 +0200, cadevel <cadevel at free.fr> wrote:
> Hello ,
> i've written a small hack to correct the focus problem with autocomplete 
> and metacity (Gnome window manager)
> 
> just add this method in class QsciScintillaCompat ()
> 
>     def keyPressEvent(self, evt) :
>         wa = self.isListActive()
>         QsciScintilla.keyPressEvent(self, evt)
>         if not wa and self.isListActive() :
>             for i in self.children() :
>                 if isinstance(i, QListWidget) :
>                     i.setWindowFlags(Qt.ToolTip |Qt.WindowStaysOnTopHint)
>                     i.show()
> 
> 
> 
> and change
> 
> from PyQt4.QtGui import QApplication, QPalette
> 
> to
> 
> from PyQt4.QtGui import QApplication, QPalette,QListWidget
> 
> 
> 
> 
> Warning:
> this works for me
> but I didn't try it elsewhere
> 
> A better solution can be to change the window flags of this QListWidget 
> in QScintilla

If people can confirm that this doesn't cause a problem on non-Gnome X11
systems then I'll make the change.

Phil


More information about the Eric mailing list