ben's pane resizing "fixes" for OSX, plus slightly more debugging for kbd events...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2011 14:52:05 +0000 (14:52 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 27 Sep 2011 14:52:05 +0000 (14:52 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@10141 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc
gtk2_ardour/mixer_ui.cc
gtk2_ardour/utils.cc

index ec5fe5c67307004a1e00768c4d62ea12d9b1b07a..a1c3a58539f37d09dd55d87c96fa698e2053d1be 100644 (file)
@@ -197,7 +197,6 @@ DragInfo::clear_copied_locations ()
        copied_locations.clear ();
 }
 
-#ifdef GTKOSX
 static void
 pane_size_watcher (Paned* pane)
 {
@@ -208,7 +207,7 @@ pane_size_watcher (Paned* pane)
           ugh.
        */
 
-       int max_width_of_lhs = GTK_WIDGET(pane->gobj())->allocation.width - 25;
+       int max_width_of_lhs = GTK_WIDGET(pane->gobj())->allocation.width - 62;
 
        gint pos = pane->get_position ();
 
@@ -216,7 +215,6 @@ pane_size_watcher (Paned* pane)
                pane->set_position (max_width_of_lhs);
        }
 }
-#endif
 
 Editor::Editor ()
        : 
@@ -747,10 +745,9 @@ Editor::Editor ()
        edit_pane.pack2 (the_notebook, false, true);
        
        edit_pane.signal_size_allocate().connect (bind (mem_fun(*this, &Editor::pane_allocation_handler), static_cast<Paned*> (&edit_pane)));
-#ifdef GTKOSX
+
        Glib::PropertyProxy<int> proxy = edit_pane.property_position();
        proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&edit_pane)));
-#endif
 
        top_hbox.pack_start (toolbar_frame, true, true);
 
index 8cb8dece9f075ace20ac2ded905d51d0d26ee784..7339a4a8dde626c67ff02f84822fb067b6d5562d 100644 (file)
@@ -59,6 +59,25 @@ using namespace std;
 
 using PBD::atoi;
 
+static void
+pane_size_watcher (Paned* pane)
+{
+       /* if the handle of a pane vanishes into (at least) the tabs of a notebook,
+          it is no longer accessible. so stop that. this doesn't happen on X11,
+          just the quartz backend.
+          
+          ugh.
+       */
+
+       gint pos = pane->get_position ();
+
+       if (pos < 22) {
+               pane->set_position (22);
+       }
+}
+
+
+
 Mixer_UI::Mixer_UI ()
        : Window (Gtk::WINDOW_TOPLEVEL)
 {
@@ -218,6 +237,10 @@ Mixer_UI::Mixer_UI ()
                                                        static_cast<Gtk::Paned*> (&rhs_pane1)));
        list_hpane.signal_size_allocate().connect (bind (mem_fun(*this, &Mixer_UI::pane_allocation_handler), 
                                                         static_cast<Gtk::Paned*> (&list_hpane)));
+
+       Glib::PropertyProxy<int> proxy = list_hpane.property_position();
+       proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&list_hpane)));
+
        
        global_vpacker.pack_start (list_hpane, true, true);
 
index 84482dd3287d905e2e8148ecd6c4e8a99933e29d..7fadf0e28adb83e47926b501a9a01c892aab1a79 100644 (file)
@@ -485,7 +485,7 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
        bool special_handling_of_unmodified_accelerators = false;
        bool allow_activating = true;
 
-//#define DEBUG_ACCELERATOR_HANDLING
+// #define DEBUG_ACCELERATOR_HANDLING
 #ifdef  DEBUG_ACCELERATOR_HANDLING
        //bool debug = (getenv ("ARDOUR_DEBUG_ACCELERATOR_HANDLING") != 0);
        bool debug=true;
@@ -510,7 +510,8 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
        if (debug) {
                cerr << "Win = " << win << " Key event: code = " << ev->keyval << " name = " << gdk_keyval_name (ev->keyval) << " state = " << hex << ev->state << dec 
                     << " ctrl " << ((ev->state & GDK_CONTROL_MASK) ? 1 : 0)
-                    << " alt " << ((ev->state & GDK_MOD1_MASK) ? 1 : 0)
+                    << " alt/mod1 " << ((ev->state & GDK_MOD1_MASK) ? 1 : 0)
+                    << " mod2 " << ((ev->state & GDK_MOD2_MASK) ? 1 : 0)
                     << " shift " << ((ev->state & GDK_SHIFT_MASK) ? 1 : 0)
                     << " cmd/meta " << ((ev->state & GDK_META_MASK) ? 1 : 0)
                     << " lock " << ((ev->state & GDK_LOCK_MASK) ? 1 : 0)
@@ -568,7 +569,9 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
 #ifdef DEBUG_ACCELERATOR_HANDLING
                                cerr << "Remapped " << gdk_keyval_name (ev->keyval) << " to " << gdk_keyval_name (keyval_without_alt) << endl;
 
-#endif                         ev->keyval = keyval_without_alt;
+#endif
+                               ev->keyval = keyval_without_alt;
+                               ev->group = 0;
                        }
                }
        }