]> git.lizzy.rs Git - bspwm.git/commitdiff
Honor `pointer_follows_focus` when swapping nodes
authorBastien Dejean <nihilhill@gmail.com>
Fri, 14 Aug 2020 10:15:21 +0000 (12:15 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Fri, 14 Aug 2020 10:15:21 +0000 (12:15 +0200)
Closes #1170.

src/tree.c

index a62fa264dca4f1d83a4241c23f5f16fff852658a..21a55729e33df795e69fc562f2a87cf44a5e611b 100644 (file)
@@ -1581,6 +1581,10 @@ bool swap_nodes(monitor_t *m1, desktop_t *d1, node_t *n1, monitor_t *m2, desktop
 
        if (d1 != d2) {
                arrange(m2, d2);
+       } else {
+               if (pointer_follows_focus && (n1_held_focus || n2_held_focus)) {
+                       center_pointer(get_rectangle(m1, d1, d1->focus));
+               }
        }
 
        return true;