215 Commits

Author SHA1 Message Date
Matej Knopp
dc1c45a5c5 FlView: Handle leave-notify-event (flutter/engine#26181)
* FlView: Handle leave-notify-event

Fixes https://github.com/flutter/flutter/issues/82648

* Fix leave notify during mouse grab

* Send kAdd pointer event on enter notify
2021-05-19 12:56:00 +02:00
Robert Ancell
88f7648d42 Fix GIR transfer annotation 2021-05-14 11:03:33 +12:00
Matej Knopp
5f6eb6479b Implement smooth resizing for Linux (flutter/engine#25884) 2021-05-07 08:44:01 -07:00
J-P Nurmi
4268ae8f75 [Linux] revise dark theme detection (flutter/engine#25535) 2021-05-06 20:14:01 -07:00
Chris Bracken
9b4a0264d5 Correct typos throughout the engine/embedder (flutter/engine#25346)
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.
2021-04-01 11:08:19 -07:00
Yuhui Huang
8d051fad2f fix printing Failed to determine valid GL format (flutter/engine#24964) 2021-03-12 22:36:25 -08:00
huanghongxun
87509d8518 Fix incorrect texture format with OpenGL ES 2021-03-12 11:27:02 +13:00
Yuhui Huang
e56f733369 Fix high CPU consumption (flutter/engine#24944) 2021-03-11 10:32:44 -08:00
Chris Bracken
e2a2a79a1d Add framebuffer destruction_callback for Linux (flutter/engine#24901)
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.
2021-03-10 10:26:49 -08:00
J-P Nurmi
069154f7ee [linux] Fix text selection via Shift+Home/End (flutter/engine#24623)
Adds TextInputModel::SelectToBeginning/End() and applies when shift key is pressed.
2021-03-05 08:51:33 -08:00
Chris Bracken
b638110ac3 Add missing header guard, namespace (flutter/engine#24423)
TextRange was missing a namespace declaration and header guards.
2021-02-15 13:26:43 -08:00
George Wright
a46f817aee Move shell/platform/common/cpp to shell/platform/common (flutter/engine#24210) 2021-02-04 14:06:02 -08:00
huanghongxun
a5b9730ca5 No longer redraw window every frame to reduce CPU consumption 2021-02-04 09:30:26 +13:00
Yuhui Huang
0561c75b4d Refactor FlRenderer to platform-independent implementation (flutter/engine#24011)
Refactor FlRenderer to platform-independent implementation
2021-02-03 11:31:51 +13:00
Damian Wrobel
c3a7c60296 Fix argument specifier for g_warning() (flutter/engine#23674)
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]
2021-01-28 14:36:02 -08:00
Robert Ancell
124ce62dd2 Use the scroll multiplier that the Chromium source uses.
Fixes https://github.com/flutter/flutter/issues/71385
2021-01-14 09:06:36 +13:00
Robert Ancell
7436af8647 Only handle smooth scroll events.
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.
2021-01-14 09:06:36 +13:00
Robert Ancell
0cadee4e98 Add accessibility suport to Linux shell. (flutter/engine#19634)
Add accessibility support to the Linux shell
2021-01-13 13:49:48 +13:00
Robert Ancell
af2850ee0d 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
5d9a19e3c0 Fix indexing error in Linux key event handling (flutter/engine#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
Robert Ancell
543a61f8c6 Re-enable test 2021-01-11 11:36:40 +13:00
Robert Ancell
17d45cd5a3 Fix double frees in FlSettingsPlugin tests.
Fixes https://github.com/flutter/flutter/issues/73517
2021-01-11 11:36:40 +13:00
Robert Ancell
7ca7ce114f Remove debugging code 2021-01-11 11:36:40 +13:00
Greg Spencer
70bba34e51 Make pending event handling more lenient to allow out of order responses (flutter/engine#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
Jason Simmons
2c5db12c82 Skip the FlEngineTest.SettingsPlugin test (flutter/engine#23516)
See https://github.com/flutter/flutter/issues/73517
2021-01-07 17:03:28 -08:00
Damian Wrobel
0c179e5d66 Fix argument specifier for g_warning() (flutter/engine#23138) 2021-01-07 15:34:03 -08:00
Robert Ancell
ae52e3b83c Implement settings channel for the Linux shell (flutter/engine#22486)
Implement settings channel for the Linux shell

Fixes https://github.com/flutter/flutter/issues/65591
2021-01-05 12:28:43 +13:00
Robert Ancell
7505bd518a Add engine tests for Linux shell 2021-01-05 09:50:52 +13:00
Robert Ancell
6fc7c5e846 Implement SystemSound.play 2020-12-11 13:38:47 +13:00
Robert Ancell
f128a93e70 Replace g_object_weak_ref with g_object_add_weak_pointer
In these cases it is simpler to use the latter. Newer code is using this method.
2020-12-11 09:07:26 +13:00
Robert Ancell
516165af02 Stop potential lockup due to GHashTable being modified when cleared. (flutter/engine#22917)
This doesn't seem to be currently occuring, but I triggered such a lockup
when modifying other code.
2020-12-09 07:26:35 +13:00
Greg Spencer
49935d5547 Add delayed event delivery for Linux. (flutter/engine#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
d7793f5cfb Fix typos and fix some env var state leakage in tests (flutter/engine#22576)
This just fixes some typos, and a small state leak in some of the tests that set env variables.
2020-11-17 21:51:37 -08:00
Robert Ancell
8e621546e8 Fix typo in documentation for FlPlatformPlugin (flutter/engine#22426) 2020-11-12 12:02:44 +13:00
William Wold
3fe0d1f1d0 Set the IM context when showing the input method (flutter/engine#21896) 2020-11-06 09:22:17 +13:00
stuartmorgan
156dafb961 Switch Linux embedding to proc table embedder API (flutter/engine#22280)
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.
2020-11-04 15:12:44 -08:00
Omar Emara
fc87f2df63 Fix Linux handling of window exposure events (flutter/engine#22268)
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.
2020-11-04 16:43:47 +13:00
Robert Ancell
396ad5a9a9 Add braces on if statements to match linter style (flutter/engine#22130) 2020-11-03 12:32:39 +13:00
Robert Ancell
524a96de10 Fix warning when no entrypoing args provided. (flutter/engine#22136)
Fixes errors like:
GLib-CRITICAL **: 14:20:17.248: g_strv_length: assertion 'str_array != NULL' failed

Introduced in fe489569a722816acab038ebe0f882722d2434ee
2020-10-30 14:57:35 +13:00
Robert Ancell
904e5d491e Fix incorrect parameter used for self object (flutter/engine#22135)
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.
2020-10-30 14:52:24 +13:00
J-P Nurmi
30b8a62f7f Fix FlTextInputPlugin tear down (flutter/engine#22007) 2020-10-29 15:18:04 -07:00
J-P Nurmi
f1621c0370 Fix typos in FlValue docs (flutter/engine#21875) 2020-10-29 15:13:04 -07:00
Anirudh Balaji
07498fbc67 Refactor make_mock_engine into fl_test (flutter/engine#21585) 2020-10-29 15:08:03 -07:00
Robert Ancell
eb7e81fe4c Add FlEventChannel (flutter/engine#21316)
Related to https://github.com/flutter/flutter/issues/65270
2020-10-22 15:06:52 -07:00
stuartmorgan
10a7448f57 Revert "Revert "Explicitly make the X connection for EGL. (#21831)" (#21851)" (flutter/engine#21871)
This reverts commit 12cd3076aff3accf56e399b0d56f69b3f3fdf520.
2020-10-22 13:50:14 -07:00
George Wright
fe489569a7 Plumb through Dart entrypoint arguments on the Linux embedder (flutter/engine#21933) 2020-10-22 09:47:04 +13:00
Damian Wrobel
16f0aff1a2 Fix linking issue (missing wayland-client library) (flutter/engine#21408)
As fl_renderer_wayland.cc uses directly some of the wayland-client
related functions it should also add this library as a dependency.
2020-10-20 05:47:40 -07:00
Chris Bracken
617f0096e3 Add multi-step input method support for Linux (flutter/engine#21897)
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.
2020-10-19 16:25:56 -07:00
J-P Nurmi
3e2a675dfa FlTextInputPlugin: fix memory leaks (flutter/engine#21879)
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.
2020-10-19 16:23:10 -07:00
Chris Bracken
aa0ad5a83e Update FLUTTER_NOLINT uses to include issue link (flutter/engine#21921)
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
2020-10-16 16:08:36 -07:00