Use new IsSupportedByWM XCB API from lib_base
This commit is contained in:
parent
d648d294ca
commit
f66cfb5684
|
@ -451,25 +451,6 @@ bool ShowXCBWindowMenu(QWindow *window) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool XCBFrameExtentsSupported() {
|
||||
const auto connection = base::Platform::XCB::GetConnectionFromQt();
|
||||
if (!connection) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto frameExtentsAtom = base::Platform::XCB::GetAtom(
|
||||
connection,
|
||||
kXCBFrameExtentsAtomName.utf16());
|
||||
|
||||
if (!frameExtentsAtom.has_value()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ranges::contains(
|
||||
base::Platform::XCB::GetWMSupported(connection),
|
||||
*frameExtentsAtom);
|
||||
}
|
||||
|
||||
bool SetXCBFrameExtents(QWindow *window, const QMargins &extents) {
|
||||
const auto connection = base::Platform::XCB::GetConnectionFromQt();
|
||||
if (!connection) {
|
||||
|
@ -526,25 +507,6 @@ bool UnsetXCBFrameExtents(QWindow *window) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool XCBSkipTaskbarSupported() {
|
||||
const auto connection = base::Platform::XCB::GetConnectionFromQt();
|
||||
if (!connection) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto skipTaskbarAtom = base::Platform::XCB::GetAtom(
|
||||
connection,
|
||||
"_NET_WM_STATE_SKIP_TASKBAR");
|
||||
|
||||
if (!skipTaskbarAtom.has_value()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ranges::contains(
|
||||
base::Platform::XCB::GetWMSupported(connection),
|
||||
*skipTaskbarAtom);
|
||||
}
|
||||
|
||||
Window::Control GtkKeywordToWindowControl(const QString &keyword) {
|
||||
if (keyword == qstr("minimize")) {
|
||||
return Window::Control::Minimize;
|
||||
|
@ -804,7 +766,8 @@ bool TrayIconSupported() {
|
|||
}
|
||||
|
||||
bool SkipTaskbarSupported() {
|
||||
return !IsWayland() && XCBSkipTaskbarSupported();
|
||||
return !IsWayland()
|
||||
&& base::Platform::XCB::IsSupportedByWM("_NET_WM_STATE_SKIP_TASKBAR");
|
||||
}
|
||||
|
||||
bool StartSystemMove(QWindow *window) {
|
||||
|
@ -848,11 +811,8 @@ bool UnsetWindowExtents(QWindow *window) {
|
|||
}
|
||||
|
||||
bool WindowsNeedShadow() {
|
||||
if (!IsWayland() && XCBFrameExtentsSupported()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return !IsWayland()
|
||||
&& base::Platform::XCB::IsSupportedByWM(kXCBFrameExtentsAtomName.utf16());
|
||||
}
|
||||
|
||||
Window::ControlsLayout WindowControlsLayout() {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b0b13dc6098f62fcf58087e2a0987de3af55ae3f
|
||||
Subproject commit dc89f34be5387bef731c59aeca3ca201e042ecc3
|
Loading…
Reference in New Issue