XGetInputFocus() does not work for GTK based applications
- From: Kala B <kalabalun yahoo co in>
- To: gtk-list gnome org, gtk-app-devel-list gnome org
- Cc: 
- Subject: XGetInputFocus() does not work for GTK based applications
- Date: Tue, 27 Jul 2004 10:43:32 +0100 (BST)
Hi,
The following code does not give me the correct window id for GTK based applications.
 
#include <X11/Xlib.h>
#include <unistd.h>
#include <assert.h>
main()
{
    Window focus = 0;
    int revet = 0;
    Display *disp = XOpenDisplay(0);
    assert(disp);
    sleep(2);
    XGetInputFocus(disp,&focus,&revert);
    printf("Win id is %x\n",focus);
 
}
It always prints a wrong window id for GTK based applications. (gaim, evolution) 
Do I need to set some environment variable? 
I am using xlsclients and xprop to verify the values being printed.
Could somebody please help me?
Is there a GTK API which with the same functionality of XGetInputFocus()? I basically want to get the window 
id of the window in focus. 
 
Thanks in advance
Kala
Yahoo! India Matrimony: Find your life partneronline.
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]