How to set focus to another application?

shaheed srhaque at iee.org
Sat Sep 27 18:46:11 BST 2003


Hi all,

How does one application cause the input focus to be moved to another 
application? 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).

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





More information about the kde-core-devel mailing list