Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@gspencergoog
Copy link
Contributor

Description

This converts the GTK keyboard code to track the key down states of the lock modifiers NumLock and CapsLock so 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

@gspencergoog gspencergoog force-pushed the gtk_modifier_sync branch 7 times, most recently from 6851500 to 7bb9b9a Compare August 29, 2020 02:49
FlKeyEventPlugin* fl_key_event_plugin_new(
FlBinaryMessenger* messenger,
GAsyncReadyCallback response_callback = nullptr,
const char* channel_name = nullptr);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.)

Copy link
Contributor Author

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.

@gspencergoog gspencergoog force-pushed the gtk_modifier_sync branch 3 times, most recently from c823e1b to 36dfa4f Compare September 10, 2020 16:13
@gspencergoog
Copy link
Contributor Author

@dkwingsmt PTAL, I think this is ready to go in.

Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a 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.

@gspencergoog gspencergoog merged commit d19a6fa into flutter:master Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gtk Keyboard mapping thinks Num Lock is on when it isn't.

5 participants