Cache QWindow native interface check in WindowMarginsSupported()
It couldn't be changed at runtime anyway
This commit is contained in:
parent
164877a0dc
commit
e0c2500127
1 changed files with 8 additions and 4 deletions
|
|
@ -533,10 +533,14 @@ std::optional<bool> IsOverlapped(
|
||||||
|
|
||||||
bool WindowMarginsSupported() {
|
bool WindowMarginsSupported() {
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||||
using namespace QNativeInterface::Private;
|
static const auto WaylandResult = [] {
|
||||||
QWindow window;
|
using namespace QNativeInterface::Private;
|
||||||
window.create();
|
QWindow window;
|
||||||
if (window.nativeInterface<QWaylandWindow>()) {
|
window.create();
|
||||||
|
return bool(window.nativeInterface<QWaylandWindow>());
|
||||||
|
}();
|
||||||
|
|
||||||
|
if (WaylandResult) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // Qt >= 6.5.0
|
#endif // Qt >= 6.5.0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue