Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Tizen.WindowSystem] change to use tizen_core_wl instead of efl_util#7694

Open
Inhong wants to merge 1 commit into
Samsung:main from
Inhong:remove_efl_util_WindowSystem
Open

[Tizen.WindowSystem] change to use tizen_core_wl instead of efl_util #7694
Inhong wants to merge 1 commit into
Samsung:main from
Inhong:remove_efl_util_WindowSystem

Conversation

@Inhong

@Inhong Inhong commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description of Change

API Changes

  • ACR:

gemini-code-assist[bot] reacted with eyes emoji

@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 transitions the input generation and gesture modules from the EFL-based utility library to the new Tizen Core Wayland library (libtizen-core-wl.so.0). It introduces the TizenCoreWlDisplay class to manage the Wayland display connection and updates InputGenerator and InputGesture to require a display instance upon initialization. The review feedback highlights several important improvements: ensuring TizenCoreWlDisplay properly shuts down on creation failure to avoid resource leaks, implementing a finalizer for unmanaged resource cleanup, throwing an ObjectDisposedException if Connect is called after disposal, validating that the name parameter is not null in InputGenerator to prevent native crashes, and correcting the usage of ArgumentNullException to pass the parameter name instead of a descriptive string.

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 on lines +69 to +74
int ret = Interop.TizenCoreWl.DisplayCreate(out _display);
if (ret != (int)Interop.TizenCoreWl.ErrorCode.None)
{
Tizen.Log.Error("TIZEN_CORE_WL", $"TizenCoreWlDisplay: DisplayCreate() failed with error={ret}");
ErrorCodeThrow((Interop.TizenCoreWl.ErrorCode)ret);
}

@gemini-code-assist gemini-code-assist Bot Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

If DisplayCreate fails, Interop.TizenCoreWl.Init() has already succeeded. We must call Interop.TizenCoreWl.Shutdown() to decrement the initialization reference count and avoid resource leaks before throwing the exception.

 int ret = Interop.TizenCoreWl.DisplayCreate(out _display);
 if (ret != (int)Interop.TizenCoreWl.ErrorCode.None)
 {
 Tizen.Log.Error("TIZEN_CORE_WL", $"TizenCoreWlDisplay: DisplayCreate() failed with error={ret}");
 Interop.TizenCoreWl.Shutdown();
 ErrorCodeThrow((Interop.TizenCoreWl.ErrorCode)ret);
 }

