The popup menu undo/redo has to have a different callback that does not check focus, its only precondition is a valid document, the popup can only be activated by right click on the edit pane so the focus check is not needed.
The callbacks for the GTK actions need to check both focus and valid document, so they need to be different callbacks.
The callback called by Geany keybindings doesn't need to check anything since `cb_func_editor_action()` has already done both, although it won't hurt to use either one of the others.