[i3] Cant subscribe to window::focus events

2014-08-29 Thread Sargrad, Dave
I am trying to register for a window::focus event, but am not seeing the events 
come in.



I can register for window::new and for workspace::focus just fine.



The code snippet I am using to register is:





from gi.repository import i3ipc



# Create the Connection object that can be used to send commands and subscribe

# to events.

conn = i3ipc.Connection()



conn.on('window::focus', on_window_focus)



I did turn on i3 debug and I did notice the following (this occurs when I call 
conn.on):

08/29/2014 04:53:25 PM - ipc.c:add_subscription:744 - should add subscription 
to extra 0xef61a0, sub window

08/29/2014 04:53:25 PM - ipc.c:add_subscription:754 - client is now subscribed 
to:

08/29/2014 04:53:25 PM - ipc.c:add_subscription:756 - event window

08/29/2014 04:53:25 PM - ipc.c:add_subscription:757 - (done)





Not sure how to interpret that debug info, but I think its telling me that I 
need to subscribe for window::focus differently.



Again, I am able to register for workspace::focus just fine (and receive 
workspace focus events).

conn.on('workspace::focus', on_workspace_focus)





This message is intended only for the addressee and may contain information 
that is company confidential or privileged. Any technical data in this message 
may be exported only in accordance with the U.S. International Traffic in Arms 
Regulations (22 CFR Parts 120-130) or the Export Administration Regulations (15 
CFR Parts 730-774). Unauthorized use is strictly prohibited and may be 
unlawful. If you are not the intended recipient, or the person responsible for 
delivering to the intended recipient, you should not read, copy, disclose or 
otherwise use this message. If you have received this email in error, please 
delete it, and advise the sender immediately.


Re: [i3] Cant subscribe to window::focus events

2014-08-29 Thread Tony Crisci

Hi,

You seem to be doing everything right with the library.

The problem is most likely that you are using a version of i3 that does 
not emit the `focus` events. This feature was added in version 4.8. 
Check your version with `i3 --version` and make sure it is up to date.


Am 08/29/2014 um 01:03 PM schrieb Sargrad, Dave:


I am trying to register for a window::focus event, but am not seeing 
the events come in.


I can register for window::new and for workspace::focus just fine.

The code snippet I am using to register is:

*from gi.repository import i3ipc*

**

*# Create the Connection object that can be used to send commands and 
subscribe*


*# to events.*

*conn = i3ipc.Connection()*

**

*conn.on('window::focus', on_window_focus)*

I did turn on i3 debug and I did notice the following (this occurs 
when I call conn.on):


08/29/2014 04:53:25 PM - ipc.c:add_subscription:744 - should add 
subscription to extra 0xef61a0, sub window


08/29/2014 04:53:25 PM - ipc.c:add_subscription:754 - client is now 
subscribed to:


08/29/2014 04:53:25 PM - ipc.c:add_subscription:756 - event window

08/29/2014 04:53:25 PM - ipc.c:add_subscription:757 - (done)

Not sure how to interpret that debug info, but I think its telling me 
that I need to subscribe for window::focus differently.


Again, I am able to register for workspace::focus just fine (and 
receive workspace focus events).


*conn.on('workspace::focus', on_workspace_focus)*


/This message is intended only for the addressee and may contain 
information that is company confidential or privileged. Any technical 
data in this message may be exported only in accordance with the U.S. 
International Traffic in Arms Regulations (22 CFR Parts 120-130) or 
the Export Administration Regulations (15 CFR Parts 730-774). 
Unauthorized use is strictly prohibited and may be unlawful. If you 
are not the intended recipient, or the person responsible for 
delivering to the intended recipient, you should not read, copy, 
disclose or otherwise use this message. If you have received this 
email in error, please delete it, and advise the sender immediately. /