dot
vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks
| 1 | diff --color -ruN a/xembed-sni-proxy/sniproxy.cpp b/xembed-sni-proxy/sniproxy.cpp |
| 2 | |
| 3 | |
| 4 | |
| 5 | const auto title = Title(); |
| 6 | // we always need /some/ ID so if no window title exists, just use the winId. |
| 7 | if (title.isEmpty()) { |
| 8 | + // Prefer the window class: unlike the winId it is the same on every launch, |
| 9 | + // so trays can match on it (Wine leaves the title of its tray windows empty). |
| 10 | + const KWindowInfo window(m_windowId, NET::Properties(), NET::WM2WindowClass); |
| 11 | + const QByteArray windowClass = window.windowClassClass(); |
| 12 | + if (!windowClass.isEmpty()) { |
| 13 | + return QString::fromUtf8(windowClass); |
| 14 | + } |
| 15 | return QString::number(m_windowId); |
| 16 | } |
| 17 | return title; |