Skip to content

Commit

Permalink
remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeine01 committed Dec 11, 2024
1 parent 0a7a76e commit 0ec30b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 30 deletions.
14 changes: 0 additions & 14 deletions hyprbars/barDeco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ CHyprBar::CHyprBar(PHLWINDOW pWindow) : IHyprWindowDecoration(pWindow) {

m_pTouchDownCallback = HyprlandAPI::registerCallbackDynamic(PHANDLE, "touchDown", [&](void* self, SCallbackInfo& info, std::any param) { onTouchDown(info); });

/* Not implemented (yet)
m_pTipDownCallback = HyprlandAPI::registerCallbackDynamic(PHANDLE, "tabletTip",
[&](void* self, SCallbackInfo& info, std::any param) { onTipDown(info, std::any_cast<CTablet::STipEvent>(param)); });
*/

m_pMouseMoveCallback =
HyprlandAPI::registerCallbackDynamic(PHANDLE, "mouseMove", [&](void* self, SCallbackInfo& info, std::any param) { onMouseMove(std::any_cast<Vector2D>(param)); });

Expand All @@ -34,7 +29,6 @@ CHyprBar::~CHyprBar() {
damageEntire();
HyprlandAPI::unregisterCallback(PHANDLE, m_pMouseButtonCallback);
HyprlandAPI::unregisterCallback(PHANDLE, m_pTouchDownCallback);
/* HyprlandAPI::unregisterCallback(PHANDLE, m_pTipDownCallback); */
HyprlandAPI::unregisterCallback(PHANDLE, m_pMouseMoveCallback);
std::erase(g_pGlobalState->bars, this);
}
Expand Down Expand Up @@ -126,14 +120,6 @@ void CHyprBar::onTouchDown(SCallbackInfo& info) {
CHyprBar::doButtonPress(COORDS);
}

/*
void CHyprBar::onTipDown(SCallbackInfo& info, CTablet::STipEvent e) {
if (!e.in)
return;
CHyprBar::doButtonPress(cursorRelativeToBar());
}
*/

void CHyprBar::doButtonPress(Vector2D coords) {
if (m_pWindow.lock() != g_pCompositor->m_pLastWindow.lock())
return;
Expand Down
30 changes: 14 additions & 16 deletions hyprbars/barDeco.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,20 @@ class CHyprBar : public IHyprWindowDecoration {
void renderBarButtons(const Vector2D& bufferSize, const float scale);
void renderBarButtonsText(CBox* barBox, const float scale, const float a);
void onMouseDown(SCallbackInfo& info, IPointer::SButtonEvent e);
/* void onTipDown(SCallbackInfo& info, CTablet::STipEvent e); */
void onTouchDown(SCallbackInfo& info);
void doButtonPress(Vector2D coords);
void onMouseMove(Vector2D coords);
CBox assignedBoxGlobal();

SP<HOOK_CALLBACK_FN> m_pMouseButtonCallback;
SP<HOOK_CALLBACK_FN> m_pTouchDownCallback;
/* SP<HOOK_CALLBACK_FN> m_pTipDownCallback; */
SP<HOOK_CALLBACK_FN> m_pMouseMoveCallback;

std::string m_szLastTitle;

bool m_bDraggingThis = false;
bool m_bDragPending = false;
bool m_bCancelledDown = false;
void onTouchDown(SCallbackInfo& info);
void doButtonPress(Vector2D coords);
void onMouseMove(Vector2D coords);
CBox assignedBoxGlobal();

SP<HOOK_CALLBACK_FN> m_pMouseButtonCallback;
SP<HOOK_CALLBACK_FN> m_pTouchDownCallback;
SP<HOOK_CALLBACK_FN> m_pMouseMoveCallback;

std::string m_szLastTitle;

bool m_bDraggingThis = false;
bool m_bDragPending = false;
bool m_bCancelledDown = false;

// for dynamic updates
int m_iLastHeight = 0;
Expand Down

0 comments on commit 0ec30b6

Please sign in to comment.