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 +}