refactor: split mg_configure_cb main/dialog geometry paths; drop sess mutation

This commit is contained in:
2026-03-17 10:11:41 -06:00
parent 0155b07c9d
commit e90b68967c

View File

@@ -889,7 +889,7 @@ mg_configure_cb (GtkWidget *wid, GdkEventConfigure *event, session *sess)
{
gboolean changed = FALSE;
if (sess == NULL) /* for the main_window */
if (sess == NULL)
{
if (mg_gui)
{
@@ -900,7 +900,6 @@ mg_configure_cb (GtkWidget *wid, GdkEventConfigure *event, session *sess)
int win_width;
int win_height;
sess = current_sess;
gtk_window_get_position (GTK_WINDOW (wid), &win_left, &win_top);
gtk_window_get_size (GTK_WINDOW (wid), &win_width, &win_height);
@@ -930,10 +929,7 @@ mg_configure_cb (GtkWidget *wid, GdkEventConfigure *event, session *sess)
}
}
}
if (sess)
{
if (sess->type == SESS_DIALOG && prefs.hex_gui_win_save)
else if (sess->type == SESS_DIALOG && prefs.hex_gui_win_save)
{
int dialog_left;
int dialog_top;
@@ -967,7 +963,6 @@ mg_configure_cb (GtkWidget *wid, GdkEventConfigure *event, session *sess)
changed = TRUE;
}
}
}
if (changed)
{