Thanks Pavel for the main idea
// Start an undo group.
cur.beginUndoGroup();
+ // re-focus the workarea after the action?
+ bool refocus_wa = false;
switch (cmd.action())
{
: item.parIDs();
docstring const arg = (type.empty()) ? id : id + " " + type;
dispatch(FuncRequest(cmd, arg));
+ refocus_wa = true;
break;
}
outline(cmd.action());
break;
+ case LFUN_LABEL_INSERT_AS_REFERENCE:
+ refocus_wa = true;
+ // fall through
default: {
FuncRequest tmpcmd(cmd);
if (inset)
inset->dispatch(cur, tmpcmd);
}
}
+ if (refocus_wa) {
+ QMainWindow * mw = static_cast<QMainWindow *>(&gui_view_);
+ if (mw) {
+ mw->activateWindow();
+ mw->setFocus();
+ }
+ }
cur.endUndoGroup();
}