Don't regrow a window the user made smaller

This commit is contained in:
Mars-Wave
2026-08-19 18:19:03 +02:00
parent 73067cde9d
commit 60c03bee74
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -303,6 +303,12 @@ static void resize_to_fit(struct wd_state *state) {
}
GtkRequisition natural;
gtk_widget_get_preferred_size(state->window, NULL, &natural);
bool grew = natural.width > state->window_natural.width
|| natural.height > state->window_natural.height;
state->window_natural = natural;
if (!grew) {
return;
}
int grow_width = natural.width - gtk_widget_get_allocated_width(state->window);
int grow_height = natural.height - gtk_widget_get_allocated_height(state->window);
if (grow_width > 0 || grow_height > 0) {
+1
View File
@@ -201,6 +201,7 @@ struct wd_state {
struct wd_point pan_start;
GtkWidget *window;
GtkRequisition window_natural;
GtkWidget *main_box;
GtkWidget *header_stack;
GtkWidget *stack_switcher;