embed a X11 window in a gtk+3 widget

Viewed 611

I would like to embed a simple X11 window in a gtk widget.

I don't know if I am being clear as I am quite a newbie in both X11 and gtk. So here is a quick schema: schema of the issue

So is this even possible, any advice on how to make this work ? I feel like all I need to do is inherit from GtkWidget and set its GdkWindow to a wrapper of the XID like this:

win = gdk_x11_window_foreign_new_for_display(display, xid);
gtk_widget_set_window(myWidget, win);

But I was not sucessful this way, all I get is two top level windows as shown below. my unsuccessful attempt

I am running Fedora 32 on X11, NOT wayland

thanks!

0 Answers
Related