Support tizen-core window - #195
Conversation
Introduce a use_tcore GN flag (surfaced as the --use-tcore build option)
that switches the window and input-method backends from Ecore/ecore_wl2
to the tizen-core-wl / tizen-core-imf APIs.
- Add tizen_window_tcore_wl and tizen_input_method_context_tcore,
selected in BUILD.gn when use_tcore is set.
- Reimplement the clipboard on tizen-core-wl for tcore builds.
- Expose the native window handle via FlutterDesktopViewGetNativeHandle,
and document that --use-tcore builds return a tizen_core_wl_window_h
while default builds return an Ecore_Wl2_Window*.
- Install the tizen-core-* sysroot packages for Tizen 10.0 and above.
- Reject --use-tcore on Tizen versions below 10.
Extract the libvd-win-util.so access shared by both window backends into
TizenWindowUtil (tizen_window_util.{h,cc}). The TV profile cursor,
mouse-pointer and unsupported-toast helpers each used to dlopen the
library, resolve its symbols and dlclose it inline, so adding the tcore
backend would have duplicated that block eight times. The new class
resolves the six symbols once per instance and keeps the existing
behaviour, including bailing out with the feature disabled when the
library or a symbol is unavailable.
Squashed from flutter-tizen#170 and rebased onto master. The DALI/NUI sysroot
packages removed upstream are not reintroduced, and the work-in-progress
key-event trace logging is dropped.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9e9385909
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- BindKeys(): build the whole keygrab list before setting it. tizen-core-wl has no per-key equivalent of ecore_wl2_window_keygrab_set(), and tizen_core_wl_window_set_keygrab_list() keeps only the last list it was given, one entry per window, so grabbing the 28 keys of kBindableSystemKeys one call at a time left 27 of them untracked and cost 28 round trips. Pass them as a single list instead. - Filter keys through the input method whenever editing is active, not only while the input panel is visible, and treat WILL_SHOW as shown. Typing with a hardware keyboard into a focused text field used to bypass tizen-core IMF entirely, losing dead-key composition, IME commits and preedit updates. Ported from the ecore backend's ShouldFilterKey(). - Build the clipboard string from the byte count the DATA_READY event reports, bounded by strnlen(). A payload that fills all len bytes carries no trailing NUL, so strlen() read past the end of the buffer. - Require --api-version 11.0 or higher for --use-tcore. The Tizen 10.0 repository publishes tizen-core and tizen-core-devel but neither tizen-core-wl nor tizen-core-imf, and every tizen_core_wl / tizen_core_imf API used here is @since_tizen 11.0. tools/gn accepted 10.0 while generate_sysroot.py only installed the packages above it, so a generated 10.0 sysroot could not compile the configuration gn had accepted. - Map the IMF key event from the matching tizen-core-wl fields: keyname to keyname, keysymbol to key, and compose to both string and compose. The event mirrors Ecore's naming, so passing keyname as key and keysymbol as string shifted every field by one and could commit "period" instead of ".". - Guard the IMF context and the clipboard display against a failed construction. Both deliberately return with a null handle, but the object stays installed, and the IMF methods only had an FT_ASSERT, which compiles away under NDEBUG; destruction therefore called tizen-core IMF with a null context in release builds. - Drop comments that restate the line below them, and the commented-out GetDeviceKindFromEventType(), which nothing calls.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e46a3ab022
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
GetWindowId() returned the tizen_core_wl_window_h address, which PlatformChannel hands to TizenShell::InitializeSoftkey(uint32_t) and on to tzsh_softkey_create(). A 64-bit pointer truncated to 32 bits is not a window ID, so the softkey was never created on the common profile. libtzsh resolves tzsh_window through a toolkit backend. The EFL backend finds the window in ecore_wl2 and uses wl_proxy_get_id() of its wl_surface; libtzsh_backend_tcore, added in Tizen 11.0 together with TZSH_TOOLKIT_TYPE_TCORE_WAYLAND, walks tizen_core_wl_display_get_window_list() and compares wl_proxy_get_id() of each window's surface. Both expect the surface object ID, so return that and select the tcore backend when the embedder is built with --use-tcore. The native handle now goes straight to tizen-core-imf, the one caller that wants a handle rather than an ID.
Adds
--use-tcore, which swaps the window, input-method, clipboard and softkey backends from EFL (ecore_wl2/ecore_imf) totizen-core-wl/tizen-core-imf, so the embedder keeps working on images where EFL is deprecated. Off by default.Requires api-version 11.0 or higher — tizen-core-wl / tizen-core-imf ship only on Tizen 11.0 and every API used here is
@since_tizen 11.0.libvd-win-util.sohelpers moved into a newTizenWindowUtil, sotizen_window_ecore_wl2.ccloses its owndlopen/dlsymblock (-102/+18). Intended to be behaviour-neutral.FlutterDesktopViewGetNativeHandle()returns a different type in a tcore build (tizen_core_wl_window_hvsEcore_Wl2_Window*). Signature and exported symbols are unchanged, but plugins that cast the result must handle it.