X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fau_pluginui.mm;h=f394e305c89bf36507ae615e623b41993e096185;hb=611dcdd24932222d676da4d9a4dca643f79db4a4;hp=0433d2502d6c9ae991d36daea9f3bbe3f6769b21;hpb=11415b49be02f16495c95d6286c485ac8afc5189;p=ardour.git diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm index 0433d2502d..f394e305c8 100644 --- a/gtk2_ardour/au_pluginui.mm +++ b/gtk2_ardour/au_pluginui.mm @@ -542,7 +542,7 @@ AUPluginUI::parent_carbon_window () { #ifdef WITH_CARBON NSWindow* win = get_nswindow (); - int x, y; + Rect windowStructureBoundsRect; if (!win) { return -1; @@ -555,7 +555,11 @@ AUPluginUI::parent_carbon_window () return -1; } - toplevel->get_window()->get_root_origin (x, y); + /* figure out where the cocoa parent window is in carbon-coordinate space, which + differs from both cocoa-coordinate space and GTK-coordinate space + */ + + GetWindowBounds((WindowRef) [win windowRef], kWindowStructureRgn, &windowStructureBoundsRect); /* compute how tall the title bar is, because we have to offset the position of the carbon window by that much. @@ -568,13 +572,16 @@ AUPluginUI::parent_carbon_window () int packing_extra = 6; // this is the total vertical packing in our top level window + /* move into position, based on parent window position */ + MoveWindow (carbon_window, + windowStructureBoundsRect.left, + windowStructureBoundsRect.top + titlebar_height + top_box.get_height() + packing_extra, + false); + ShowWindow (carbon_window); + // create the cocoa window for the carbon one and make it visible cocoa_parent = [[NSWindow alloc] initWithWindowRef: carbon_window]; - PositionWindow (carbon_window, [cocoa_parent windowRef], kWindowCascadeStartAtParentWindowScreen); - MoveWindow (carbon_window, x, y + titlebar_height + top_box.get_height() + packing_extra, false); - ShowWindow (carbon_window); - SetWindowActivationScope (carbon_window, kWindowActivationScopeNone); _notify = [ [NotificationObject alloc] initWithPluginUI:this andCocoaParent:cocoa_parent andTopLevelParent:win ];