-
Notifications
You must be signed in to change notification settings - Fork 6k
Track lock key down state instead of lock state #20836
Conversation
6851500 to
7bb9b9a
Compare
| FlKeyEventPlugin* fl_key_event_plugin_new( | ||
| FlBinaryMessenger* messenger, | ||
| GAsyncReadyCallback response_callback = nullptr, | ||
| const char* channel_name = nullptr); |
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.
Wouldn't it make more sense for the mock engine to allow setting up an arbitrary channel to echo, rather than passing in an arbitrary channel name here, so that the changes for testing as, as much as possible, in the test code rather than the real code?
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.
OK @stuartmorgan , I've added an engine constructor that will allow overriding of the channel to send requests on, and used that when setting up the mock engine. Is that what you were thinking of? I still have to pass the response callback, because that's specific to the key event plugin, and it needs to terminate the event loop.
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.
I think this is worse than what you had, sorry. Per discussion yesterday, I forgot there's no actual mock engine at this point, only a mock renderer.
Let's go back to what you had before, and longer term we'll find a better way of doing this kind of testing. (Probably using the embedder.h layer interposing that I want to write for testing all of the desktop embeddings.)
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.
OK, I reverted it back to what I had before.
c823e1b to
36dfa4f
Compare
|
@dkwingsmt PTAL, I think this is ready to go in. |
dkwingsmt
left a comment
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.
LGTM
stuartmorgan-g
left a comment
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.
LGTM, although my confidence in reviewing GObject code is still low.
36dfa4f to
2e79fcf
Compare
Description
This converts the GTK keyboard code to track the key down states of the lock modifiers
NumLockandCapsLockso that they represent the actual "down" state of the key, rather than the lock state itself.GTK tracks the lock state, and Flutter expects the down state.
Related Issues