mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Add _GTK_APPLICATION_ID support
This commit is contained in:
parent
629314cfa2
commit
f542a026ec
1 changed files with 19 additions and 14 deletions
|
@ -111,31 +111,36 @@ void XCBSetDesktopFileName(QWindow *window) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto desktopFileAtom = base::Platform::XCB::GetAtom(
|
|
||||||
connection,
|
|
||||||
"_KDE_NET_WM_DESKTOP_FILE");
|
|
||||||
|
|
||||||
const auto utf8Atom = base::Platform::XCB::GetAtom(
|
const auto utf8Atom = base::Platform::XCB::GetAtom(
|
||||||
connection,
|
connection,
|
||||||
"UTF8_STRING");
|
"UTF8_STRING");
|
||||||
|
|
||||||
if (!desktopFileAtom.has_value() || !utf8Atom.has_value()) {
|
if (!utf8Atom.has_value()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto filenameAtoms = {
|
||||||
|
base::Platform::XCB::GetAtom(connection, "_GTK_APPLICATION_ID"),
|
||||||
|
base::Platform::XCB::GetAtom(connection, "_KDE_NET_WM_DESKTOP_FILE"),
|
||||||
|
};
|
||||||
|
|
||||||
const auto filename = QGuiApplication::desktopFileName()
|
const auto filename = QGuiApplication::desktopFileName()
|
||||||
.chopped(8)
|
.chopped(8)
|
||||||
.toUtf8();
|
.toUtf8();
|
||||||
|
|
||||||
xcb_change_property(
|
for (const auto atom : filenameAtoms) {
|
||||||
connection,
|
if (atom.has_value()) {
|
||||||
XCB_PROP_MODE_REPLACE,
|
xcb_change_property(
|
||||||
window->winId(),
|
connection,
|
||||||
*desktopFileAtom,
|
XCB_PROP_MODE_REPLACE,
|
||||||
*utf8Atom,
|
window->winId(),
|
||||||
8,
|
*atom,
|
||||||
filename.size(),
|
*utf8Atom,
|
||||||
filename.data());
|
8,
|
||||||
|
filename.size(),
|
||||||
|
filename.data());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue