From f527ba4c36181fc07cd725b7d52e728b9fe286f3 Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sat, 7 Jun 2025 21:34:07 +0100 Subject: [PATCH] fix: Prevent multiple mouse drag actions and restore pane switching --- gtm2.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gtm2.py b/gtm2.py index bdae00a..d636314 100755 --- a/gtm2.py +++ b/gtm2.py @@ -378,12 +378,14 @@ def handle_mouse_input(stdscr, state): _, mx, my, _, bstate = curses.getmouse() if bstate & curses.BUTTON1_PRESSED: - if abs(mx - state.divider_col) <= 1: - state.dragging_divider = True - else: - state.is_selecting = True - state.selection_start_coord = (mx, my) - state.selection_end_coord = (mx, my) + # Only start a new action if no action is in progress + if not state.dragging_divider and not state.is_selecting: + if abs(mx - state.divider_col) <= 1: + state.dragging_divider = True + else: + state.is_selecting = True + state.selection_start_coord = (mx, my) + state.selection_end_coord = (mx, my) if state.dragging_divider: state.update_divider(mx)