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

Fixes #3381. WindowsDriver spurious ButtonPressed mouse events #3382

Merged

Conversation

tig
Copy link
Collaborator

@tig tig commented Apr 3, 2024

Fixes

Proposed Changes/Todos

  • Diagnose - Between instantiations of WindowsDriver, if a double-click event was the last event, ReadConsole is retriving a spurious event with Button1Pressed.
  • Update Mouse Scenario to illustrate
  • Hack fix: In Teardown eat any outstanding ReadConsole input.

@tig tig requested a review from BDisp April 3, 2024 18:55
tig added a commit to tig/Terminal.Gui that referenced this pull request Apr 3, 2024
@BDisp
Copy link
Collaborator

BDisp commented Apr 3, 2024

I think you can also dispose the _waitForProbe.

In the TearDown uncomment:

_waitForProbe?.Dispose ();

In the WindowsInputHandler replace this in the finally:

            finally
            {
                if (!_inputHandlerTokenSource.IsCancellationRequested)
                {
                    _waitForProbe.Reset ();
                }
            }

@BDisp
Copy link
Collaborator

BDisp commented Apr 3, 2024

I think you can also dispose the _waitForProbe.

In the TearDown uncomment:

_waitForProbe?.Dispose ();

In the WindowsInputHandler replace this in the finally:

            finally
            {
                if (!_inputHandlerTokenSource.IsCancellationRequested)
                {
                    _waitForProbe.Reset ();
                }
            }

The reason for this is when IsCancellationRequested is true the finally section is only executed when the _waitForProbe is disposed.

Copy link
Collaborator

@BDisp BDisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I only recommend the changes in #3382 (comment).

@tig
Copy link
Collaborator Author

tig commented Apr 3, 2024

I think you can...

I'm leery of making these changes.

They make sense to me but I don't have the time right now to really think it through. How confident are you these changes are correct?

@tig tig merged commit dec65ff into gui-cs:v2_develop Apr 4, 2024
1 check passed
@tig
Copy link
Collaborator Author

tig commented Apr 4, 2024

We can fix those issues in another PR.

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 this pull request may close these issues.

2 participants