mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Use new IsSupportedByWM XCB API from lib_base
This commit is contained in:
parent
d648d294ca
commit
f66cfb5684
2 changed files with 5 additions and 45 deletions
|
@ -451,25 +451,6 @@ bool ShowXCBWindowMenu(QWindow *window) {
|
||||||
return true;
|
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) {
|
bool SetXCBFrameExtents(QWindow *window, const QMargins &extents) {
|
||||||
const auto connection = base::Platform::XCB::GetConnectionFromQt();
|
const auto connection = base::Platform::XCB::GetConnectionFromQt();
|
||||||
if (!connection) {
|
if (!connection) {
|
||||||
|
@ -526,25 +507,6 @@ bool UnsetXCBFrameExtents(QWindow *window) {
|
||||||
return true;
|
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) {
|
Window::Control GtkKeywordToWindowControl(const QString &keyword) {
|
||||||
if (keyword == qstr("minimize")) {
|
if (keyword == qstr("minimize")) {
|
||||||
return Window::Control::Minimize;
|
return Window::Control::Minimize;
|
||||||
|
@ -804,7 +766,8 @@ bool TrayIconSupported() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SkipTaskbarSupported() {
|
bool SkipTaskbarSupported() {
|
||||||
return !IsWayland() && XCBSkipTaskbarSupported();
|
return !IsWayland()
|
||||||
|
&& base::Platform::XCB::IsSupportedByWM("_NET_WM_STATE_SKIP_TASKBAR");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartSystemMove(QWindow *window) {
|
bool StartSystemMove(QWindow *window) {
|
||||||
|
@ -848,11 +811,8 @@ bool UnsetWindowExtents(QWindow *window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowsNeedShadow() {
|
bool WindowsNeedShadow() {
|
||||||
if (!IsWayland() && XCBFrameExtentsSupported()) {
|
return !IsWayland()
|
||||||
return true;
|
&& base::Platform::XCB::IsSupportedByWM(kXCBFrameExtentsAtomName.utf16());
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Window::ControlsLayout WindowControlsLayout() {
|
Window::ControlsLayout WindowControlsLayout() {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit b0b13dc6098f62fcf58087e2a0987de3af55ae3f
|
Subproject commit dc89f34be5387bef731c59aeca3ca201e042ecc3
|
Loading…
Add table
Reference in a new issue