ESC key was not working on load of Scheduled Transaction Editor

This is due to trying to grab focus on the sheet when it was not
realized so add a check for the sheet being realized before grabbing
focus on it.
This commit is contained in:
Robert Fewell 2021-04-13 11:01:36 +01:00
parent b9789b66ca
commit 4e653729ba

View File

@ -1800,9 +1800,9 @@ gnc_split_reg_focus_on_sheet (GNCSplitReg *gsr)
GnucashRegister *reg = gsr->reg;
GnucashSheet *sheet = gnucash_register_get_sheet (reg);
// Make sure the sheet is the focus
if (!gtk_widget_has_focus(GTK_WIDGET (sheet)))
gtk_widget_grab_focus (GTK_WIDGET (sheet));
// Make sure the sheet is the focus only when it is realized
if (!gtk_widget_has_focus(GTK_WIDGET(sheet)) && gtk_widget_get_realized (GTK_WIDGET(sheet)))
gtk_widget_grab_focus (GTK_WIDGET(sheet));
}
void