Re: [dev] xid of a current window

2012-03-25 Thread Andreas Amann
On Sun, Mar 25, 2012 at 07:47:36PM +0200, Swiatoslaw Gal wrote: > > You could use the focused window instead (which was what you > > originally asked about): > > > > $ xdotool getwindowfocus > > 48234505 > > Yes, this works fine (without any today's patches). > But the very first answer: XGetInpu

Re: [dev] xid of a current window

2012-03-25 Thread Swiatoslaw Gal
> You could use the focused window instead (which was what you > originally asked about): > > $ xdotool getwindowfocus > 48234505 Yes, this works fine (without any today's patches). But the very first answer: XGetInputFocus was _exactly_ what I was looking for. Is there a reason that a _window_m

Re: [dev] xid of a current window

2012-03-25 Thread Benjamin R. Haskell
On Sun, 25 Mar 2012, Swiatoslaw Gal wrote: -- From Ivan Kanakarakis 25-03-2012 at 15:20 -- $ xdotool getactivewindow XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1) xdo_get_active_window reported an error You could use the focused window instead (which was what you ori

Re: [dev] xid of a current window

2012-03-25 Thread Swiatoslaw Gal
> Thanks, I applied both patches. Even though I really more and more hat > this whole EWMH cruft. Since there was basic EWMH support in dwm, > things became more unreadable... Then I start to feel guilty of my question. I've got my answer, and I do not know if anyone really needs _NET_WM_WINDOW_O

Re: [dev] xid of a current window

2012-03-25 Thread Anselm R Garbe
On 25 March 2012 15:56, Andreas Amann wrote: > Attached is a patch which does that.  It works for me. > > If you want support for NetActiveWindow, you probably also want support > for NetClientList.  The second patch implements that. Thanks, I applied both patches. Even though I really more and m

Re: [dev] xid of a current window

2012-03-25 Thread Andreas Amann
On Sun, Mar 25, 2012 at 04:33:23PM +0300, Ivan Kanakarakis wrote: > 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 (suppos

Re: [dev] xid of a current window

2012-03-25 Thread Ivan Kanakarakis
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, ro

Re: [dev] xid of a current window

2012-03-25 Thread Swiatoslaw Gal
-- 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(ST

Re: [dev] xid of a current window

2012-03-25 Thread Ivan Kanakarakis
if you don't want to write something of your own, then $ xprop -root _NET_ACTIVE_WINDOW > _NET_ACTIVE_WINDOW(WINDOW): window id # 0x400050 or $ xdotool getactivewindow > 4194384 will work, as long as your wm supports and correctly sets _NET_ACTIVE_WINDOW note that xdotool outputs the id as an

Re: [dev] xid of a current window

2012-03-25 Thread Connor Lane Smith
On 25 March 2012 12:42, Anselm R Garbe wrote: > http://tronche.com/gui/x/xlib/input/XGetInputFocus.html Note that a Window is an integer, specifically the window's XID. cls

Re: [dev] xid of a current window

2012-03-25 Thread Anselm R Garbe
On 25 March 2012 13:37, Swiatoslaw Gal wrote: > How can I get a xid of a focused window?  Like with xprop, but > without user interaction.  Say, I want to write an program > that would log the xid of a currently focused window every second. http://tronche.com/gui/x/xlib/input/XGetInputFocus.html

[dev] xid of a current window

2012-03-25 Thread Swiatoslaw Gal
How can I get a xid of a focused window? Like with xprop, but without user interaction. Say, I want to write an program that would log the xid of a currently focused window every second. Sincerely, s.