diff --git a/Xwt.Mac/Xwt.Mac/MacEngine.cs b/Xwt.Mac/Xwt.Mac/MacEngine.cs index 5f62df0d..8ad82e6c 100644 --- a/Xwt.Mac/Xwt.Mac/MacEngine.cs +++ b/Xwt.Mac/Xwt.Mac/MacEngine.cs @@ -124,6 +124,7 @@ namespace Xwt.Mac RegisterBackend (); RegisterBackend (); RegisterBackend (); + RegisterBackend (); } public override void RunApplication () @@ -194,7 +195,10 @@ namespace Xwt.Mac public override bool HasNativeParent (Widget w) { - ViewBackend wb = (ViewBackend)Toolkit.GetBackend (w); + var b = (IWidgetBackend) Toolkit.GetBackend (w); + if (b is XwtWidgetBackend) + b = ((XwtWidgetBackend)b).NativeBackend; + ViewBackend wb = (ViewBackend)b; return wb.Widget.Superview != null; } diff --git a/Xwt/Xwt.Backends/XwtWidgetBackend.cs b/Xwt/Xwt.Backends/XwtWidgetBackend.cs index 506c429e..6cb4c1a0 100644 --- a/Xwt/Xwt.Backends/XwtWidgetBackend.cs +++ b/Xwt/Xwt.Backends/XwtWidgetBackend.cs @@ -117,6 +117,10 @@ namespace Xwt.Backends Font = new Xwt.Drawing.Font (value); } } + + public IWidgetBackend NativeBackend { + get { return BackendHost.Backend; } + } object IWidgetBackend.NativeWidget { get { return BackendHost.Backend.NativeWidget; }