Simplified proper cleanup of allocated event filters for swipe handler.

This commit is contained in:
23rd 2025-04-12 19:32:44 +03:00 committed by John Preston
parent d49da1fdd0
commit 667e614bf3

View file

@ -76,7 +76,7 @@ void SetupSwipeHandler(SwipeHandlerArgs &&args) {
bool touch = false;
};
struct State {
base::unique_qptr<QObject> filterContext;
base::unique_qptr<QObject> filter;
Ui::Animations::Simple animationReach;
Ui::Animations::Simple animationEnd;
SwipeContextData data;
@ -376,8 +376,8 @@ void SetupSwipeHandler(SwipeHandlerArgs &&args) {
return base::EventFilterResult::Continue;
};
widget->setAttribute(Qt::WA_AcceptTouchEvents);
state->filterContext = base::make_unique_q<QObject>(nullptr);
base::install_event_filter(state->filterContext.get(), widget, filter);
state->filter = base::unique_qptr<QObject>(
base::install_event_filter(widget, filter));
}
SwipeBackResult SetupSwipeBack(