From 0e004e7b3fb390e92a68535394ddd6aa60c68dce Mon Sep 17 00:00:00 2001 From: galister <22305755+galister@users.noreply.github.com> Date: Mon, 12 Jan 2026 12:17:30 +0900 Subject: [PATCH] fix some button actions missing filters --- wayvr/src/gui/panel/button.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/wayvr/src/gui/panel/button.rs b/wayvr/src/gui/panel/button.rs index f5df38d..47bba00 100644 --- a/wayvr/src/gui/panel/button.rs +++ b/wayvr/src/gui/panel/button.rs @@ -48,7 +48,7 @@ pub const BUTTON_EVENTS: [( "_press", EventListenerKind::MousePress, button_any, - short_duration, + ignore_duration, ), ( "_release", @@ -228,7 +228,11 @@ pub(super) fn setup_custom_button( let on_custom_attribs = on_custom_attribs.clone(); Box::new({ - move |_common, data, _app, _| { + move |_common, data, app, _| { + if !test_button(data) || !test_duration(&button, app) { + return Ok(EventResult::Pass); + } + context_menu.borrow_mut().open(OpenParams { on_custom_attribs: Some(on_custom_attribs.clone()), blueprint: Blueprint::Template { @@ -244,7 +248,11 @@ pub(super) fn setup_custom_button( "::ContextMenuClose" => { let context_menu = context_menu.clone(); - Box::new(move |_common, _data, _app, _| { + Box::new(move |_common, data, app, _| { + if !test_button(data) || !test_duration(&button, app) { + return Ok(EventResult::Pass); + } + context_menu.borrow_mut().close(); Ok(EventResult::Consumed) @@ -274,7 +282,11 @@ pub(super) fn setup_custom_button( } }; - Box::new(move |common, _data, _app, _| { + Box::new(move |common, data, app, _| { + if !test_button(data) || !test_duration(&button, app) { + return Ok(EventResult::Pass); + } + common .alterables .set_style(widget_id, StyleSetRequest::Display(display));