# HG changeset patch # User Torsten # Date 1420369111 -3600 # Node ID 52c51472b6b9d622ace8272886c795b4a8046433 # Parent b0ba6653305ad9849b7877ea75eb86a11a05217d improved search for active dock-widget after focus has changed * main-window.cc (focus_changed): check new widget for qscintilla-widget, do not change editor style sheet when focus switches from editor to find dialog in order to prevent some side effects in the find dialog diff -r b0ba6653305a -r 52c51472b6b9 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Sat Jan 03 10:05:06 2015 -0500 +++ b/libgui/src/main-window.cc Sun Jan 04 11:58:31 2015 +0100 @@ -174,6 +174,12 @@ if (dock) break; // it is a QDockWidget ==> exit loop + if (qobject_cast (w_new)) + { + dock = static_cast (editor_window); + break; // it is the editor window ==> exit loop + } + w_new = qobject_cast (w_new->previousInFocusChain ()); if (w_new == start) break; // we have arrived where we began ==> exit loop @@ -181,15 +187,16 @@ count++; } + // editor needs extra handling + octave_dock_widget *edit_dock_widget = + static_cast (editor_window); // if new dock has focus, emit signal and store active focus - if (dock != _active_dock) + // except editor changes to a dialog (dock=0) + if ((dock || _active_dock != edit_dock_widget) && (dock != _active_dock)) { // signal to all dock widgets for updating the style emit active_dock_changed (_active_dock, dock); - // if editor gets/loses focus, shortcuts and menus have to be updated - octave_dock_widget *edit_dock_widget = - static_cast (editor_window); if (edit_dock_widget == dock) emit editor_focus_changed (true); else if (edit_dock_widget == _active_dock)