Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right click and drag will "lock" tab item. #132

Open
askmoller opened this issue Nov 24, 2016 · 1 comment · May be fixed by #280
Open

Right click and drag will "lock" tab item. #132

askmoller opened this issue Nov 24, 2016 · 1 comment · May be fixed by #280

Comments

@askmoller
Copy link

To recreate the bug follow these steps:

  1. Right click on a tab that is not selected (and hold the mouse button down).
  2. Move the mouse left or right so it is hovering over the adjacent tab header.
  3. Release the mouse button.

Now the tab that was right clicked on will not respond to left click. So the tab cannot be opened.

The process does not have to be 100% like I have describe. It's just one way that will provoke the behavior.

@BornToBeRoot
Copy link

Hi @ButchersBoy,

i found the bug in this method:

protected override void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e)
{
if (_thumb != null)
{
var currentThumbIsHitTestVisible = _thumb.IsHitTestVisible;
_thumb.SetCurrentValue(IsHitTestVisibleProperty, false);
_rightMouseUpCleanUpDisposable.Disposable = Disposable.Create(() =>
{
_thumb.SetCurrentValue(IsHitTestVisibleProperty, currentThumbIsHitTestVisible);
});
}
else
{
_rightMouseUpCleanUpDisposable.Disposable = Disposable.Empty;
}
base.OnPreviewMouseRightButtonDown(e);
}

The problem is when you hold the right mouse button and the mouse is moved, the IsHitTestVisibleProperty is not set to false again (line 487-489).

My current workaround is:

protected override async void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e)
{            
    if (_thumb != null)
    {                
        var currentThumbIsHitTestVisible = _thumb.IsHitTestVisible;
        _thumb.SetCurrentValue(IsHitTestVisibleProperty, false);
                        
        while (Mouse.RightButton == MouseButtonState.Pressed)
        {
            await Task.Delay(25);
        };
                 
        _thumb.SetCurrentValue(IsHitTestVisibleProperty, currentThumbIsHitTestVisible);
    }

    base.OnPreviewMouseRightButtonDown(e);
}

But i use TargetFramework 6.0

BornToBeRoot added a commit to BornToBeRoot/Dragablz that referenced this issue Nov 20, 2022
BornToBeRoot added a commit to BornToBeRoot/Dragablz that referenced this issue Nov 20, 2022
@BornToBeRoot BornToBeRoot linked a pull request Apr 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants