Only destroy damage_handle if a damage_handle got created

Summary:
Instead of binding to the OperationMode whether the damage_handle
should be destroyed, we bind it to whether damage_handle got created.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1483
This commit is contained in:
Martin Gräßlin 2016-04-25 09:55:42 +02:00
parent 319869881c
commit bfa31d48cd

View file

@ -998,7 +998,7 @@ void Toplevel::finishCompositing(ReleaseReason releaseReason)
delete effect_window; delete effect_window;
} }
if (kwinApp()->operationMode() == Application::OperationModeX11 && if (damage_handle != XCB_NONE &&
releaseReason != ReleaseReason::Destroyed) { releaseReason != ReleaseReason::Destroyed) {
xcb_damage_destroy(connection(), damage_handle); xcb_damage_destroy(connection(), damage_handle);
} }