From 557e7b4e117d50a784e7714805a602dcc8196a90 Mon Sep 17 00:00:00 2001 From: elviosak <33790211+elviosak@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:50:03 -0300 Subject: [PATCH] Hyprbars: disable drag when clicking button (#289) --- hyprbars/barDeco.cpp | 10 +++++----- hyprbars/barDeco.hpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hyprbars/barDeco.cpp b/hyprbars/barDeco.cpp index f5bdbab..3e9dae1 100644 --- a/hyprbars/barDeco.cpp +++ b/hyprbars/barDeco.cpp @@ -162,9 +162,8 @@ void CHyprBar::handleDownEvent(SCallbackInfo& info, std::optionalm_mDispatchers["exec"](b.cmd); - return; + return true; } offset += **PBARBUTTONPADDING + b.size; } + return false; } void CHyprBar::renderText(SP out, const std::string& text, const CHyprColor& color, const Vector2D& bufferSize, const float scale, const int fontSize) { diff --git a/hyprbars/barDeco.hpp b/hyprbars/barDeco.hpp index b8dbbdf..cbd7adc 100644 --- a/hyprbars/barDeco.hpp +++ b/hyprbars/barDeco.hpp @@ -78,7 +78,7 @@ class CHyprBar : public IHyprWindowDecoration { void handleDownEvent(SCallbackInfo& info, std::optional touchEvent); void handleUpEvent(SCallbackInfo& info); void handleMovement(); - void doButtonPress(long int* const* PBARPADDING, long int* const* PBARBUTTONPADDING, long int* const* PHEIGHT, Vector2D COORDS, bool BUTTONSRIGHT); + bool doButtonPress(long int* const* PBARPADDING, long int* const* PBARBUTTONPADDING, long int* const* PHEIGHT, Vector2D COORDS, bool BUTTONSRIGHT); CBox assignedBoxGlobal();