Fix reading window title from _NET_WM_NAME.

XGetWindowProperty() returns 0 on success.

Closes #236
This commit is contained in:
Felix Geyer 2014-11-02 10:00:16 +01:00
parent f1aa6aca26
commit 870d7355ca

View File

@ -212,7 +212,7 @@ QString AutoTypePlatformX11::windowTitle(Window window, bool useBlacklist)
int retVal = XGetWindowProperty(m_dpy, window, m_atomNetWmName, 0, 1000, false, m_atomUtf8String, int retVal = XGetWindowProperty(m_dpy, window, m_atomNetWmName, 0, 1000, false, m_atomUtf8String,
&type, &format, &nitems, &after, &data); &type, &format, &nitems, &after, &data);
if (retVal != 0 && data) { if (retVal == 0 && data) {
title = QString::fromUtf8(reinterpret_cast<char*>(data)); title = QString::fromUtf8(reinterpret_cast<char*>(data));
} }
else { else {