summaryrefslogtreecommitdiff
path: root/src/protocols/core/Seat.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-03-24 14:10:47 +0000
committerVaxry <vaxry@vaxry.net>2025-03-24 14:10:47 +0000
commitaec69131cd3daa6915facef21b32c4914d22af90 (patch)
tree46e41d921d38e60b6e67f513908294d8213b2dc8 /src/protocols/core/Seat.cpp
parent4b968e5bc10244f90b7c51145d95135c0b0a36df (diff)
seat: avoid sending null surfaces in leave/enter events
ref #9699
Diffstat (limited to 'src/protocols/core/Seat.cpp')
-rw-r--r--src/protocols/core/Seat.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/protocols/core/Seat.cpp b/src/protocols/core/Seat.cpp
index 5bdb95f0..f6eee6e1 100644
--- a/src/protocols/core/Seat.cpp
+++ b/src/protocols/core/Seat.cpp
@@ -22,7 +22,7 @@ bool CWLTouchResource::good() {
}
void CWLTouchResource::sendDown(SP<CWLSurfaceResource> surface, uint32_t timeMs, int32_t id, const Vector2D& local) {
- if (!owner)
+ if (!owner || !surface || !surface->getResource()->resource())
return;
if (!(PROTO::seat->currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_TOUCH))
@@ -145,7 +145,7 @@ bool CWLPointerResource::good() {
}
void CWLPointerResource::sendEnter(SP<CWLSurfaceResource> surface, const Vector2D& local) {
- if (!owner || currentSurface == surface)
+ if (!owner || currentSurface == surface || !surface->getResource()->resource())
return;
if (!(PROTO::seat->currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_POINTER))
@@ -165,7 +165,7 @@ void CWLPointerResource::sendEnter(SP<CWLSurfaceResource> surface, const Vector2
}
void CWLPointerResource::sendLeave() {
- if (!owner || !currentSurface)
+ if (!owner || !currentSurface || !currentSurface->getResource()->resource())
return;
if (!(PROTO::seat->currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_POINTER))
@@ -336,7 +336,7 @@ void CWLKeyboardResource::sendKeymap(SP<IKeyboard> keyboard) {
}
void CWLKeyboardResource::sendEnter(SP<CWLSurfaceResource> surface) {
- if (!owner || currentSurface == surface)
+ if (!owner || currentSurface == surface || !surface->getResource()->resource())
return;
if (!(PROTO::seat->currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_KEYBOARD))
@@ -361,7 +361,7 @@ void CWLKeyboardResource::sendEnter(SP<CWLSurfaceResource> surface) {
}
void CWLKeyboardResource::sendLeave() {
- if (!owner || !currentSurface)
+ if (!owner || !currentSurface || !currentSurface->getResource()->resource())
return;
if (!(PROTO::seat->currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_KEYBOARD))