From 55d97082595024cfc1416dc75923e4a112a36e61 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Tue, 9 Aug 2022 11:38:09 -0500 Subject: [PATCH] Vol,PosView: Ignore scroll-wheel when inactive --- src/PositionView.cpp | 5 ++++- src/VolumeView.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/PositionView.cpp b/src/PositionView.cpp index 08532af..f68a0d4 100644 --- a/src/PositionView.cpp +++ b/src/PositionView.cpp @@ -76,7 +76,7 @@ PositionView::Archive(BMessage* data, bool deep) const data->AddString("class", "PositionView"); data->AddString("add_on", APP_SIGNATURE); - return status; + return status; } @@ -106,6 +106,9 @@ PositionView::MessageReceived(BMessage* msg) break; case B_MOUSE_WHEEL_CHANGED: { + if (fInactive) + break; + float scroll = 0.0f; if ((msg->FindFloat("be:wheel_delta_x", &scroll) == B_OK && scroll != 0.0f) || (msg->FindFloat("be:wheel_delta_y", &scroll) == B_OK && scroll != 0.0f)) diff --git a/src/VolumeView.cpp b/src/VolumeView.cpp index ae63a82..244edfa 100644 --- a/src/VolumeView.cpp +++ b/src/VolumeView.cpp @@ -54,7 +54,7 @@ VolumeView::Archive(BMessage* data, bool deep) const data->AddString("class", "VolumeView"); data->AddString("add_on", APP_SIGNATURE); - return status; + return status; } @@ -83,6 +83,9 @@ VolumeView::MessageReceived(BMessage* msg) break; case B_MOUSE_WHEEL_CHANGED: { + if (fInactive) + break; + float scroll = 0.0f; if ((msg->FindFloat("be:wheel_delta_x", &scroll) == B_OK && scroll != 0.0f) || (msg->FindFloat("be:wheel_delta_y", &scroll) == B_OK && scroll != 0.0f)) @@ -100,7 +103,7 @@ void VolumeView::Pulse() { float volume = fMediaPlayer->Volume(); - if (volume > 0) { + if (volume >= 0) { SetInactive(false); fSlider->SetPosition(_VolumeToPosition(volume)); } else