Re: How to get the topmost window through xlib programming

Karthik Ramamoorthy <[email protected]>
Newsgroups gmane.comp.xfree86.devel
Message-ID <[email protected]>
On 11/22/05, Tim Roberts <[email protected]> wrote:
>
>
>
>
> XGetInputFocus will tell you the window that currently holds the
> keyboard focus.  That is usually what you what when you ask for the
> "topmost window".


 XGetInputFocus is returning the WindowID of the topmost window with an a
appended to it ie if window id is 0x1000e the it prints 0x1000ea when we do
the printf of the id that we get from the XGetInputFocus function . Is there
any mistake at my part or something else has to be done.

Code is as follows.

{
Window focusWin = 0;
int reverToReturn = 0;
Display *disp  =  XOpenDisplay(NULL);
assert(disp);
XGetInputFocus(disp, &focusWin, &reverToReturn);
printf("Win is %x\n",focusWin);

}

Regards
Karthik


--
> Tim Roberts, [email protected]
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> Devel mailing list
> [email protected]
> http://XFree86.Org/mailman/listinfo/devel
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.