Used the the `misspell` tool available at
https://github.com/client9/misspell, then applied hand-corrections. It's
possible we could adopt this as a presubmit, but there are still enough
false positives that it may not be worth the effort.
While we no longer crash when the framebuffer destruction_callback is
null (patched in https://github.com/flutter/engine/pull/24845) we should
bet setting one, even if it's a no-op containing a comment pointing to
where cleanup is implemented.
Fixes the following compilation error:
../../flutter/shell/platform/linux/fl_key_event_plugin.cc:189:7:
error: format specifies type 'long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
On X11 scroll events are being directly sent to the FlView X window. This is
causing them to bypass the normal scroll handling and means this widget received
both smooth and non-smooth scroll events.
I haven't been able to find a solution to the root cause of the problem, so only
smooth scroll event are being processed. This could cause issues on older
versions of the X server that don't send smooth scroll events, but fixes the
problem for the common modern case.
This issue doesn't occur in Wayland.
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.
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.
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.
Switches the Linux embedding from the standard C API to the new proctable version, to allow for unit testing of the embedding layer separately from the embedder APIs implementation.
Currently, the Linux embedder does not handle window exposure events.
This is typically not a problem for users who use compositing window
managers, since they keep the display buffers even if the window is
completely covered. However, for users that don't use a compositor, the
window will not be redrawn by the engine if it was previously covered
until another event triggers the redraw.
This patch implements the GtkWidget draw callback to handle window
exposure events. The callback doesn't actually draw anything, it just
schedule a frame for drawing by the engine.
The engine doesn't support exposure events, so instead, we force redraw
by sending a window metrics event of the same geometry. Since the
geometry didn't change, only a frame will be scheduled.
Fix incorrect parameter used for self object
Rename the GWeakNotify function parameters.
This matches the prototype and makes it harder to accidentally use the object
parameter the wrong way.
This implements the Gtk hooks required to support multi-step input
methods on Linux. This builds on the support for composing regions
(preedit region in Gtk terminology) added to TextInputModel in
https://github.com/flutter/engine/pull/21682.
Specifically, the following changes are included:
1. Add handler for TextInput.setMarkedTextRegion framework messages: On
any change to the EditableText in the framework, this message is sent
which provides an updated rect (in the local co-ordinates of the
EditableText) for the composing region. If not in composing mode, the
cursor rect is sent.
2. Add handler for TextInput.setEditableSizeAndTransform framework messages:
On any change to the RenderObject underlying the EditableText, an
updated size for the full EditableText widget, as well as an affine
transform matrix from local co-ordinates to Flutter root co-ordinates is
sent.
3. On either of the above messages, we use the transformed composing
rect to compute the cursor position in Gtk window co-ordinates and
inform Gtk, so that it can position any system IM composing window
correctly for on-the-spot composing, such as is used when inputting
Japanese text.
4. Adds handlers for preedit-start, preedit-changed, and preedit-end
signals from Gtk. These are passed on to the TextInputModel.
5. Updates the preedit-commit handler to commit the composing region to
the text or, if not composing, insert new text at the cursor.
6. Updates the handler for TextInput.setEditingState framework messages
to extract the composing range base and extent and pass these on to
TextInputModel.
7. Updates update_editing_state function to set composing base and
extent on text input state updates sent to the framework.
This PR fixes a few small memory leaks in FlTextInputPlugin. All three cases
are creating temporary FlValue instances for lookups and comparison without
ever releasing them.
In an upcoming patch, we'll enable enforcement that all FLUTTER_NOLINT
comments include an issue link. This migrates the remaining uses to that
format.
Bug: https://github.com/flutter/flutter/issues/68273