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() {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
using namespace QNativeInterface::Private;
|
||||
QWindow window;
|
||||
window.create();
|
||||
if (window.nativeInterface<QWaylandWindow>()) {
|
||||
static const auto WaylandResult = [] {
|
||||
using namespace QNativeInterface::Private;
|
||||
QWindow window;
|
||||
window.create();
|
||||
return bool(window.nativeInterface<QWaylandWindow>());
|
||||
}();
|
||||
|
||||
if (WaylandResult) {
|
||||
return true;
|
||||
}
|
||||
#endif // Qt >= 6.5.0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue