Chase hyprland

This commit is contained in:
Zakk
2024-04-27 21:57:01 -04:00
parent 4a84423ae7
commit 7a93f44f2f
3 changed files with 11 additions and 11 deletions

View File

@@ -8,12 +8,12 @@
#include "globals.hpp" #include "globals.hpp"
CHyprEasyLabel::CHyprEasyLabel(CWindow* pWindow, SMotionActionDesc *actionDesc) : IHyprWindowDecoration(pWindow) { CHyprEasyLabel::CHyprEasyLabel(PHLWINDOW pWindow, SMotionActionDesc *actionDesc) : IHyprWindowDecoration(pWindow) {
m_pWindow = pWindow; m_pWindow = pWindow;
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
PMONITOR->scheduledRecalc = true; PMONITOR->scheduledRecalc = true;
std::string windowAddr = std::format("0x{:x}", (uintptr_t)pWindow); std::string windowAddr = std::format("0x{:x}", (uintptr_t)pWindow.get());
m_szActionCmd = std::vformat(actionDesc->commandString, std::make_format_args(windowAddr)); m_szActionCmd = std::vformat(actionDesc->commandString, std::make_format_args(windowAddr));
m_iTextSize = actionDesc->textSize; m_iTextSize = actionDesc->textSize;
m_cTextColor = actionDesc->textColor; m_cTextColor = actionDesc->textColor;
@@ -108,7 +108,7 @@ void CHyprEasyLabel::renderMotionString(Vector2D& bufferSize, const float scale)
void CHyprEasyLabel::draw(CMonitor* pMonitor, float a) { void CHyprEasyLabel::draw(CMonitor* pMonitor, float a) {
if (!g_pCompositor->windowValidMapped(m_pWindow)) if (!validMapped(m_pWindow))
return; return;
if (!m_pWindow->m_sSpecialRenderData.decorate) if (!m_pWindow->m_sSpecialRenderData.decorate)
@@ -159,7 +159,7 @@ eDecorationType CHyprEasyLabel::getDecorationType() {
return DECORATION_CUSTOM; return DECORATION_CUSTOM;
} }
void CHyprEasyLabel::updateWindow(CWindow* pWindow) { void CHyprEasyLabel::updateWindow(PHLWINDOW pWindow) {
damageEntire(); damageEntire();
} }
@@ -192,6 +192,6 @@ CBox CHyprEasyLabel::assignedBoxGlobal() {
return box.translate(WORKSPACEOFFSET); return box.translate(WORKSPACEOFFSET);
} }
CWindow* CHyprEasyLabel::getOwner() { PHLWINDOW CHyprEasyLabel::getOwner() {
return m_pWindow; return m_pWindow;
} }

View File

@@ -9,7 +9,7 @@
class CHyprEasyLabel : public IHyprWindowDecoration { class CHyprEasyLabel : public IHyprWindowDecoration {
public: public:
CHyprEasyLabel(CWindow*, SMotionActionDesc *actionDesc); CHyprEasyLabel(PHLWINDOW, SMotionActionDesc *actionDesc);
virtual ~CHyprEasyLabel(); virtual ~CHyprEasyLabel();
virtual SDecorationPositioningInfo getPositioningInfo(); virtual SDecorationPositioningInfo getPositioningInfo();
@@ -20,7 +20,7 @@ class CHyprEasyLabel : public IHyprWindowDecoration {
virtual eDecorationType getDecorationType(); virtual eDecorationType getDecorationType();
virtual void updateWindow(CWindow*); virtual void updateWindow(PHLWINDOW);
virtual void damageEntire(); virtual void damageEntire();
@@ -32,7 +32,7 @@ class CHyprEasyLabel : public IHyprWindowDecoration {
virtual std::string getDisplayName(); virtual std::string getDisplayName();
CWindow* getOwner(); PHLWINDOW getOwner();
std::string m_szLabel; std::string m_szLabel;
std::string m_szActionCmd; std::string m_szActionCmd;
@@ -58,7 +58,7 @@ class CHyprEasyLabel : public IHyprWindowDecoration {
int layoutHeight; int layoutHeight;
SWindowDecorationExtents m_seExtents; SWindowDecorationExtents m_seExtents;
CWindow* m_pWindow = nullptr; PHLWINDOW m_pWindow;
CTexture m_tTextTex; CTexture m_tTextTex;

View File

@@ -47,7 +47,7 @@ void addEasyMotionKeybinds()
} }
void addLabelToWindow(CWindow *window, SMotionActionDesc *actionDesc, std::string &label) void addLabelToWindow(PHLWINDOW window, SMotionActionDesc *actionDesc, std::string &label)
{ {
std::unique_ptr<CHyprEasyLabel> motionlabel = std::make_unique<CHyprEasyLabel>(window, actionDesc); std::unique_ptr<CHyprEasyLabel> motionlabel = std::make_unique<CHyprEasyLabel>(window, actionDesc);
motionlabel.get()->m_szLabel = label; motionlabel.get()->m_szLabel = label;
@@ -171,7 +171,7 @@ void easymotionDispatch(std::string args)
if (w->isHidden() || !w->m_bIsMapped || w->m_bFadingOut) if (w->isHidden() || !w->m_bIsMapped || w->m_bFadingOut)
continue; continue;
std::string lstr = actionDesc.motionKeys.substr(key_idx++, 1); std::string lstr = actionDesc.motionKeys.substr(key_idx++, 1);
addLabelToWindow(w.get(), &actionDesc, lstr); addLabelToWindow(w, &actionDesc, lstr);
} }
} }
} }