Mouse clicks could change current item, so work it out again. GitHub
authornicm <nicm@openbsd.org>
Mon, 4 Jul 2022 08:24:36 +0000 (08:24 +0000)
committernicm <nicm@openbsd.org>
Mon, 4 Jul 2022 08:24:36 +0000 (08:24 +0000)
issue 3242.

usr.bin/tmux/window-tree.c

index c2c9b56..fd3a9ab 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-tree.c,v 1.60 2022/05/30 12:55:25 nicm Exp $ */
+/* $OpenBSD: window-tree.c,v 1.61 2022/07/04 08:24:36 nicm Exp $ */
 
 /*
  * Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1243,12 +1243,17 @@ window_tree_key(struct window_mode_entry *wme, struct client *c,
 
        item = mode_tree_get_current(data->data);
        finished = mode_tree_key(data->data, c, &key, m, &x, &y);
+
+again:
        if (item != (new_item = mode_tree_get_current(data->data))) {
                item = new_item;
                data->offset = 0;
        }
-       if (KEYC_IS_MOUSE(key) && m != NULL)
+       if (KEYC_IS_MOUSE(key) && m != NULL) {
                key = window_tree_mouse(data, key, x, item);
+               goto again;
+       }
+
        switch (key) {
        case '<':
                data->offset--;