From f76d7df549e95e1699651f59916e9a38f0f58985 Mon Sep 17 00:00:00 2001 From: Michael Hackner Date: Thu, 13 Aug 2026 08:00:32 -0700 Subject: fix: keep tab and sidebar clicks when the terminal reports a stray drag (#2736) * fix: keep tab and sidebar clicks when the terminal reports a stray drag This works around a Ghostty bug that causes herdr tabs to be unclickable in fullscreen mode. Ghostty on macOS in native fullscreen emits one motion report after a fresh press in the strip where the menu bar reveals, with the row shifted to near the bottom of the grid. The cause is upstream: macOS delivers one mouse event whose y is nearly a window height away from the real pointer, and Ghostty reports it as it arrives (iTerm2 and Terminal.app report the same clicks correctly). Herdr treated the stray report as a real drag and lost the click two ways: it opened a tab reorder with no drop target, making the release a no-op, and it handed the release to the pane under the bogus coordinates. Now, a press on the tab bar or sidebar owns the gesture until release, and a tab drag only starts once the pointer is over a real drop target. refs #796 * fix: scope chrome mouse gestures to their input source * fix: preserve chrome drag input source * fix: preserve concurrent chrome presses --------- Co-authored-by: Ogulcan Celik --- src/app/input/sidebar.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/app/input/sidebar.rs') diff --git a/src/app/input/sidebar.rs b/src/app/input/sidebar.rs index 1c3a3b58..0923eef6 100644 --- a/src/app/input/sidebar.rs +++ b/src/app/input/sidebar.rs @@ -1200,12 +1200,12 @@ mod tests { target_row, )); assert_eq!(app.state.active, Some(0)); - assert!(app.state.workspace_press.is_some()); + assert_eq!(app.state.workspace_presses.len(), 1); app.handle_mouse(mouse(MouseEventKind::Up(MouseButton::Left), 2, target_row)); assert_eq!(app.state.active, Some(1)); assert_eq!(app.state.selected, 1); - assert!(app.state.workspace_press.is_none()); + assert!(app.state.workspace_presses.is_empty()); let snapshot = capture_snapshot(&app.state); assert_eq!(snapshot.active, Some(1)); assert_eq!(snapshot.selected, 1); @@ -1272,7 +1272,7 @@ mod tests { )); assert_eq!(app.state.active, None); - assert!(app.state.workspace_press.is_none()); + assert!(app.state.workspace_presses.is_empty()); assert!(app.state.collapsed_space_keys.contains("repo-key")); app.handle_mouse(mouse( @@ -1361,6 +1361,7 @@ mod tests { Some(DragTarget::WorkspaceReorder { source_ws_idx: 1, drop_target: Some(crate::app::state::WorkspaceDropTarget::Before(0)), + .. }) )); app.handle_mouse(mouse(MouseEventKind::Up(MouseButton::Left), 2, target_row)); @@ -1496,6 +1497,7 @@ mod tests { ws_idx: 0, source_tab_idx: 0, insert_idx: Some(3), + .. }) )); app.handle_mouse(mouse( @@ -1721,6 +1723,7 @@ mod tests { Some(DragTarget::WorkspaceReorder { source_ws_idx: 0, drop_target: Some(crate::app::state::WorkspaceDropTarget::End), + .. }) )); app.handle_mouse(mouse(MouseEventKind::Up(MouseButton::Left), 2, target_row)); -- cgit v1.2.3