i3 - improved tiling WM


Bugfix: prevent unneeded render on pointer enter

Patch status: merged

Patch by Tony Crisci

Long description:

When `focus_follows_mouse` option is on, prevent an uneeded render on
pointer enter when the con is already focused.

This pointer enter might be caused by entering a window decoration of an
already-focused container.

This extra render can cause concurrency issues when focus is set
asynchronously with WM_TAKE_FOCUS.

To apply this patch, use:
curl http://cr.i3wm.org/patch/571/raw.patch | git am

b/src/handlers.c

21
@@ -183,6 +183,10 @@ static void handle_enter_notify(xcb_enter_notify_event_t *event) {
22
     if (config.disable_focus_follows_mouse)
23
         return;
24
 
25
+    /* if this container is already focused, there is nothing to do. */
26
+    if (con == focused)
27
+        return;
28
+
29
     /* Get the currently focused workspace to check if the focus change also
30
      * involves changing workspaces. If so, we need to call workspace_show() to
31
      * correctly update state and send the IPC event. */