]> cloud.milkyroute.net Git - dolphin.git/commitdiff
dolphintabbar: only open tab on double left click
authorYifan Zhu <fanzhuyifan@gmail.com>
Sat, 20 Jan 2024 18:14:23 +0000 (10:14 -0800)
committerYifan Zhu <fanzhuyifan@gmail.com>
Sun, 21 Jan 2024 08:18:38 +0000 (08:18 +0000)
A new tab should be opened only if the double click comes from the left
button.

BUG: 480098
FIXED-IN: 24.02

src/dolphintabbar.cpp

index c70089223da4a6b62525c46e6f0c1f7673ee742f..55b5e5edfd03c703dbdc05647db7973d6afba5e2 100644 (file)
@@ -103,15 +103,17 @@ void DolphinTabBar::mouseReleaseEvent(QMouseEvent *event)
 
 void DolphinTabBar::mouseDoubleClickEvent(QMouseEvent *event)
 {
-    int index = tabAt(event->pos());
+    if (event->buttons() & Qt::LeftButton) {
+        int index = tabAt(event->pos());
 
-    if (index < 0) {
-        // empty tabbar area case
-        index = currentIndex();
+        if (index < 0) {
+            // empty tabbar area case
+            index = currentIndex();
+        }
+        // Double left click on the tabbar opens a new activated tab
+        // with the url from the doubleclicked tab or currentTab otherwise.
+        Q_EMIT openNewActivatedTab(index);
     }
-    // Double click on the tabbar opens a new activated tab
-    // with the url from the doubleclicked tab or currentTab otherwise.
-    Q_EMIT openNewActivatedTab(index);
 
     QTabBar::mouseDoubleClickEvent(event);
 }