aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/render/decorations/CHyprGroupBarDecoration.cpp18
-rw-r--r--src/render/decorations/CHyprGroupBarDecoration.hpp5
2 files changed, 12 insertions, 11 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp
index e854d63a..1ea0aac2 100644
--- a/src/render/decorations/CHyprGroupBarDecoration.cpp
+++ b/src/render/decorations/CHyprGroupBarDecoration.cpp
@@ -422,7 +422,7 @@ bool CHyprGroupBarDecoration::onEndWindowDragOnDeco(const Vector2D& pos, PHLWIND
return true;
}
-bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, wlr_pointer_button_event* e) {
+bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, const IPointer::SButtonEvent& e) {
if (m_pWindow->m_bIsFullscreen && m_pWindow->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL)
return true;
@@ -431,18 +431,18 @@ bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, wlr_point
static auto PFOLLOWMOUSE = CConfigValue<Hyprlang::INT>("input:follow_mouse");
// close window on middle click
- if (e->button == 274) {
+ if (e.button == 274) {
static Vector2D pressedCursorPos;
- if (e->state == WL_POINTER_BUTTON_STATE_PRESSED)
+ if (e.state == WL_POINTER_BUTTON_STATE_PRESSED)
pressedCursorPos = pos;
- else if (e->state == WL_POINTER_BUTTON_STATE_RELEASED && pressedCursorPos == pos)
+ else if (e.state == WL_POINTER_BUTTON_STATE_RELEASED && pressedCursorPos == pos)
g_pXWaylandManager->sendCloseWindow(m_pWindow->getGroupWindowByIndex(WINDOWINDEX));
return true;
}
- if (e->state != WL_POINTER_BUTTON_STATE_PRESSED)
+ if (e.state != WL_POINTER_BUTTON_STATE_PRESSED)
return true;
// click on padding
@@ -466,13 +466,13 @@ bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, wlr_point
return true;
}
-bool CHyprGroupBarDecoration::onScrollOnDeco(const Vector2D& pos, wlr_pointer_axis_event* e) {
+bool CHyprGroupBarDecoration::onScrollOnDeco(const Vector2D& pos, const IPointer::SAxisEvent e) {
static auto PGROUPBARSCROLLING = CConfigValue<Hyprlang::INT>("group:groupbar:scrolling");
if (!*PGROUPBARSCROLLING || m_pWindow->m_sGroupData.pNextWindow.expired())
return false;
- if (e->delta > 0)
+ if (e.delta > 0)
m_pWindow->setGroupCurrent(m_pWindow->m_sGroupData.pNextWindow.lock());
else
m_pWindow->setGroupCurrent(m_pWindow->getGroupPrevious());
@@ -482,8 +482,8 @@ bool CHyprGroupBarDecoration::onScrollOnDeco(const Vector2D& pos, wlr_pointer_ax
bool CHyprGroupBarDecoration::onInputOnDeco(const eInputType type, const Vector2D& mouseCoords, std::any data) {
switch (type) {
- case INPUT_TYPE_AXIS: return onScrollOnDeco(mouseCoords, std::any_cast<wlr_pointer_axis_event*>(data));
- case INPUT_TYPE_BUTTON: return onMouseButtonOnDeco(mouseCoords, std::any_cast<wlr_pointer_button_event*>(data));
+ case INPUT_TYPE_AXIS: return onScrollOnDeco(mouseCoords, std::any_cast<const IPointer::SAxisEvent>(data));
+ case INPUT_TYPE_BUTTON: return onMouseButtonOnDeco(mouseCoords, std::any_cast<const IPointer::SButtonEvent&>(data));
case INPUT_TYPE_DRAG_START: return onBeginWindowDragOnDeco(mouseCoords);
case INPUT_TYPE_DRAG_END: return onEndWindowDragOnDeco(mouseCoords, std::any_cast<PHLWINDOW>(data));
default: return false;
diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp
index d316d01a..45881add 100644
--- a/src/render/decorations/CHyprGroupBarDecoration.hpp
+++ b/src/render/decorations/CHyprGroupBarDecoration.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "IHyprWindowDecoration.hpp"
+#include "../../devices/IPointer.hpp"
#include <deque>
#include "../Texture.hpp"
#include <string>
@@ -61,8 +62,8 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration {
bool onBeginWindowDragOnDeco(const Vector2D&);
bool onEndWindowDragOnDeco(const Vector2D&, PHLWINDOW);
- bool onMouseButtonOnDeco(const Vector2D&, wlr_pointer_button_event*);
- bool onScrollOnDeco(const Vector2D&, wlr_pointer_axis_event*);
+ bool onMouseButtonOnDeco(const Vector2D&, const IPointer::SButtonEvent&);
+ bool onScrollOnDeco(const Vector2D&, const IPointer::SAxisEvent);
struct STitleTexs {
// STitleTexs* overriden = nullptr; // TODO: make shit shared in-group to decrease VRAM usage.