Comment on lines +71 to 76
public InputGenerator(TizenCoreWlDisplay display, InputGeneratorDevices deviceType, string name, bool sync = false)
{
_deviceType = deviceType;
if (sync)
if (display == null)
{
_inputGeneratorHandle = Interop.InputGenerator.SyncInit(deviceType, name);
throw new ArgumentNullException("display is null.");
}

@gemini-code-assist gemini-code-assist Bot Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

In addition to correcting the ArgumentNullException parameter name for display, we should also validate that name is not null. Passing a null name to CreateWithName or CreateWithSync can cause native crashes.

 public InputGenerator(TizenCoreWlDisplay display, InputGeneratorDevices deviceType, string name, bool sync = false)
 {
 if (display == null)
 {
 throw new ArgumentNullException(nameof(display));
 }
 if (name == null)
 {
 throw new ArgumentNullException(nameof(name));
 }

Comment on lines +84 to +87
public void Connect(string name = null)
{
Tizen.Log.Debug("TIZEN_CORE_WL", $"TizenCoreWlDisplay: Connect(name={name ?? "null"}) called");
int ret = Interop.TizenCoreWl.DisplayConnect(_display, name);

@gemini-code-assist gemini-code-assist Bot Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Calling Connect after the display has been disposed will pass IntPtr.Zero to the native library, which can cause undefined behavior or crashes. We should throw an ObjectDisposedException if the instance is already disposed.

 public void Connect(string name = null)
 {
 if (disposed)
 {
 throw new ObjectDisposedException(nameof(TizenCoreWlDisplay));
 }
 Tizen.Log.Debug("TIZEN_CORE_WL", $"TizenCoreWlDisplay: Connect(name={name ?? "null"}) called");
 int ret = Interop.TizenCoreWl.DisplayConnect(_display, name);

Comment on lines +96 to +103
/// <summary>
/// Dispose.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

@gemini-code-assist gemini-code-assist Bot Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since TizenCoreWlDisplay directly manages an unmanaged resource (IntPtr _display) and implements IDisposable, it should implement a finalizer to ensure that the native resources are released if the user forgets to call Dispose().

 /// <summary>
 /// Finalizes an instance of the <see cref="TizenCoreWlDisplay"/> class.
 /// </summary>
 ~TizenCoreWlDisplay()
 {
 Dispose(false);
 }
 /// <summary>
 /// Dispose.
 /// </summary>
 public void Dispose()
 {
 Dispose(true);
 GC.SuppressFinalize(this);
 }

Comment on lines +45 to +50
public InputGenerator(TizenCoreWlDisplay display, InputGeneratorDevices deviceType)
{
if (display == null)
{
throw new ArgumentNullException("display is null.");
}

@gemini-code-assist gemini-code-assist Bot Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The first parameter of ArgumentNullException should be the parameter name (nameof(display)), not the error message. Passing a descriptive message as the first argument results in a confusing exception message like Parameter 'display is null.' cannot be null.

 public InputGenerator(TizenCoreWlDisplay display, InputGeneratorDevices deviceType)
 {
 if (display == null)
 {
 throw new ArgumentNullException(nameof(display));
 }

Comment on lines +67 to 72
public InputGesture(TizenCoreWlDisplay display)
{
_handler = Interop.InputGesture.Initialize();
if (_handler.IsInvalid)
if (display == null)
{
int err = Tizen.Internals.Errors.ErrorFacts.GetLastResult();
ErrorUtils.ThrowIfError(err, "Failed to initialize InputGesture");
throw new ArgumentNullException("display is null.");
}

@gemini-code-assist gemini-code-assist Bot Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The first parameter of ArgumentNullException should be the parameter name (nameof(display)), not the error message.

 public InputGesture(TizenCoreWlDisplay display)
 {
 if (display == null)
 {
 throw new ArgumentNullException(nameof(display));
 }

Copy link
Copy Markdown
Collaborator

Internal API Changed

Added: 8, Removed: 3, Changed: 0

Added

+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.WindowSystem.InputGenerator::.ctor(Tizen.WindowSystem.TizenCoreWlDisplay,Tizen.WindowSystem.InputGeneratorDevices,System.String,System.Boolean)
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.WindowSystem.InputGenerator::.ctor(Tizen.WindowSystem.TizenCoreWlDisplay,Tizen.WindowSystem.InputGeneratorDevices)
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.WindowSystem.InputGesture::.ctor(Tizen.WindowSystem.TizenCoreWlDisplay)
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Tizen.WindowSystem.TizenCoreWlDisplay
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.WindowSystem.TizenCoreWlDisplay::.ctor()
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.WindowSystem.TizenCoreWlDisplay::Connect(System.String)
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.WindowSystem.TizenCoreWlDisplay::Dispose()
+ /// <since_tizen>none</since_tizen
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ System.Void Tizen.WindowSystem.TizenCoreWlDisplay::Dispose(System.Boolean)

Removed

- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.WindowSystem.InputGenerator::.ctor(System.String,System.Boolean)
- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.WindowSystem.InputGenerator::.ctor(Tizen.WindowSystem.InputGeneratorDevices,System.String,System.Boolean)
- /// <since_tizen>none</since_tizen
- [EditorBrowsable(EditorBrowsableState.Never)]
- System.Void Tizen.WindowSystem.InputGesture::.ctor()

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

Reviewers

1 more reviewer

@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /