[macOS][X11] Release mouse capture when dialog shown #16205
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
As described in #14525, mouse capture is released on Windows when a dialog is shown, but not on macOS. The issue doesn't mention it but we have the same problem on X11 too.
The fix for this is implemented in managed code. This is because:
XGrabPointer
currently, and theGrabNotify
event which notifies of a pointer capture release isn't available on all X11 implementations anywayThe fix is implemented in
WindowImpl.SetEnabled(false)
as this is the point on Windows whereWM_CANCELMODE
is raised to inform us to release mouse capture: by doing it like this we match Windows' behavior.Also added an integration test.
Fixed issues
Fixes #14525