Set focus to sketcher window when a new handler is activated to ensure proper handling of keys, espcially Escape.

This commit is contained in:
Markus Lampert
2018-09-09 19:54:24 -07:00
committed by wmayer
parent 36faeb247a
commit e4dbc896df

View File

@@ -374,6 +374,12 @@ void ViewProviderSketch::activateHandler(DrawSketchHandler *newHandler)
Mode = STATUS_SKETCH_UseHandler;
edit->sketchHandler->sketchgui = this;
edit->sketchHandler->activated(this);
// make sure receiver has focus so immediately pressing Escape will be handled by
// ViewProviderSketch::keyPressed() and dismiss the active handler, and not the entire
// sketcher editor
Gui::MDIView *mdi = Gui::Application::Instance->activeDocument()->getActiveView();
mdi->setFocus();
}
void ViewProviderSketch::deactivateHandler()