This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Track "mouse leave" event #12363
Merged
+51
−2
Merged
Track "mouse leave" event #12363
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4ab6c8b
Track mouse leave
franciscojma86 7e59dd3
Address comments
franciscojma86 b1bfea6
Whitespace
franciscojma86 89c11a9
Make private
franciscojma86 bcc6ed6
Reformat
franciscojma86 a9cbb66
Merge branch 'master' into mouse
franciscojma86 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,9 @@ class Win32FlutterWindow : public Win32Window { | |
// |Win32Window| | ||
void OnPointerUp(double x, double y) override; | ||
|
||
// |Win32Window| | ||
void OnPointerLeave() override; | ||
|
||
// |Win32Window| | ||
void OnChar(char32_t code_point) override; | ||
|
||
|
@@ -105,6 +108,13 @@ class Win32FlutterWindow : public Win32Window { | |
// Reports mouse release to Flutter engine. | ||
void SendPointerUp(double x, double y); | ||
|
||
// Reports mouse left the window client area. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the asymmetry is non-obvious (or at least was to me coming from a non-Windows background—macOS and GLFW both have enter and exit, apparently unlike Win32), maybe add a comment explicitly saying that there is no SendPointerEnter because it's automatically inferred from any other pointer event being sent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
// | ||
// Win32 api doesn't have "mouse enter" event. Therefore, there is no | ||
// SendPointerEnter method. A mouse enter event is tracked then the "move" | ||
// event is called. | ||
void SendPointerLeave(); | ||
|
||
// Reports a keyboard character to Flutter engine. | ||
void SendChar(char32_t code_point); | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
FWIW (not something to change in this PR), it's likely that process_events_ and the plugin handler hooks that toggle it are entirely cruft inherited from what the GLFW implementation did to interoperate reasonably with GTK dialogs.
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.
Possibly. There was a contract that somewhere that required events to be disabled / enabled.