mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-09 00:21:56 -07:00
core/compositor: Fix dropping cursor buffer data early (#9700)
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
#include "../DRMSyncobj.hpp"
|
#include "../DRMSyncobj.hpp"
|
||||||
#include "../../render/Renderer.hpp"
|
#include "../../render/Renderer.hpp"
|
||||||
#include "config/ConfigValue.hpp"
|
#include "config/ConfigValue.hpp"
|
||||||
|
#include "protocols/types/SurfaceRole.hpp"
|
||||||
#include "render/Texture.hpp"
|
#include "render/Texture.hpp"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
@@ -445,7 +446,8 @@ void CWLSurfaceResource::commitPendingState(SSurfaceState& state) {
|
|||||||
|
|
||||||
// release the buffer if it's synchronous (SHM) as update() has done everything thats needed
|
// release the buffer if it's synchronous (SHM) as update() has done everything thats needed
|
||||||
// so we can let the app know we're done.
|
// so we can let the app know we're done.
|
||||||
if (current.buffer && current.buffer->buffer && current.buffer->buffer->isSynchronous())
|
// if it doesn't have a role, we can't release it yet, in case it gets turned into a cursor.
|
||||||
|
if (current.buffer && current.buffer->buffer && current.buffer->buffer->isSynchronous() && role->role() != SURFACE_ROLE_UNASSIGNED)
|
||||||
dropCurrentBuffer();
|
dropCurrentBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -124,7 +124,7 @@ CWLPointerResource::CWLPointerResource(SP<CWlPointer> resource_, SP<CWLSeatResou
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (surfResource) {
|
if (surfResource && surfResource->role->role() != SURFACE_ROLE_CURSOR) {
|
||||||
surfResource->role = makeShared<CCursorSurfaceRole>();
|
surfResource->role = makeShared<CCursorSurfaceRole>();
|
||||||
surfResource->updateCursorShm();
|
surfResource->updateCursorShm();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user