re-enable Carbon plugin GUI support; fix misplacement of Carbon plugin GUI windows because of differences between Carbon/Cocoa/GTK coordinate spaces
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@12932 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8ca5537ccb
commit
4e019c4617
|
@ -4,6 +4,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#define WITH_CARBON
|
||||||
|
|
||||||
#ifdef WITH_CARBON
|
#ifdef WITH_CARBON
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
#include <AudioUnit/AudioUnitCarbonView.h>
|
#include <AudioUnit/AudioUnitCarbonView.h>
|
||||||
|
|
|
@ -527,7 +527,7 @@ AUPluginUI::get_nswindow ()
|
||||||
void
|
void
|
||||||
AUPluginUI::activate ()
|
AUPluginUI::activate ()
|
||||||
{
|
{
|
||||||
#ifdef WITN_CARBON
|
#ifdef WITH_CARBON
|
||||||
ActivateWindow (carbon_window, TRUE);
|
ActivateWindow (carbon_window, TRUE);
|
||||||
#endif
|
#endif
|
||||||
// [cocoa_parent makeKeyAndOrderFront:nil];
|
// [cocoa_parent makeKeyAndOrderFront:nil];
|
||||||
|
@ -546,7 +546,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;
|
||||||
|
@ -558,8 +558,12 @@ AUPluginUI::parent_carbon_window ()
|
||||||
error << _("AUPluginUI: no top level window!") << endmsg;
|
error << _("AUPluginUI: no top level window!") << endmsg;
|
||||||
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.
|
||||||
|
@ -572,7 +576,11 @@ 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
|
||||||
|
|
||||||
MoveWindow (carbon_window, x, y + titlebar_height + top_box.get_height() + packing_extra, false);
|
/* 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);
|
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
|
||||||
|
|
Loading…
Reference in New Issue