summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-07-17 18:22:43 +0000
committerCarl Hetherington <carl@carlh.net>2011-07-17 18:22:43 +0000
commit8786d5c9c21322e0cd08488b31ee3b4bed2c68d6 (patch)
treebf24e40a5ae754c21fe47c123d867bb98ff1f1b3 /gtk2_ardour/editor.cc
parent7e8e8b4e7289d6b4f677c5aa8d00a0c02cd8f857 (diff)
Fix vertical pane resizing during fullscreen/unfullscreen
(#4119). git-svn-id: svn://localhost/ardour2/branches/3.0@9889 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r--gtk2_ardour/editor.cc35
1 files changed, 28 insertions, 7 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 2dfe22e54f..daeac13fba 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
+ )
+ );
}
/**