From 34b82da9aa6b07244764f5e9fc714827c0203477 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 19 Jan 2014 20:09:19 +0100 Subject: [PATCH] Initialize cur_focus before it's used. --- src/autotype/x11/AutoTypeX11.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/autotype/x11/AutoTypeX11.cpp b/src/autotype/x11/AutoTypeX11.cpp index 2e55db364..13457cb44 100644 --- a/src/autotype/x11/AutoTypeX11.cpp +++ b/src/autotype/x11/AutoTypeX11.cpp @@ -612,6 +612,8 @@ void AutoTypePlatformX11::SendKeyPressedEvent(KeySym keysym) return; } + XGetInputFocus(m_dpy, &cur_focus, &revert_to); + event.display = m_dpy; event.window = cur_focus; event.root = m_rootWindow; @@ -630,7 +632,6 @@ void AutoTypePlatformX11::SendKeyPressedEvent(KeySym keysym) XQueryPointer(m_dpy, event.root, &root, &child, &root_x, &root_y, &x, &y, &mask); saved_mask = mask; - XGetInputFocus(m_dpy, &cur_focus, &revert_to); /* determine keycode and mask for the given keysym */ keycode = GetKeycode(keysym, &mask);