Re: [dev] xid of a current window

From: Ivan Kanakarakis <ivan.kanak_AT_gmail.com>
Date: Sun, 25 Mar 2012 16:33:23 +0300

A quick look into the tip of dwm, shows that it is the case for dwm.
It doesn't set the _NET_ACTIVE_WINDOW property correctly,
although the atom is there, and included in _NET_SUPPORTED.

To fix that, one must call (supposing c is
the Client that holds the current window) :

XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW,
32, PropModeReplace, (unsigned char*)&c->window, 1);

everytime the current window changes.
also one should delete the property if there is no active window
(either no window on the screen, or no window focused)



On 25/03/2012, Swiatoslaw Gal <swiatoslaw.gal_AT_univie.ac.at> wrote:
> ---------- From Ivan Kanakarakis 25-03-2012 at 15:20 ----------
>> if you don't want to write something of your own, then
>>
>> $ xprop -root _NET_ACTIVE_WINDOW
>> > _NET_ACTIVE_WINDOW(WINDOW): window id # 0x400050
>
> xprop -root shows me the values of the folowing fields:
> CUT_BUFFER0(STRING)
> WM_NAME(STRING)
> _NET_SUPPORTED(ATOM)
> ESETROOT_PMAP_ID(PIXMAP)
> _XROOTPMAP_ID(PIXMAP)
> RESOURCE_MANAGER(STRING)
> _XKB_RULES_NAMES(STRING)
> XFree86_VT(INTEGER)
> XFree86_DDC_EDID1_RAWDATA(INTEGER)
>
>> $ xdotool getactivewindow
> XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1)
> xdo_get_active_window reported an error
>
>> will work, as long as your wm supports and correctly sets
>> _NET_ACTIVE_WINDOW
> I assume that this is not the case.
> I am using dwm. Does it matter?
>
> s.
>
>


-- 
*Ivan c00kiemon5ter V Kanakarakis *
Received on Sun Mar 25 2012 - 15:33:23 CEST

This archive was generated by hypermail 2.3.0 : Sun Mar 25 2012 - 15:36:04 CEST