From ece948be41062bccb8e22a6436810e93ccddd425 Mon Sep 17 00:00:00 2001 From: carlh Date: Sun, 17 Jul 2011 18:22:43 +0000 Subject: [PATCH] Fix vertical pane resizing during fullscreen/unfullscreen (#4119). git-svn-id: http://subversion.ardour.org/svn/ardour2/ardour2/branches/3.0@9889 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.cc | 35 ++++++++++++++++++++++++++++------- gtk2_ardour/editor.h | 2 ++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 2dfe22e54..daeac13fb 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -3940,12 +3940,16 @@ Editor::maximise_editing_space () edit_pane.set_position (post_maximal_horizontal_pane_position); } - if (post_maximal_editor_height) { - editor_summary_pane.set_position (post_maximal_vertical_pane_position - - abs(post_maximal_editor_height - pre_maximal_editor_height)); - } else { - editor_summary_pane.set_position (post_maximal_vertical_pane_position); - } + /* Hack: we must do this in an idle handler for it to work; see comment in + restore_editing_space() + */ + + Glib::signal_idle().connect ( + sigc::bind ( + sigc::mem_fun (*this, &Editor::idle_reset_vertical_pane_position), + post_maximal_vertical_pane_position + ) + ); if (Config->get_keep_tearoffs()) { _mouse_mode_tearoff->set_visible (true); @@ -3957,6 +3961,13 @@ Editor::maximise_editing_space () } +bool +Editor::idle_reset_vertical_pane_position (int p) +{ + editor_summary_pane.set_position (p); + return false; +} + void Editor::restore_editing_space () { @@ -3981,7 +3992,17 @@ Editor::restore_editing_space () post_maximal_editor_height = this->get_height(); edit_pane.set_position (pre_maximal_horizontal_pane_position + abs(this->get_width() - pre_maximal_editor_width)); - editor_summary_pane.set_position (pre_maximal_vertical_pane_position + abs(this->get_height() - pre_maximal_editor_height)); + + /* This is a bit of a hack, but it seems that if you set the vertical pane position + here it gets reset to some wrong value after this method has finished. Doing + the setup in an idle callback seems to work. + */ + Glib::signal_idle().connect ( + sigc::bind ( + sigc::mem_fun (*this, &Editor::idle_reset_vertical_pane_position), + pre_maximal_vertical_pane_position + ) + ); } /** diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 19be40b75..fe3275611 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -538,6 +538,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::HPaned edit_pane; Gtk::VPaned editor_summary_pane; + bool idle_reset_vertical_pane_position (int); + Gtk::EventBox meter_base; Gtk::HBox meter_box; Gtk::EventBox marker_base; -- 2.11.4.GIT