GimpUi.widget_free_native_handle

function widget_free_native_handle(widget: Gtk.Widget): Uint8Array {
    // Gjs wrapper for gimp_widget_free_native_handle()
}
  

Disposes a widget's native window handle created asynchronously after a previous call to gimp_widget_set_native_handle. This disposes what the pointer points to, a *GBytes, if any. Call this when the widget and the window handle it owns is being disposed.

This should be called at least once, paired with set_native_handle. This knows how to free @window_handle, especially that on some platforms, an asynchronous callback must be canceled else it might call back with the pointer, after the widget and its private is freed.

This is safe to call when deferenced @window_handle is NULL, when the window handle was never actually set, on Wayland where actual setting is asynchronous.

!!! The word "handle" has two meanings. A "window handle" is an ID of a window. A "handle" also commonly means a pointer to a pointer, in this case **GBytes. @window_handle is both kinds of handle.

widget

a Gtk.Window

Returns

same pointer previously passed to set_native_handle