Re: [i3] Obsolete focus change?

  • From: Michael Stapelberg <michael@xxxxxxxx>
  • To: Marco Hunsicker <i3@xxxxxxxxxxxx>, i3-discuss@xxxxxxxxxxxxx
  • Date: Mon, 20 Jan 2014 19:46:14 +0100

Hi Marco,

Marco Hunsicker <i3@xxxxxxxxxxxx> writes:

During testing of my IPC patch, I've found an edge case that might be
worthwhile to investigate.

If a window currently has the focus and the mouse is placed within the
window bounds, moving the mouse over (not beyond) the window border
triggers a focus change although the window is already focused!
Yeah, because those are different X11 windows and i3 gets an EnterNotify
event.

As I don't know whether this behavior is intentional, I've addressed
this use case specifically for my code path in con.c->con_focus() to
avoid sending pointless window events. Might be possible to extend the
checking to the whole method to spare some cycles.
Well, focus will not actually be updated, i.e. no communication from i3
to X11 happens because of our state machine model. con_focus() and
rendering the tree are both supposed to work at any time and be pretty
fast, so it’s not a big concern.

In case you feel strongly about this, you could send a patch which would
short-circuit this code path and then try all the weird corner cases we
have (various layouts, decoration styles, mouse transitions between
monitors, etc.). Personally, I don’t think that’s worth it.

--
Best regards,
Michael

Other related posts: