possible fix for #2292
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 17 Jun 2008 15:32:50 +0000 (15:32 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 17 Jun 2008 15:32:50 +0000 (15:32 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3467 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/ardour_ui_mixer.cc
gtk2_ardour/editor.cc

index 6c937c23098b8bebabd914ba052ff3b99847c96a..ed62d5c138923188413becb4c45c6a238e533594 100644 (file)
@@ -339,6 +339,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
        AudioClock   big_clock;
        Gtk::Window* big_clock_window;
 
+       void float_big_clock (Gtk::Window* parent);
+       bool main_window_state_event_handler (GdkEventWindowState*, bool window_was_editor);
+
        void update_transport_clocks (nframes_t pos);
        void record_state_changed ();
 
index 9b90ca45f87d20fd5e406782325848bd7ef597e1..239327229b26b40b46266a1828eca1ee90950f79 100644 (file)
@@ -408,3 +408,24 @@ ARDOUR_UI::handle_locations_change (Location* ignored)
                }
        }
 }
+
+bool
+ARDOUR_UI::main_window_state_event_handler (GdkEventWindowState* ev, bool window_was_editor)
+{
+       if (window_was_editor) {
+
+               if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) && 
+                   (ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
+                       float_big_clock (editor);
+               }
+
+       } else {
+
+               if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) && 
+                   (ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
+                       float_big_clock (mixer);
+               }
+       }
+
+       return false;
+}
index ee2e10f175b2420a5f5b34eebe49d1b2e3f9e29c..974d8aadf1f01958d61d480008f9cb3998aea4cf 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <gtkmm2ext/utils.h>
 #include <gtkmm2ext/window_title.h>
+#include <gtk/gtk.h>
 
 #include "ardour_ui.h"
 #include "public_editor.h"
@@ -73,6 +74,7 @@ ARDOUR_UI::create_editor ()
        }
 
        editor->Realized.connect (mem_fun (*this, &ARDOUR_UI::editor_realized));
+       editor->signal_window_state_event().connect (sigc::bind (mem_fun (*this, &ARDOUR_UI::main_window_state_event_handler), true));
 
        return 0;
 }
@@ -856,3 +858,16 @@ ARDOUR_UI::setup_clock ()
 
        manage_window (*big_clock_window);
 }
+
+void
+ARDOUR_UI::float_big_clock (Gtk::Window* parent)
+{
+       if (big_clock_window) {
+               if (parent) {
+                       big_clock_window->set_transient_for (*parent);
+               } else {
+                       gtk_window_set_transient_for (big_clock_window->gobj(), (GtkWindow*) 0);
+               }
+       }
+}
+
index dfc5d644b0765fb924f846eb59d7ffc2d5d35d7c..6373bc8b8ccdaa53ec504c4a9351299c5799a852 100644 (file)
@@ -41,6 +41,8 @@ ARDOUR_UI::create_mixer ()
                return -1;
        }
 
+       mixer->signal_window_state_event().connect (bind (mem_fun (*this, &ARDOUR_UI::main_window_state_event_handler), false));
+
        return 0;
 }
 
index 8ca91bffbb428e53bde455027de4bd00afebeac4..14c7ec0301b4e6cee2ffac168a4c2e0cf61beaa9 100644 (file)
@@ -4006,8 +4006,8 @@ Editor::maximise_editing_space ()
                post_maximal_pane_position = edit_pane.get_width();
        }
 
-
        fullscreen();
+
        if(post_maximal_editor_width) {
                edit_pane.set_position (post_maximal_pane_position - 
                        abs(post_maximal_editor_width - pre_maximal_editor_width));