new initial window size algorithm - #380
Conversation
xBZZZZ
commented
Jun 21, 2026
- old algorithm:

- new algorithm:

cwendling
left a comment
There was a problem hiding this comment.
Not a complete review and I didn't look into the logic changes yet, but there's a few things that should be changed in any case.
lukefromdc
left a comment
There was a problem hiding this comment.
I just tested this as requested in the wayland session (with wayfire). As of now wayfire scales down the oversize window of an oversize image with master, but with this applied this window is scaled down slightly smaller. Different logic, different scaledown, indicating this seems to work fine in wayfire and thus more broadly in wlroots based wayland compositors.
| gtk_widget_get_allocation (window->priv->view, &view_rect); | ||
|
|
||
| GdkRectangle window_rect; | ||
| gtk_widget_get_allocation (GTK_WIDGET (window), &window_rect); |
There was a problem hiding this comment.
You removed the gtk_widget_realize (GTK_WIDGET (window)); above, but are reading the allocation here. This might return garbage.
There was a problem hiding this comment.
gtk_widget_realize also does gtk_widget_realize parent widget: https://github.com/GNOME/gtk/blob/369c97465c780b25e43b30747de0734ddf420770/gtk/gtkwidget.c#L5524
can window not be parent (of parent of parent …) of window->priv->view?
old algorithm's windows don't fit on screen