PopupApplet and setFocus() behaviour

Dmitry Suzdalev dimsuzkde at gmail.com
Fri Aug 14 12:44:34 CEST 2009


On Friday 14 August 2009 00:32:09 Marco Martin wrote:
> On Thursday 13 August 2009, Dmitry Suzdalev wrote:
> > Hi guys and girls!
> >
> > While making some progress on klipper engine+applet I discovered some
> > oddities with focus behavior. I hope you can give me some hints about my
> > situation (don't get scared by amount of text below, i tried to make it
> > simple to follow).
> 
> in the microblogging plasmoid the focus to the input field seems to be
> correctly given.
> it sets the focus to the input field in the focusIn event of the applet
>  (that always happens after a popup event) would be useful to you?
I just tried that. This works ok when I invoke popup by clicking on the 
applet's icon in a panel - focus is set correctly.

But if I assign a keyboard shortcut for the applet, focus isn't being set to 
my widget in focusInEvent().

On the contrary, if I use my previous method of calling setFocus() in a 
popupEvent(), this works when I trigger a popup by a shortcut, but doesn't 
work when I click on icon in panel :)

Any ideas why is this so?

> i am wondering if a setMainInputWidget() api call could be added to the
> popupapplet api, if it's a common case enough
If this is indeed a common case, that would be nice.

Dmitry.


More information about the Plasma-devel mailing list