uno icon indicating copy to clipboard operation
uno copied to clipboard

[X11] Add support for get the Uno's X11 window IntPtr

Open lindexi opened this issue 8 months ago • 5 comments

What would you like to be added

Add support for get the Uno's X11 window IntPtr

Why is this needed

Now, we can use GetNativeWindow to get the Uno native window. But The GetNativeWindow will return the internal Uno.WinUI.Runtime.Skia.X11.X11Window type on X11 platform. And we can not easy to use it without reflection:

#if HAS_UNO
        var x11Window = unoWindow.GetNativeWindow()!;
        var x11WindowType = x11Window.GetType();

        var x11WindowIntPtr =
            (IntPtr) x11WindowType.GetProperty("Window", BindingFlags.Instance | BindingFlags.Public)!.GetMethod!.Invoke(
                x11Window, null)!;
#else

You can find the above code in my demo: https://github.com/lindexi/lindexi_gd/tree/0f1d39d4f2bde2e60d790cb14302b5397ca0ae9c/UnoDemo/ChuchejairqaibalNallnowequyalgaw

For which platform

Skia.X11

Anything else we need to know?

No response

lindexi avatar Jun 18 '24 06:06 lindexi