EasyTabs
EasyTabs copied to clipboard
When changing a tab, the application window is often minimized.
Hello everyone.
When changing a tab, the application window is often minimized. It probably results from the function in the windows system that when you double-click the window, the window is minimized. However, in my opinion, when using EasyTabs, you have to move very slowly between the tabs in order not to accidentally minimize the window - it is very frustrating.
On stackoverflow I found many solutions that allow you to disable the window minimization option by double-clicking (e.g. such https://stackoverflow.com/questions/9588540/how-can-i-stop-a-double-click-of-the-window-title-bar-from-maximizing-a-window-o) but I cannot implant it so that it works with EasyTabs. Could someone direct me how to do this?
I am surprised that no one has reported such a problem before - because it is really very troublesome when changing tabs frequently.
I have the same problem and I also cannot find a workaround. I had a look at TitleBarTabsOverlay.cs and there's this fragment:
else if (nCode >= 0 && (int) WM.WM_LBUTTONDBLCLK == (int) wParam) { if (DesktopBounds.Contains(_lastTwoClickCoordinates[0]) && DesktopBounds.Contains(_lastTwoClickCoordinates[1])) { Invoke(new Action(() => { _parentForm.WindowState = _parentForm.WindowState == FormWindowState.Maximized ? FormWindowState.Normal : FormWindowState.Maximized; })); } }
I think there should be a check added if those 2 clicks are on the same pixel (or at least close to each other). Also the time for double click should be reduced, but I don't know how to do it.
@lstratman this is still an issue. help!
It seems it still an issue
I have found a solution and would like to leave it here for those who may be interested. In the TitleBarTabsOverlay
class there is an attribute _isOverCloseButtonForTab
, it indicates that the cursor is in the area of the tab close button. And I just repeated the algorithm for determining this parameter for the whole tab. The algorithm for determining this parameter is in the InterpretMouseEvents
method. Then I added a check to find the cursor in one of the three areas (tab, tab close button, new tab creation button) to MouseHookCallback
. Below is an example of the code that I use. What it does it just prevents double clicking from happening over a tab, tab close button and tab add button. I hope it'll help someone.
protected int _isOverTab = -1;
// There is a description of what it does above the original algorithm in InterpretMouseEvents method
if (_isOverTab != -1 &&
(_isOverTab >= _parentForm.Tabs.Count ||
!_parentForm.TabRenderer.IsOverTab(_parentForm.Tabs[_isOverTab], relativeCursorPosition)))
{
reRender = true;
_isOverTab = -1;
}
else
{
for (int i = 0; i < _parentForm.Tabs.Count; i++)
{
if (_parentForm.TabRenderer.IsOverTab(_parentForm.Tabs[i], relativeCursorPosition))
{
_isOverTab = i;
reRender = true;
break;
}
}
}
// And then a check in MouseHookCallback to prevent double-clicking
var isOverTabCloseButton = _parentForm.Tabs.ElementAtOrDefault(_isOverCloseButtonForTab) != null;
var isOverTab = _parentForm.Tabs.ElementAtOrDefault(_isOverTab) != null;
var preventDoubleClick = (isOverTab || isOverTabCloseButton || _isOverAddButton);
if (!preventDoubleClick && _lastLeftButtonClickTicks > 0 && currentTicks - _lastLeftButtonClickTicks < _doubleClickInterval * 10000)