fix: warning when get window property for xembed tray

Change-Id: I0872df0701d43cbb2817176c527ac106e2d031de
This commit is contained in:
listenerri 2019-01-10 18:13:54 +08:00
parent c824831d84
commit eb151202b5
Notes: gerrit 2019-01-10 18:18:44 +08:00
Verified+1: <jenkins@deepin.com>
Code-Review+2: listenerri <listenerri@gmail.com>
Submitted-by: listenerri <listenerri@gmail.com>
Submitted-at: Thu, 10 Jan 2019 18:18:44 +0800
Reviewed-on: https://cr.deepin.io/41280
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -40,6 +40,7 @@
#define NORMAL_WINDOW_PROP_NAME "WM_CLASS"
#define WINE_WINDOW_PROP_NAME "__wine_prefix"
#define IS_WINE_WINDOW_BY_WM_CLASS "explorer.exe"
static const qreal iconSize = 16;
@ -356,14 +357,14 @@ QString XWindowTrayWidget::toTrayWidgetId(quint32 winId)
QString key;
do {
// is wine application
key = getWindowProperty(winId, WINE_WINDOW_PROP_NAME).split("/").last();
if (!key.isEmpty()) {
// is normal application
key = getWindowProperty(winId, NORMAL_WINDOW_PROP_NAME);
if (!key.isEmpty() && key != IS_WINE_WINDOW_BY_WM_CLASS) {
break;
}
// is normal application
key = getWindowProperty(winId, NORMAL_WINDOW_PROP_NAME);
// is wine application
key = getWindowProperty(winId, WINE_WINDOW_PROP_NAME).split("/").last();
if (!key.isEmpty()) {
break;
}