mirror of
https://github.com/artizirk/wdisplays.git
synced 2026-10-03 12:55:42 +03:00
Don't regrow a window the user made smaller
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user