mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix: 修复部分应用托盘右键没有响应问题
使用了libappindicator的程序在注册SNI时,缺少了activate的dbus调用. 原有采用黑名单形式去调用右键菜单,现修改成,左键调用失败去掉用右键菜单. Log: 修复部分electron程序右键没有响应问题 Bug: https://pms.uniontech.com/bug-view-122491.html Influence: tray Change-Id: If468de46e86744abace17a10ae1e54b945512d66
This commit is contained in:
parent
2396cd2b31
commit
d88642fb30
@ -29,6 +29,7 @@
|
||||
|
||||
#include <QPainter>
|
||||
#include <QApplication>
|
||||
#include <QDBusPendingCall>
|
||||
|
||||
#include <xcb/xproto.h>
|
||||
|
||||
@ -38,7 +39,6 @@ DGUI_USE_NAMESPACE
|
||||
|
||||
const QStringList ItemCategoryList {"ApplicationStatus", "Communications", "SystemServices", "Hardware"};
|
||||
const QStringList ItemStatusList {"Passive", "Active", "NeedsAttention"};
|
||||
const QStringList LeftClickInvalidIdList {"sogou-qimpanel",};
|
||||
QPointer<DockPopupWindow> SNITrayWidget::PopupWindow = nullptr;
|
||||
Dock::Position SNITrayWidget::DockPosition = Dock::Position::Top;
|
||||
using namespace Dock;
|
||||
@ -182,13 +182,15 @@ void SNITrayWidget::updateIcon()
|
||||
|
||||
void SNITrayWidget::sendClick(uint8_t mouseButton, int x, int y)
|
||||
{
|
||||
QDBusPendingReply<> reply;
|
||||
switch (mouseButton) {
|
||||
case XCB_BUTTON_INDEX_1:
|
||||
// left button click invalid
|
||||
if (LeftClickInvalidIdList.contains(m_sniId)) {
|
||||
showContextMenu(x, y);
|
||||
} else {
|
||||
m_sniInter->Activate(x, y);
|
||||
reply = m_sniInter->Activate(x, y);
|
||||
// try to invoke context menu while calling activate get a error.
|
||||
// primarily work for apps using libappindicator.
|
||||
reply.waitForFinished();
|
||||
if (reply.isError()) {
|
||||
showContextMenu(x,y);
|
||||
}
|
||||
break;
|
||||
case XCB_BUTTON_INDEX_2:
|
||||
|
Loading…
x
Reference in New Issue
Block a user