Potential fix for confusion for Input/Output buttons on tracks with audio+midi ports
[ardour.git] / gtk2_ardour / au_pluginui.mm
index fc773f54aeef979b84691e4d0c9235ed790c8897..76b94781d5021b97ab5d764a281f9432561a3ba0 100644 (file)
@@ -121,7 +121,7 @@ dump_view_tree (NSView* view, int depth)
        } 
 }
 
-- (void)auViewResized:(NSNotification *)notification;
+- (void)auViewResized:(NSNotification *)notification
 {
         (void) notification; // stop complaints about unusued argument
        plugin_ui->cocoa_view_resized();
@@ -430,7 +430,6 @@ AUPluginUI::create_cocoa_view ()
 void
 AUPluginUI::cocoa_view_resized ()
 {
-        GtkRequisition topsize = top_box.size_request ();
         NSWindow* window = get_nswindow ();
         NSRect windowFrame= [window frame];
         NSRect new_frame = [au_view frame];
@@ -657,7 +656,10 @@ AUPluginUI::parent_cocoa_window ()
 
        /* move the au_view down so that it doesn't overlap the top_box contents */
 
-       NSPoint origin = { 0, static_cast<CGFloat> (a.height) };
+       const int spacing = 6;  // main vbox spacing
+       const int pad     = 4;  // box pad
+
+       NSPoint origin = { spacing + pad, static_cast<CGFloat> (a.height) + (2 * spacing) + pad };
 
        [au_view setFrameOrigin:origin];
         [view addSubview:au_view positioned:NSWindowBelow relativeTo:NULL];
@@ -675,6 +677,13 @@ AUPluginUI::parent_cocoa_window ()
        return 0;
 }
 
+void
+AUPluginUI::grab_focus()
+{
+       if (au_view) {
+               [au_view becomeFirstResponder];
+       }
+}
 void
 AUPluginUI::forward_key_event (GdkEventKey* ev)
 {