I’m trying to construct a GdkWindow from an external xwindow xid. The other window is already shown. I’m trying the following code:
GdkDisplayManager *mn = gdk_display_manager_get(); assert(mn); const gchar *env = getenv("DISPLAY"); assert(env); GdkDisplay *disp = gdk_display_manager_open_display(mn, env); assert(disp); GdkWindow *win = gdk_x11_window_foreign_new_for_display(disp, xid); // <-- external xid assert(win); // win is null
The bigger picture is that I’m trying to construct a custom GtkWidget containing this GdkWindow (the idea is to pass it to
webview_create(int, void *) which expects a GtkWindow or GtkWidget on linux. But I’m using an alternative toolkit from which I can get an X11 XID.