diff options
author | Robin Gareus <robin@gareus.org> | 2015-02-27 19:43:19 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-02-27 19:43:36 +0100 |
commit | e77e7f1f3d8e599f6df8c2c480745cbbab7e1e85 (patch) | |
tree | b28e791f825897e59c9a8541b3b507b3aefe4370 /gtk2_ardour/au_pluginui.mm | |
parent | 24efaa2992f6c534b938f0ad380bb5fc3787b81a (diff) |
fix carbon GUI focus/re-exposure
Diffstat (limited to 'gtk2_ardour/au_pluginui.mm')
-rw-r--r-- | gtk2_ardour/au_pluginui.mm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm index a577df9ab7..2dc468e500 100644 --- a/gtk2_ardour/au_pluginui.mm +++ b/gtk2_ardour/au_pluginui.mm @@ -210,7 +210,10 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert) create_cocoa_view (); } + low_box.add_events(Gdk::VISIBILITY_NOTIFY_MASK); + low_box.signal_realize().connect (mem_fun (this, &AUPluginUI::lower_box_realized)); + low_box.signal_visibility_notify_event ().connect (mem_fun (this, &AUPluginUI::lower_box_visibility_notify)); } AUPluginUI::~AUPluginUI () @@ -496,7 +499,7 @@ AUPluginUI::create_carbon_view () kWindowNoShadowAttribute| kWindowNoTitleBarAttribute); - if ((err = CreateNewWindow(kDocumentWindowClass, attr, &r, &carbon_window)) != noErr) { + if ((err = CreateNewWindow(kUtilityWindowClass, attr, &r, &carbon_window)) != noErr) { error << string_compose (_("AUPluginUI: cannot create carbon window (err: %1)"), err) << endmsg; CloseComponent (editView); return -1; @@ -626,6 +629,7 @@ AUPluginUI::parent_carbon_window () _notify = [ [NotificationObject alloc] initWithPluginUI:this andCocoaParent:cocoa_parent andTopLevelParent:win ]; [win addChildWindow:cocoa_parent ordered:NSWindowAbove]; + [win setAutodisplay:1]; // turn of GTK stuff for this window return 0; #else @@ -729,6 +733,19 @@ AUPluginUI::lower_box_realized () } } +bool +AUPluginUI::lower_box_visibility_notify (GdkEventVisibility* ev) +{ +#ifdef WITH_CARBON + if (carbon_window && ev->state != GDK_VISIBILITY_UNOBSCURED) { + ShowWindow (carbon_window); + ActivateWindow (carbon_window, TRUE); + return true; + } +#endif + return false; +} + void AUPluginUI::on_window_hide () { |