Skip to content

[NUI] Remove internal API to call Native signal emit directly + Empty checker method#7745

Open
hinohie wants to merge 1 commit into
Samsung:DevelNUIfrom
hinohie:remove_signal_emit
Open

[NUI] Remove internal API to call Native signal emit directly + Empty checker method#7745
hinohie wants to merge 1 commit into
Samsung:DevelNUIfrom
hinohie:remove_signal_emit

Conversation

@hinohie

@hinohie hinohie commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Most of event lifecycle of native side designed that signal invoked at native side, and C# just consume the events. Since most of events also need to change some native side status too, directly emit signals at C# side must not works well.

To guard some mis-implements for future developer, delete those features, and just keep 3 functions - GetConnectionCount, Connect, Disconnect.

TODO : Tizen.NUI.Components Navigator use AnimationSignal.Emit(), which is not recommanded. Since Navigator code implemented that finished callback comes immediatly, which is not match with DALi animation common behavior, we must change Navigator code first. After then, we can remove AnimationSignal.Emit().

TODO : AccessibilityDoAction() Looks not a common logic, and we may have similar API to emit native callback without touch emit API directly. We need to bind it first, and then remove AccessibilityDoAction() side Emit() API calls

Description of Change

API Changes

  • ACR:

@TizenAPI-Bot

Copy link
Copy Markdown
Collaborator

Build Error:

src/Tizen.NUI/src/internal/Animation/AnimationSignal.cs(71,31): error CS0117: 'Interop.Animation' does not contain a definition for 'AnimationSignalEmit' [src/Tizen.NUI/Tizen.NUI.csproj]

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors event signal handling across Tizen.NUI by removing unused Empty() and Emit() methods from internal signal classes and their Interop bindings, and updates public event unsubscription logic to use using statements for proper disposal. The code review identified critical logical errors in FocusManager.cs where impossible null checks prevent signal disconnection. Additionally, the reviewer pointed out several instances across various detectors and components where missing disposed checks, missing null assignments after disposal, or unconditional wrapper allocations could lead to native crashes, memory leaks, or inefficiencies during event unsubscription.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/Tizen.NUI/src/public/Input/FocusManager.cs Outdated
Comment thread src/Tizen.NUI/src/public/Input/FocusManager.cs Outdated
Comment thread src/Tizen.NUI/src/public/Events/PanGestureDetector.cs
Comment thread src/Tizen.NUI/src/public/Animation/Animation.cs
Comment thread src/Tizen.NUI/src/internal/Transition/TransitionSet.cs Outdated
Comment thread src/Tizen.NUI/src/public/Events/TapGestureDetector.cs
Comment thread src/Tizen.NUI/src/public/Utility/TTSPlayer.cs
Comment thread src/Tizen.NUI/src/public/Window/GLWindowEvent.cs Outdated
Comment thread src/Tizen.NUI/src/public/Window/GLWindowEvent.cs Outdated
Comment thread src/Tizen.NUI/src/public/Window/GLWindowEvent.cs Outdated
@hinohie hinohie force-pushed the remove_signal_emit branch from 56d62a2 to a293eb3 Compare July 9, 2026 17:29
@TizenAPI-Bot

Copy link
Copy Markdown
Collaborator

Internal API Changed

Added: 0, Removed: 0, Changed: 2

Changed

/// <since_tizen>none</since_tizen
+ [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
System.Void Tizen.NUI.GLWindow::VisibiltyChangedSignalEmit(System.Boolean)

/// <since_tizen>none</since_tizen
+ [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
System.Void Tizen.NUI.Window::VisibiltyChangedSignalEmit(System.Boolean)

… checker method

Most of event lifecycle of native side designed that signal invoked at native side, and C# just consume the events.
Since most of events also need to change some native side status too, directly emit signals at C# side must not works well.

To guard some mis-implements for future developer, delete those features, and just keep 3 functions - GetConnectionCount, Connect, Disconnect.

TODO : Tizen.NUI.Components Navigator use AnimationSignal.Emit(), which is not recommanded.
Since Navigator code implemented that finished callback comes immediatly, which is not match with DALi animation common behavior,
we must change Navigator code first. After then, we can remove AnimationSignal.Emit().

TODO : AccessibilityDoAction() Looks not a common logic, and we may have similar API to emit native callback without touch emit API directly.
We need to bind it first, and then remove AccessibilityDoAction() side Emit() API calls

Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
@hinohie hinohie force-pushed the remove_signal_emit branch from a293eb3 to f2ef845 Compare July 9, 2026 17:46
@TizenAPI-Bot

Copy link
Copy Markdown
Collaborator

Internal API Changed

Added: 0, Removed: 0, Changed: 2

Changed

/// <since_tizen>none</since_tizen
+ [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
System.Void Tizen.NUI.GLWindow::VisibiltyChangedSignalEmit(System.Boolean)

/// <since_tizen>none</since_tizen
+ [Obsolete]
[EditorBrowsable(EditorBrowsableState.Never)]
System.Void Tizen.NUI.Window::VisibiltyChangedSignalEmit(System.Boolean)

@hinohie

hinohie commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@jaehyun0cho Could you please check that we can invoke callback events synchronously instead of call AnimationFinishedEmit() directly, at Tizen.NUI.Components.Navigator?
Not an ugent but needto be fixed somedays, since Animation class' finished callback emit at C# side is not a good situation.

@dongsug-song Could you check whether some other codes(like Flux, OneUI) use internal methods what I removed at this PR?

@JoonghyunCho

Copy link
Copy Markdown
Member

🤖 [AI Review]

Reviewed — no findings.

Scope checked:

  • Verified no remaining callers of the removed Empty()/Emit() wrappers or their interop externs across Tizen.NUI, Tizen.NUI.Components, Tizen.NUI.Wearable, and Tizen.NUI.Scene3D at the PR head — the only surviving .Emit() caller is Navigator using AnimationSignal.Emit(), which this PR deliberately keeps with a TODO, and the remaining .Empty() hits are PropertyMap/PropertyArray/Any, unrelated to signals.
  • Checked add/remove/Dispose symmetry in all ~15 reworked event accessors (Animation, TransitionSet, FocusManager, WidgetView ×6, VideoView, GLWindowEvent ×4, StyleManager, TTSPlayer, Timer, PropertyNotification, 5 gesture detectors): callbacks are nulled after disconnect and recreated on re-subscribe, so subscribe → unsubscribe → resubscribe still reconnects the native signal.
  • Confirmed no public API break: classes losing public members (CaptureSignal, PropertyNotifySignal, GLWindowVisibilityChangedEvent, KeyEventSignal, VoidSignal, ...) are all internal sealed; the two behavior-changed public methods (VisibiltyChangedSignalEmit in WindowEvent/GLWindowEvent) are EditorBrowsable(Never)-hidden and now additionally marked Obsolete.
  • Verified null-safety of the new 'disposed == false' guards in Animation.Finished / TransitionSet.FinishedEvent / Timer.Tick: finishedCallbackOfNative and timerTickCallbackOfNative are constructor-initialized IntPtrs, so Disconnect-before-any-add cannot pass a null delegate.
  • Noted the rework also fixes pre-existing wrong disconnect guards in FocusManager.FocusChanged/FocusGroupChanged (the old remove accessors tested 'callback == null', so the native connection was never released) and replaces manual Dispose() calls with using declarations, removing signal-wrapper leaks on early return.

No 🔴 critical issues, no 🟡 suggestions to flag.


Automated review — final merge decision rests with human reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants