How to set focus to another application?

Lubos Lunak l.lunak at suse.cz
Mon Sep 29 13:06:00 BST 2003


On Saturday 27 of September 2003 19:46, shaheed wrote:
> Hi all,
>
> How does one application cause the input focus to be moved to another
> application?

 In the common case, one application causes the input focus to be moved to 
another application by doing nothing, as it's usually the user who decides 
which application will be active.

 So, if this is the common case, you already know the answer. If it's not, 
then please describe it, as there may be different solutions depending on 
what exactly you want to do.

> I have tried:
>
>     XWarpPointer (dpy, None, window, 0, 0, 0, 0, x, y);
>     XSetInputFocus(dpy, window, RevertToPointerRoot, CurrentTime);
>
> where "window" is the window of the other application (as reported by a
> "event.xbutton.subwindow" returned from XWindowEvent()).
>
> This correctly causes the current aplication to loose focus int that the
> title bar changes from blue to grey, but the other application's title bar
> satys grey (and it ignores key presses).

 This seems to be a bug in focus stealing prevention, actually.

>
> What am I doing wrong? From soem googling, I assume it is something to do
> with the interaction between KDE and X, but I am waaay out of my depth
> here. Any clues appreciated.
>
> Thanks, Shaheed

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/





More information about the kde-core-devel mailing list