[GTK4] Window jumps to a larger size when resizing

Hello,

I’ve encountered an issue with GTK4 on GNOME 46 (Wayland) when the display scaling of the second monitor is set to 200%.

If the application is launched on the first monitor (scaling: 100%), it displays correctly at startup.
However, as soon as I click the window border to resize it, the window jumps from 600×400 to 1200×800, before I even start dragging. This happens even with an empty window.

Here is the minimal code to reproduce it:

static void
on_activate(GtkApplication *app, gpointer user_data)
{
    GtkWidget *win = gtk_application_window_new(app);
    gtk_window_set_default_size(GTK_WINDOW(win), 600, 400);
    gtk_widget_show(win);
}

int
main(int argc, char *argv[])
{
    GtkApplication *app =
        gtk_application_new("mytest.app.com", G_APPLICATION_DEFAULT_FLAGS);

    g_signal_connect(app, "activate", G_CALLBACK(on_activate), NULL);

    return g_application_run(G_APPLICATION(app), argc, argv);
}

Any guidance or recommended workaround would be appreciated.

Thanks in advance,

1 Like