Use new Platform::IsX11
This commit is contained in:
parent
7d18c8687b
commit
db65fca0aa
1 changed files with 24 additions and 16 deletions
|
|
@ -161,6 +161,8 @@ bool TranslucentWindowsSupported(QPoint globalPosition) {
|
|||
if (::Platform::IsWayland()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (::Platform::IsX11()) {
|
||||
if (const auto native = QGuiApplication::platformNativeInterface()) {
|
||||
if (const auto desktop = QApplication::desktop()) {
|
||||
if (const auto screen = base::QScreenNearestTo(globalPosition)) {
|
||||
|
|
@ -178,6 +180,8 @@ bool TranslucentWindowsSupported(QPoint globalPosition) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +197,7 @@ bool WindowExtentsSupported() {
|
|||
|
||||
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
namespace XCB = base::Platform::XCB;
|
||||
if (!::Platform::IsWayland()
|
||||
if (::Platform::IsX11()
|
||||
&& XCB::IsSupportedByWM(kXCBFrameExtentsAtomName.utf16())) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -210,13 +214,15 @@ bool SetWindowExtents(QWindow *window, const QMargins &extents) {
|
|||
#else // DESKTOP_APP_QT_PATCHED
|
||||
return false;
|
||||
#endif // !DESKTOP_APP_QT_PATCHED
|
||||
} else {
|
||||
} else if (::Platform::IsX11()) {
|
||||
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
return SetXCBFrameExtents(window, extents);
|
||||
#else // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
return false;
|
||||
#endif // DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UnsetWindowExtents(QWindow *window) {
|
||||
|
|
@ -227,13 +233,15 @@ bool UnsetWindowExtents(QWindow *window) {
|
|||
#else // DESKTOP_APP_QT_PATCHED
|
||||
return false;
|
||||
#endif // !DESKTOP_APP_QT_PATCHED
|
||||
} else {
|
||||
} else if (::Platform::IsX11()) {
|
||||
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
return UnsetXCBFrameExtents(window);
|
||||
#else // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
return false;
|
||||
#endif // DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ShowWindowMenu(QWindow *window) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue