mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 09:36:33 +01:00
forward port the carbon window position fix from 2.X
git-svn-id: svn://localhost/ardour2/branches/3.0@13069 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ec0a1b88bb
commit
c623cfe0f3
1 changed files with 13 additions and 6 deletions
|
|
@ -542,7 +542,7 @@ AUPluginUI::parent_carbon_window ()
|
||||||
{
|
{
|
||||||
#ifdef WITH_CARBON
|
#ifdef WITH_CARBON
|
||||||
NSWindow* win = get_nswindow ();
|
NSWindow* win = get_nswindow ();
|
||||||
int x, y;
|
Rect windowStructureBoundsRect;
|
||||||
|
|
||||||
if (!win) {
|
if (!win) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -555,7 +555,11 @@ AUPluginUI::parent_carbon_window ()
|
||||||
return -1;
|
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
|
/* compute how tall the title bar is, because we have to offset the position of the carbon window
|
||||||
by that much.
|
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
|
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
|
// create the cocoa window for the carbon one and make it visible
|
||||||
cocoa_parent = [[NSWindow alloc] initWithWindowRef: carbon_window];
|
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);
|
SetWindowActivationScope (carbon_window, kWindowActivationScopeNone);
|
||||||
|
|
||||||
_notify = [ [NotificationObject alloc] initWithPluginUI:this andCocoaParent:cocoa_parent andTopLevelParent:win ];
|
_notify = [ [NotificationObject alloc] initWithPluginUI:this andCocoaParent:cocoa_parent andTopLevelParent:win ];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue