Skip to content

slint::platform::NativeWindowHandle Class

class NativeWindowHandle;
C++
#include <slint-platform.h>
C++

An opaque, low-level window handle that internalizes everything necessary to exchange messages with the windowing system. This includes the connection to the display server, if necessary.

Note that this class does not provide any kind of ownership. The caller is responsible for ensuring that the pointers supplied to the constructor are valid throughout the lifetime of the NativeWindowHandle.

slint::platform::NativeWindowHandle::NativeWindowHandle()=delete
slint::platform::NativeWindowHandle::NativeWindowHandle(const NativeWindowHandle &)=delete
NativeWindowHandle & slint::platform::NativeWindowHandle::operator=(const NativeWindowHandle &)=delete
slint::platform::NativeWindowHandle::NativeWindowHandle(NativeWindowHandle &&other)

Creates a new NativeWindowHandle by moving the handle data from other into this NativeWindowHandle.

NativeWindowHandle & slint::platform::NativeWindowHandle::operator=(NativeWindowHandle &&other)

Creates a new NativeWindowHandle by moving the handle data from other into this NativeWindowHandle.

slint::platform::NativeWindowHandle::~NativeWindowHandle()

Destroys the NativeWindowHandle.

static NativeWindowHandle slint::platform::NativeWindowHandle::from_x11_xcb(uint32_t window, uint32_t visual_id, xcb_connection_t *connection, int screen)

Creates a new NativeWindowHandle from the given xcb_window_t window, xcb_visualid_t visual_id, XCB connection, and screen number.

static NativeWindowHandle slint::platform::NativeWindowHandle::from_x11_xlib(uint32_t window, unsigned long visual_id, void *display, int screen)

Creates a new NativeWindowHandle from the given XLib window, VisualID visual_id, Display display, and screen number.

static NativeWindowHandle slint::platform::NativeWindowHandle::from_wayland(wl_surface *surface, wl_display *display)

Creates a new NativeWindowHandle from the given wayland surface, and display.

static NativeWindowHandle slint::platform::NativeWindowHandle::from_appkit(NSView *nsview, NSWindow *nswindow)

Creates a new NativeWindowHandle from the given nsview, and nswindow.

static NativeWindowHandle slint::platform::NativeWindowHandle::from_win32(void *hwnd, void *hinstance)

Creates a new NativeWindowHandle from the given HWND hwnd, and HINSTANCE hinstance.


© 2026 SixtyFPS GmbH