How can I have more than one child with a GdkSurface?

I have code. It seems I cant put a child with a surface inside another child with a surface. My code gives the following error

Gtk:ERROR:../gtk-3.96.0/gtk/gtkwidget.c:3939:gtk_widget_get_surface_allocation: assertion failed: (GTK_IS_WINDOW (parent) || GTK_IS_POPOVER (parent))
Bail out! Gtk:ERROR:../gtk-3.96.0/gtk/gtkwidget.c:3939:gtk_widget_get_surface_allocation: assertion failed: (GTK_IS_WINDOW (parent) || GTK_IS_POPOVER (parent))
Aborted (core dumped)

Is it possible for me to have two widgets both with surfaces?

You mean sharing the same GdkSurface (GTK4) / GdkWindow (GTK3) in the same widget? No, you can’t.

A widget can have more than one GdkSurface/GdkWindow—though if you’re using GTK4 you should not really use GdkSurface at all, unless you’re writing a top level widget. Multiple widgets cannot share the same windowing system surface; at most, a widget can render something on its parent’s surface.

No I need each widget to have its own GdkSurface. I want to call surfaces to the front incase a surface is at the back

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.