diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index c9cc56b101..ed721e06c4 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -661,11 +661,11 @@ static CGColorSpaceRef qt_mac_displayColorSpace(const QWidget *widget) bool qt_macWindowIsTextured(const QWidget *window) { - NSWindow *nswindow = static_cast( - QApplication::platformNativeInterface()->nativeResourceForWindow("NSWindow", window->windowHandle())); - if (!nswindow) - return false; - return ([nswindow styleMask] & NSTexturedBackgroundWindowMask) ? true : false; + if (QWindow *w = window->windowHandle()) + if (w->handle()) + if (NSWindow *nswindow = static_cast(QGuiApplication::platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("NSWindow"), w))) + return ([nswindow styleMask] & NSTexturedBackgroundWindowMask) ? true : false; + return false; } /*****************************************************************************