View Full Version : Get active window
gnumdk
January 30th, 2007, 12:48 PM
I try to get active (focused one) window but it doesn't work :(
xid = window->screen->display->activeWindow;
w = findWindowAtDisplay(window->screen->display, xid);
This always give me kicker as active window :(
gnumdk
January 30th, 2007, 02:14 PM
xid = getActiveWindow(window->screen->display, window->screen->root);
w=findWindowAtScreen(window->screen, xid);
This is not working :(
for (w = window->screen->windows; w ; w = w->next)
{
if (window->screen->focusWindow (w) )
break;
}
This too :(
mikedee
January 30th, 2007, 02:49 PM
xid = getActiveWindow(window->screen->display, window->screen->root);
w=findWindowAtScreen(window->screen, xid);
I think this code should work, it just reads the active window atom on the root window.
You can check the value of this, the active window should be reported correctly here.
xprop -root | grep _NET_ACTIVE_WINDOW\(W
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.