File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ void GestureManager::sendCancelEventsToWindows() {
272272
273273 for (const auto & touch : this ->touchedResources .all ()) {
274274 const auto t = touch.lock ();
275- if (t.impl_ ) { // FIXME: idk how to check weak pointer validity
275+ if (t.get ()) {
276276 t->sendCancel ();
277277 }
278278 }
@@ -366,16 +366,23 @@ bool GestureManager::onTouchUp(ITouch::SUpEvent ev) {
366366 if (**SEND_CANCEL) {
367367 const auto surface = g_pInputManager->m_sTouchData .touchFocusSurface ;
368368
369+ if (!surface.valid ()) {
370+ return true ;
371+ }
372+
369373 wl_client* client = surface.get ()->client ();
370- if (client) {
371- SP<CWLSeatResource> seat = g_pSeatManager->seatResourceForClient (client);
374+ if (!client) {
375+ return true ;
376+ }
372377
373- if (seat) {
374- auto touches = seat.get ()->touches ;
375- for (const auto & touch : touches) {
376- this ->touchedResources .remove (touch);
377- }
378- }
378+ SP<CWLSeatResource> seat = g_pSeatManager->seatResourceForClient (client);
379+ if (!seat.get ()) {
380+ return true ;
381+ }
382+
383+ auto touches = seat.get ()->touches ;
384+ for (const auto & touch : touches) {
385+ this ->touchedResources .remove (touch);
379386 }
380387
381388 return BLOCK;
You can’t perform that action at this time.
0 commit comments