Skip to content

Support tizen-core window - #195

Open
JSUYA wants to merge 4 commits into
flutter-tizen:mainfrom
JSUYA:tcore_so
Open

Support tizen-core window#195
JSUYA wants to merge 4 commits into
flutter-tizen:mainfrom
JSUYA:tcore_so

Conversation

@JSUYA

@JSUYA JSUYA commented Aug 21, 2026

Copy link
Copy Markdown
Member

Adds --use-tcore, which swaps the window, input-method, clipboard and softkey backends from EFL (ecore_wl2 / ecore_imf) to tizen-core-wl / tizen-core-imf, so the embedder keeps working on images where EFL is deprecated. Off by default.

$) tools/generate_sysroot.py --api-version 11.0 --arch arm64   # adds the tizen-core packages
$) tools/gn --target-arch arm64 --api-version 11.0 --use-tcore --target-dir tizen_arm64_11.0

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.

  • The TV-only libvd-win-util.so helpers moved into a new TizenWindowUtil, so tizen_window_ecore_wl2.cc loses its own dlopen/dlsym block (-102/+18). Intended to be behaviour-neutral.
  • FlutterDesktopViewGetNativeHandle() returns a different type in a tcore build (tizen_core_wl_window_h vs Ecore_Wl2_Window*). Signature and exported symbols are unchanged, but plugins that cast the result must handle it.

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.
@JSUYA

JSUYA commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

#170

@JSUYA JSUYA mentioned this pull request Aug 21, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread flutter/shell/platform/tizen/tizen_window_tcore_wl.cc Outdated
Comment thread flutter/shell/platform/tizen/tizen_window_tcore_wl.cc
Comment thread flutter/shell/platform/tizen/tizen_clipboard.cc Outdated
Comment thread tools/generate_sysroot.py
Comment thread flutter/shell/platform/tizen/tizen_input_method_context_tcore.cc
Comment thread flutter/shell/platform/tizen/tizen_input_method_context_tcore.cc
Comment thread flutter/shell/platform/tizen/tizen_clipboard.cc
- 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.
@JSUYA

JSUYA commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread flutter/shell/platform/tizen/tizen_window_util.h
Comment thread flutter/shell/platform/tizen/tizen_window_tcore_wl.cc
Comment thread flutter/shell/platform/tizen/tizen_window_tcore_wl.cc Outdated
Comment thread flutter/shell/platform/tizen/tizen_window_tcore_wl.cc
Comment thread flutter/shell/platform/tizen/tizen_clipboard.cc
JSUYA added 2 commits August 25, 2026 16:09
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.
@JSUYA JSUYA self-assigned this Aug 25, 2026
@JSUYA JSUYA added the enhancement New feature or request label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant