From 51507fa3ef75b8a1ed8ad04780085d6fb97546d5 Mon Sep 17 00:00:00 2001 From: fangshichao Date: Tue, 7 Feb 2023 16:02:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=82=B9=E5=87=BB=E6=89=98=E7=9B=98?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E5=9B=BE=E6=A0=87=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sendclick发送消息响应时,没有判断wayland下的情况,直接return。 Log: 修复点击托盘企业微信图标,无反应的问题 Influence: 托盘图标点击的问题 Bug: https://pms.uniontech.com/bug-view-185343.html --- frame/item/appitem.cpp | 2 ++ plugins/tray/xembedtraywidget.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index 1b6f7b389..1876482ce 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -488,6 +488,8 @@ QPoint AppItem::appIconPosition() const void AppItem::updateWindowInfos(const WindowInfoMap &info) { + if (info.size() <= 0) + return; m_windowInfos = info; m_currentWindowId = info.firstKey(); if (m_appPreviewTips) diff --git a/plugins/tray/xembedtraywidget.cpp b/plugins/tray/xembedtraywidget.cpp index 7f00bab89..ef14bd0e3 100644 --- a/plugins/tray/xembedtraywidget.cpp +++ b/plugins/tray/xembedtraywidget.cpp @@ -367,7 +367,7 @@ void XEmbedTrayWidget::sendClick(uint8_t mouseButton, int x, int y) return; m_sendHoverEvent->stop(); - auto c = QX11Info::connection(); + auto c = IS_WAYLAND_DISPLAY ? m_xcbCnn :QX11Info::connection(); if (!c) { qWarning() << "QX11Info::connection() is " << c; return; @@ -379,7 +379,7 @@ void XEmbedTrayWidget::sendClick(uint8_t mouseButton, int x, int y) Display *display = IS_WAYLAND_DISPLAY ? m_display : QX11Info::display(); - if (m_injectMode == XTest) { + if (m_injectMode == XTest || IS_WAYLAND_DISPLAY) { XTestFakeMotionEvent(display, 0, p.x(), p.y(), CurrentTime); XFlush(display); XTestFakeButtonEvent(display, mouseButton, true, CurrentTime); @@ -661,4 +661,4 @@ uint XEmbedTrayWidget::getWindowPID(uint winId) XCloseDisplay(display); return pid; -} \ No newline at end of file +}