diff -r 131d40cd805b libgui/src/main-window.cc --- a/libgui/src/main-window.cc Sun Jan 27 22:22:19 2013 +0100 +++ b/libgui/src/main-window.cc Mon Jan 28 07:15:35 2013 +0100 @@ -990,18 +990,6 @@ this, SLOT (focus_editor ())); connect (documentation_action, SIGNAL (triggered ()), this, SLOT (focus_documentation ())); - connect (_terminal_dock_widget, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_command_window_visible (bool))); - connect (_workspace_view, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_workspace_visible (bool))); - connect (_history_dock_widget, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_command_history_visible (bool))); - connect (_files_dock_widget, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_current_directory_visible (bool))); - connect (_file_editor, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_editor_visible (bool))); - connect (_documentation_dock_widget, SIGNAL (visibilityChanged (bool)), - this, SLOT (handle_documentation_visible (bool))); connect (reset_windows_action, SIGNAL (triggered ()), this, SLOT (reset_windows ())); @@ -1065,6 +1053,21 @@ addDockWidget (Qt::RightDockWidgetArea, _documentation_dock_widget); setStatusBar (_status_bar); + // connect visibility signals after adding the widgets + connect (_terminal_dock_widget, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_command_window_visible (bool))); + connect (_workspace_view, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_workspace_visible (bool))); + connect (_history_dock_widget, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_command_history_visible (bool))); + connect (_files_dock_widget, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_current_directory_visible (bool))); + connect (_file_editor, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_editor_visible (bool))); + connect (_documentation_dock_widget, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_documentation_visible (bool))); + + _octave_qt_event_listener = new octave_qt_event_listener (); octave_link::register_event_listener (_octave_qt_event_listener);