From d5d017ccd0e52d39518ae4ce2ca75b593432a9a9 Mon Sep 17 00:00:00 2001 From: hstyi Date: Sat, 25 Jan 2025 21:05:42 +0800 Subject: [PATCH] fix: shift to close tabs causes switching --- src/main/kotlin/app/termora/MyTabbedPane.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/app/termora/MyTabbedPane.kt b/src/main/kotlin/app/termora/MyTabbedPane.kt index 7eac692..62f2490 100644 --- a/src/main/kotlin/app/termora/MyTabbedPane.kt +++ b/src/main/kotlin/app/termora/MyTabbedPane.kt @@ -44,6 +44,12 @@ class MyTabbedPane : FlatTabbedPane() { tabCloseCallback?.accept(this, index) return } + } else if (e.id == MouseEvent.MOUSE_PRESSED && isShiftPressedOnly(e.modifiersEx)) { + val index = indexAtLocation(e.x, e.y) + if (index >= 0) { + return + } + return } super.processMouseEvent(e) }