Commit d45584d1 authored by Wolfgang Bauer's avatar Wolfgang Bauer

[xembedsniproxy] Free windowAttributes in every case

The structure was only freed in case the XTest method was chosen.
But it should always be freed of course (as long as it isn't NULL).

Use a QScopedPointer instead to free it automatically when it goes out
of scope and to be more consistent with the rest of t

Differential Revision: https://phabricator.kde.org/D6389
parent 9ab9cde5
......@@ -208,10 +208,9 @@ SNIProxy::SNIProxy(xcb_window_t wid, QObject* parent):
//we query if the client selected button presses in the event mask
//if the client does supports that we send directly, otherwise we'll use xtest
auto waCookie = xcb_get_window_attributes(c, wid);
auto windowAttributes = xcb_get_window_attributes_reply(c, waCookie, nullptr);
QScopedPointer<xcb_get_window_attributes_reply_t, QScopedPointerPodDeleter> windowAttributes(xcb_get_window_attributes_reply(c, waCookie, nullptr));
if (windowAttributes && ! (windowAttributes->all_event_masks & XCB_EVENT_MASK_BUTTON_PRESS)) {
m_injectMode = XTest;
free(windowAttributes);
}
//there's no damage event for the first paint, and sometimes it's not drawn immediately
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment