Ok, I've updated my code so that in Window's __init__() this is called:<div><br><div> #What is our focus modal?</div><div> protos = self.get_wm_protocols()</div><div> hints = self.get_wm_hints()</div>
<div> input = False</div><div> take_focus = False</div><div> if hints and hints['input']:</div><div> input = True</div><div> if protos and util.get_atom("WM_TAKE_FOCUS") in protos:</div>
<div> take_focus = True</div><div> if input and take_focus:</div><div> print self.get_wm_name()</div><div> print "local_active"</div><div> self.local_active = True</div>
<div> elif input and not take_focus:</div><div> print self.get_wm_name()</div><div> print "passive"</div><div> self.passive = True</div><div> elif take_focus and not input:</div>
<div> print self.get_wm_name()</div><div> print "global_active"</div><div> self.global_active = True</div><div> else:</div><div> print "no_input"</div>
<div> self.no_input = True</div><div>and from the print statements I know that it is working. Window.focus() is now:</div><div><div> def focus(self):</div><div> if self.passive :</div><div> self.conn.core.SetInputFocus(xproto.InputFocus.PointerRoot, self.win)</div>
<div> elif self.local_active:</div><div> err = self.conn.core.SetInputFocusChecked(xproto.InputFocus.PointerRoot, self.win)</div><div> err.check()</div><div> packed = event.pack_client_message(self.win, "WM_PROTOCOLS", util.get_atom("WM_TAKE_FOCUS"), xproto.Time.CurrentTime)</div>
<div> err = event.send_event_checked(self.win, [],packed)</div><div> err.check()</div><div> elif self.global_active:</div><div> packed = event.pack_client_message(self.win, "WM_PROTOCOLS", util.get_atom("WM_TAKE_FOCUS"), xproto.Time.CurrentTime)</div>
<div> err = event.send_event_checked(self.win, [],packed)</div><div> err.check()</div><div> else:</div><div> return</div><div> </div><div> ewmh.set_active_window(self.win)</div>
</div><div>according to the checked requests, everything is fine, i.e. no exceptions. Insofar as I can understand, I am following the icccm.</div><div><br></div>-- <br>Praising my Savior all the day long,<div>Micah Nordland</div>
<br>
</div>