Bug 229227 - [GTK] resize broken for wrapped X11 windows
Summary: [GTK] resize broken for wrapped X11 windows
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-17 22:56 PDT by lucianito
Modified: 2021-08-17 22:56 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lucianito 2021-08-17 22:56:43 PDT
Adding a web view to a GtkWindow created by wrapping a native X11 window works but then the web view does not respond to window size changes.

    Window child = XCreateWindow(display, parent, 0, 0, initial_width, initial_height, 0,
                                 CopyFromParent, CopyFromParent, CopyFromParent, 0, 0);

    GdkWindow* gdkChild = gdk_x11_window_foreign_new_for_display(gdk_display_get_default(), child);
    GtkWindow* window = GTK_WINDOW(gtk_widget_new(GTK_TYPE_WINDOW, NULL));
    g_signal_connect(window, "realize", G_CALLBACK(gtk_widget_set_window), gdkChild);

    WebKitWebView* webview = WEBKIT_WEB_VIEW(webkit_web_view_new());
    gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(webView));

    ... web view displays and works as expected ....

    gtk_window_resize(window, some_width, some_height);  //  web view content dimensions are  never resized