mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: left click on sogou tray
Change-Id: I6cdf6e478d1535224bf000120119660870445db9
This commit is contained in:
parent
cf5e0bc2d5
commit
213db42172
Notes:
gerrit
2018-11-09 09:14:24 +08:00
Verified+1: <jenkins@deepin.com> Verified+1: liuwen123 <liuwen@linuxdeepin.com> Code-Review+2: listenerri <listenerri@gmail.com> Submitted-by: listenerri <listenerri@gmail.com> Submitted-at: Fri, 09 Nov 2018 09:14:24 +0800 Reviewed-on: https://cr.deepin.io/39607 Project: dde/dde-dock Branch: refs/heads/master
@ -31,6 +31,7 @@
|
||||
|
||||
const QStringList ItemCategoryList {"ApplicationStatus" , "Communications" , "SystemServices", "Hardware"};
|
||||
const QStringList ItemStatusList {"ApplicationStatus" , "Communications" , "SystemServices", "Hardware"};
|
||||
const QStringList LeftClickInvalidIdList {"sogou-qimpanel",};
|
||||
|
||||
SNITrayWidget::SNITrayWidget(const QString &sniServicePath, QWidget *parent)
|
||||
: AbstractTrayWidget(parent),
|
||||
@ -84,19 +85,18 @@ void SNITrayWidget::sendClick(uint8_t mouseButton, int x, int y)
|
||||
{
|
||||
switch (mouseButton) {
|
||||
case XCB_BUTTON_INDEX_1:
|
||||
m_sniInter->Activate(x, y);
|
||||
// left button click invalid
|
||||
if (LeftClickInvalidIdList.contains(m_sniInter->id())) {
|
||||
showContextMenu(x, y);
|
||||
} else {
|
||||
m_sniInter->Activate(x, y);
|
||||
}
|
||||
break;
|
||||
case XCB_BUTTON_INDEX_2:
|
||||
m_sniInter->SecondaryActivate(x, y);
|
||||
break;
|
||||
case XCB_BUTTON_INDEX_3:
|
||||
// ContextMenu does not work
|
||||
if (m_sniInter->menu().path().startsWith("/NO_DBUSMENU")) {
|
||||
m_sniInter->ContextMenu(x, y);
|
||||
}
|
||||
else {
|
||||
m_menu->popup(QPoint(x, y));
|
||||
}
|
||||
showContextMenu(x, y);
|
||||
break;
|
||||
default:
|
||||
qDebug() << "unknown mouse button key";
|
||||
@ -186,6 +186,16 @@ void SNITrayWidget::refreshAttentionIcon()
|
||||
}
|
||||
}
|
||||
|
||||
void SNITrayWidget::showContextMenu(int x, int y)
|
||||
{
|
||||
// ContextMenu does not work
|
||||
if (m_sniInter->menu().path().startsWith("/NO_DBUSMENU")) {
|
||||
m_sniInter->ContextMenu(x, y);
|
||||
} else {
|
||||
m_menu->popup(QPoint(x, y));
|
||||
}
|
||||
}
|
||||
|
||||
QSize SNITrayWidget::sizeHint() const
|
||||
{
|
||||
return QSize(26, 26);
|
||||
|
@ -58,6 +58,7 @@ private Q_SLOTS:
|
||||
void refreshIcon();
|
||||
void refreshOverlayIcon();
|
||||
void refreshAttentionIcon();
|
||||
void showContextMenu(int x, int y);
|
||||
|
||||
private:
|
||||
QSize sizeHint() const Q_DECL_OVERRIDE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user