fix: process damage notify event

This commit is contained in:
2025-12-19 16:03:06 +08:00
parent 0be1e76ba2
commit cc79c9b9e2
3 changed files with 15 additions and 9 deletions

View File

@@ -132,12 +132,8 @@ bool FdoSelectionManager::nativeEventFilter(const QByteArray &eventType, void *m
undock(destroyedWId);
}
} else if (responseType == m_damageEventBase + XCB_DAMAGE_NOTIFY) {
// const auto damagedWId = reinterpret_cast<xcb_damage_notify_event_t *>(ev)->drawable;
// const auto tmProxy = m_proxies.value(damagedWId);
// if (tmProxy) {
// tmProxy->update();
// xcb_damage_subtract(m_x11Interface->connection(), m_damageWatches[damagedWId], XCB_NONE, XCB_NONE);
// }
const auto damagedWId = reinterpret_cast<xcb_damage_notify_event_t *>(ev)->drawable;
m_trayManager->notifyIconChanged(damagedWId);
} else if (responseType == XCB_CONFIGURE_REQUEST) {
// const auto event = reinterpret_cast<xcb_configure_request_event_t *>(ev);
// const auto tmProxy = m_proxies.value(event->window);

View File

@@ -53,6 +53,11 @@ void TrayManager1::notifyIconChanged(xcb_window_t win)
return;
}
if (!m_icons[win]) {
qCDebug(SNIPROXY) << "EnableNotification is false, not sending changed signal for:" << win;
return;
}
qCDebug(SNIPROXY) << "Icon changed:" << win;
Q_EMIT Changed(static_cast<uint32_t>(win));
}
@@ -88,6 +93,11 @@ QString TrayManager1::GetName(uint32_t win)
void TrayManager1::EnableNotification(uint32_t win, bool enabled)
{
// TODO: Implement
qCDebug(SNIPROXY) << "TODO: EnableNotification for" << win << "=" << enabled;
if (!m_icons.contains(win)) {
return;
}
m_icons[win] = enabled;
qCDebug(SNIPROXY) << "EnableNotification for" << win << "=" << enabled;
}

View File

@@ -76,5 +76,5 @@ Q_SIGNALS:
private:
TrayManager1Adaptor * m_adaptor;
QHash<xcb_window_t, bool> m_icons;
QHash<xcb_window_t, bool> m_icons; // <winid, enableNotify>
};