Implement possibility to hide taskbar icon on Linux

This commit is contained in:
Ilya Fedin
2020-10-16 07:02:05 +04:00
committed by John Preston
parent 49e96d857a
commit 8f5b136003
6 changed files with 119 additions and 6 deletions
@@ -502,6 +502,25 @@ 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;
@@ -769,6 +788,10 @@ bool TrayIconSupported() {
: false;
}
bool SkipTaskbarSupported() {
return !IsWayland() && XCBSkipTaskbarSupported();
}
bool StartSystemMove(QWindow *window) {
if (IsWayland()) {
return StartWaylandMove(window);