-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Allow closing tabs with middle mouse button when close button is hidden #15924
Conversation
{ | ||
if (_pointerMiddleButtonPressed && !eventArgs.GetCurrentPoint(*this).Properties().IsMiddleButtonPressed()) | ||
{ | ||
_pointerMiddleButtonPressed = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_pointerMiddleButtonExited
must be reset to false
as well, doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_pointerMiddleButtonExited
is reset on each _OnTabPointerPressed
and updated on each enter/exit event. Not strictly needed to clear it here.
Updated with review changes. |
I'm sorry we left this one on read for so long! We're quieting down for the holidays, but I will make sure that we get a look at it as soon as is possible after that. Thank you for fixing this bug. |
Any news about this? Thanks. |
Rebased to resolve merge conflict. |
This commit fixes the middle mouse button handler. The `PointerReleased` callback is registered, but it is not operational because, on the Release event, the mouse button is no longer pressed. We need to track its state and act accordingly. Issue was introduced by commit 05e7ea1, which changed the event handler from `PointerPressed` to `PointerReleased`, rendering it inoperative. Instead, the default handler is used. The main issue is that when the close button is hidden with the `showCloseButton` option, the default handler no longer closes the tab on middle mouse clicks. Also made it consistent with the Settings tab, which was never converted to `PointerReleased` and is still handled with a custom handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this! Sorry it took us so long to get to it!
Summary of the Pull Request
This commit fixes the middle mouse button handler. The
PointerReleased
callback is registered, but it is not operational because, on the Release event, the mouse button is no longer pressed. We need to track its state and act accordingly.Issue was introduced by commit 05e7ea1, which changed the event handler from
PointerPressed
toPointerReleased
, rendering it inoperative. Instead, the default handler is used. The main issue is that when the close button is hidden with theshowCloseButton
option, the default handler no longer closes the tab on middle mouse clicks.Also made it consistent with the Settings tab, which was never converted to
PointerReleased
and is still handled with a custom handler.References and Relevant Issues
Related commit 05e7ea1
Validation Steps Performed
I've been using this commit locally for quite some time, figured out I might as well share it.