diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/x11/platform.cpp | 1 | ||||
-rw-r--r-- | client/x11/red_window.cpp | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp index fe98eae9..09ca61d0 100644 --- a/client/x11/platform.cpp +++ b/client/x11/platform.cpp @@ -2961,6 +2961,7 @@ static unsigned int get_modifier_mask(KeySym modifier) XModifierKeymap* map = XGetModifierMapping(x_display); KeyCode keycode = XKeysymToKeycode(x_display, modifier); if (keycode == NoSymbol) { + XFreeModifiermap(map); return 0; } diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp index 9f4da602..2e98ae25 100644 --- a/client/x11/red_window.cpp +++ b/client/x11/red_window.cpp @@ -1309,16 +1309,19 @@ void RedWindow_p::move_to_current_desktop() unsigned long nitems_return; unsigned char *prop_return; long desktop = ~long(0); + int status; XLockDisplay(x_display); - if (XGetWindowProperty(x_display, root, wm_current_desktop, 0, 1, False, AnyPropertyType, - &actual_type_return, &actual_format_return, &nitems_return, - &bytes_after_return, &prop_return) == Success && - actual_type_return != None && actual_format_return == 32) { + status = XGetWindowProperty(x_display, root, wm_current_desktop, 0, 1, False, AnyPropertyType, + &actual_type_return, &actual_format_return, &nitems_return, + &bytes_after_return, &prop_return); + if ((status == Success) && (actual_type_return != None) && (actual_format_return == 32)) { desktop = *(uint32_t *)prop_return; } else { DBG(0, "get current desktop failed"); } + if (status == Success) + XFree(prop_return); XUnlockDisplay(x_display); XEvent xevent; |