Mercurial > hg > octave-nkf
diff libgui/src/m-editor/file-editor.cc @ 18613:17baa684892c stable
fix flashing while debuggung and editor is tabbed behind console (bug #41757)
* file-editor.cc (is_editor_console_tabbed): new function returning true
if editor is tabbed together with console;
(request_open_file): do not give focus to editor if debug pointer or
breakpoint marker is added and editor is tabbed with console
* file-editor.h: new function is_editor_console_tabbed
* main-window.h: new function get_dock_widget_list () returning the internal
list of all dock widgets
author | Torsten <ttl@justmail.de> |
---|---|
date | Tue, 04 Mar 2014 21:58:27 +0100 |
parents | 83cc56cc7cb7 |
children | de76baa76aa1 bfb735b70978 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -41,6 +41,7 @@ #include "octave-link.h" #include "utils.h" +#include "main-window.h" file_editor::file_editor (QWidget *p) : file_editor_interface (p) @@ -264,6 +265,23 @@ return false; } +bool +file_editor::is_editor_console_tabbed () +{ + main_window *w = static_cast<main_window *>(main_win ()); + QList<QDockWidget *> w_list = w->tabifiedDockWidgets (this); + QDockWidget *console = + static_cast<QDockWidget *> (w->get_dock_widget_list ().at (0)); + + for (int i = 0; i < w_list.count (); i++) + { + if (w_list.at (i) == console) + return true; + } + + return false; +} + void file_editor::request_open_file (const QString& openFileName, int line, bool debug_pointer, @@ -302,8 +320,11 @@ emit fetab_do_breakpoint_marker (insert, tab, line); } - emit fetab_set_focus (tab); - set_focus (); + if (! ((breakpoint_marker || debug_pointer) && is_editor_console_tabbed ())) + { + emit fetab_set_focus (tab); + set_focus (); + } } else { @@ -402,9 +423,12 @@ } } - // really show editor and the current editor tab - set_focus (); - emit file_loaded_signal (); + if (! ((breakpoint_marker || debug_pointer) && is_editor_console_tabbed ())) + { + // really show editor and the current editor tab + set_focus (); + emit file_loaded_signal (); + } } } }