diff libgui/src/main-window.cc @ 27281:0915fec3d3a9

prevent gui from catching focus when its desktop workspace becomes active * file-editor.cc (focus): renamed into activate and make use of octave_dock_widget::activate; (set_focus): use qt setFocus instead of own old octave_dock_widget::focus; (request_new_file, request_close_file, active_tab_changed, handle_visibility, request_open_file): call new method activate instead of old focus; * file-editor.h: removed method focus and added new method activate * main-window.cc (focus_command_window): activate instead of focus; (editor_tabs_changed, construct_documentation_menu): use activate slot instead of focus; * octave-dock-widget.cc (make_window, make_widget, set_focus_predecessor): use qt setFocus instead of removed focus method; (activate): implementation of renamed method; (handle_visibility): moved implementation from header to here * octave-dock-widget.h: renamed focus into activate, moved implementation from here to cc-file, use setFocus in handle_visibility, moved implementation for handle_visibility from here to cc-file * terminal-dock-widget.cc (focus): removed virtual implementation * terminal-dock-widget.h: removed focus method
author Torsten Lilge <ttl-octave@mailbox.org>
date Mon, 22 Jul 2019 22:20:56 +0200
parents db687716fed6
children 189ca5990c5d
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Mon Jul 22 20:05:55 2019 +0200
+++ b/libgui/src/main-window.cc	Mon Jul 22 22:20:56 2019 +0200
@@ -247,7 +247,7 @@
 
   void main_window::focus_command_window (void)
   {
-    m_command_window->focus ();
+    m_command_window->activate ();
   }
 
   // catch focus changes and determine the active dock widget
@@ -2518,7 +2518,7 @@
         else
           {
             // action for focus of dock widget
-            connect (action, SIGNAL (triggered (void)), widget, SLOT (focus (void)));
+            connect (action, SIGNAL (triggered (void)), widget, SLOT (activate (void)));
           }
       }
     else
@@ -2614,7 +2614,7 @@
     QMenu *doc_menu = p->addMenu (tr ("Documentation"));
 
     m_ondisk_doc_action = add_action (doc_menu, QIcon (),
-                                      tr ("On Disk"), SLOT (focus ()), m_doc_browser_window);
+                                      tr ("On Disk"), SLOT (activate ()), m_doc_browser_window);
 
     m_online_doc_action = add_action (doc_menu, QIcon (),
                                       tr ("Online"), SLOT (open_online_documentation_page ()));