Bug 426982

Summary: Double clicking tabs create a new file
Product: [Applications] kate Reporter: Grósz Dániel <groszdanielpub>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph, nate, tumaix
Priority: NOR    
Version First Reported In: 20.08.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Grósz Dániel 2020-09-26 03:43:16 UTC
SUMMARY
Double clicking a tab on the tab bar opens a new file.

Creating a new tab when double clicking the empty area of the tab bar is a common feature in tabbed applications (though it's less common in editors where opening a new tab involves creating a new document, and there is a New icon anyway). However, there is no empty space in the current implementation of the tab bar (as the tabs always fill the space), and it happens when double clicking a tab, so I assume this behavior is unintended. It's fairly easy to accidentally double click a tab when trying to switch to it, and in most tabbed applications it behaves like a single click.

STEPS TO REPRODUCE
1. Double click a tab in the tab bar (whether the current tab or an inactive one).

OBSERVED RESULT
Kate creates a new file/tab and switches to it.

EXPECTED RESULT
The tab is activated (if it's inactive), and nothing else happens.

SOFTWARE/OS VERSIONS
openSuse Tumbleweed 20200923
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Comment 1 Nate Graham 2020-09-26 15:26:20 UTC
Confirmed. Not sure if this is intentional or a bug. Hopefully Tomaz or a Kate developer can weigh in.
Comment 2 Christoph Cullmann 2020-09-26 15:30:11 UTC
I actually think this is a feature.

If we don't want that, then somebody must implement some more fine grained config for the tab bar, as e.g. now with maximal expanding tabs, there is no other way to have this at all.

And e.g. for the "limit to X tabs" mode, only expanding makes sense, otherwise you have useless unused space and smaller areas to click to toggle between the documents.
Comment 3 Nate Graham 2020-09-26 16:13:18 UTC
An alternative I could think of is to add an explicit "New Tab/Document" button to the tab bar, as Konsole can do. That way there would be a small but visible UI for this feature rather than a large invisible one. Your call though. I don't think the status quo is a huge problem, personally. :)
Comment 4 Grósz Dániel 2020-09-26 16:41:09 UTC
Accidental double clicks mostly happen when I use a touchpad; I guess it's less of a problem when one uses a mouse.

Is a "new tab" feature really necessary, whether with an extra button, or with the double click? In an editor, I normally create a new file with the "New" button on the toolbar (if not with the shortcut).
Comment 5 Christoph Cullmann 2020-12-15 20:15:23 UTC
Git commit 349d8296614dfeff490e2e57f4545eb0bada6ad3 by Christoph Cullmann.
Committed on 15/12/2020 at 20:14.
Pushed by cullmann into branch 'master'.

allow to configure if double/middle click shall open/close stuff in tabbar

M  +15   -0    kate/kateconfigdialog.cpp
M  +2    -0    kate/kateconfigdialog.h
M  +9    -2    kate/katetabbar.cpp
M  +10   -0    kate/katetabbar.h

https://invent.kde.org/utilities/kate/commit/349d8296614dfeff490e2e57f4545eb0bada6ad3