From 870d7355cabdd4ad4445bf4655965893db826f81 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 2 Nov 2014 10:00:16 +0100 Subject: [PATCH] Fix reading window title from _NET_WM_NAME. XGetWindowProperty() returns 0 on success. Closes #236 --- src/autotype/x11/AutoTypeX11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autotype/x11/AutoTypeX11.cpp b/src/autotype/x11/AutoTypeX11.cpp index 06a1e329..6a175c72 100644 --- a/src/autotype/x11/AutoTypeX11.cpp +++ b/src/autotype/x11/AutoTypeX11.cpp @@ -212,7 +212,7 @@ QString AutoTypePlatformX11::windowTitle(Window window, bool useBlacklist) int retVal = XGetWindowProperty(m_dpy, window, m_atomNetWmName, 0, 1000, false, m_atomUtf8String, &type, &format, &nitems, &after, &data); - if (retVal != 0 && data) { + if (retVal == 0 && data) { title = QString::fromUtf8(reinterpret_cast(data)); } else {