10 Commits

Author SHA1 Message Date
Robert Ancell
5fd25a971c Only remove weak pointers that are set.
If the pointer has already been removed this generates a runtime warning.
2021-01-12 15:35:39 +13:00
Greg Spencer
250dcd5287
Fix indexing error in Linux key event handling (#23598)
Fixes an indexing error in the linux key handling code.

I also found another error when checking to see if an event is re-dispatched, and some off-by-one errors in the search. Not sure what I was smoking that day, but hopefully these are all the issues.
2021-01-11 13:01:06 -08:00
Greg Spencer
9cb4d2dd24
Make pending event handling more lenient to allow out of order responses (#23504)
This PR makes the Linux key handling code a little more lenient when it comes to the order in which it receives responses to key events from the framework. I had assumed that there wasn't a case where responses could get out of order, but it seems that it is possible, given that you can mash on the keyboard and eventually get one out of order.

This changes the code so that instead of just looking at the first entry in the pending event deque, it searches the deque starting at the beginning to find the event, and remove it.
2021-01-08 10:43:59 -08:00
Damian Wrobel
3a1b62b362
Fix argument specifier for g_warning() (#23138) 2021-01-07 15:34:03 -08:00
Greg Spencer
bdadaad20d
Add delayed event delivery for Linux. (#22577)
This changes the text handling so that keyboard events are sent to the framework first for handling, and then passed to the text input plugin, so that the framework has a chance to handle keys before they get given to the text field.

This is complicated by the async nature of the interaction with the framework, since GTK wants a synchronous response. So, in this change, I always tell GTK that the event was handled, and if it wasn't, then I re-dispatch the event once we know one way or the other.
2020-12-03 15:00:37 -08:00
Greg Spencer
d19a6fab13
Track lock key down state instead of lock state (#20836)
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.
2020-09-13 14:44:25 -07:00
Robert Ancell
fcdc1dbc36
Replace GLFW key codes with native Flutter GTK support (#19196)
Fixes https://github.com/flutter/flutter/issues/57603
2020-06-26 13:56:18 +12:00
Robert Ancell
71fce02dd6
Fix shift-tab not working by adding more GTK->GLFW key mappings. (#18988) 2020-06-12 09:08:41 +12:00
Robert Ancell
1b4d958f98
Add braces around multi-line branches to match code style (#18719) 2020-06-03 06:22:24 +12:00
Robert Ancell
72f7a7c4ea
Add FlKeyEventPlugin (#18313) 2020-05-21 16:08:56 +12:00