From 5ce8b37382846e4f3a4fd1a5ee055fd9be9f2873 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 21 Dec 2021 19:30:54 +0100 Subject: [PATCH] fix a rare segfault --- src/utilities/XCBProps.cpp | 4 ++++ src/windowManager.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/utilities/XCBProps.cpp b/src/utilities/XCBProps.cpp index 9ff6148..fe85f54 100644 --- a/src/utilities/XCBProps.cpp +++ b/src/utilities/XCBProps.cpp @@ -86,12 +86,16 @@ void removeAtom(const int& window, xcb_atom_t prop, xcb_atom_t atom) { if (!REPLY || xcb_get_property_value_length(REPLY) == 0) { free(REPLY); xcb_ungrab_server(DisplayConnection); + + return; } xcb_atom_t* atomsList = (xcb_atom_t*)xcb_get_property_value(REPLY); if (!atomsList) { free(REPLY); xcb_ungrab_server(DisplayConnection); + + return; } int valuesnum = 0; diff --git a/src/windowManager.cpp b/src/windowManager.cpp index 73b997d..d52e8a5 100644 --- a/src/windowManager.cpp +++ b/src/windowManager.cpp @@ -1770,6 +1770,9 @@ void CWindowManager::moveWindowToMapped(int64_t id) { } windows[windows.size() - 1].setUnderFullscreen(false); + windows[windows.size() - 1].setDirty(true); + windows[windows.size() - 1].setLastUpdatePosition(Vector2D(0,0)); + windows[windows.size() - 1].setLastUpdateSize(Vector2D(0,0)); return; }