Really chase hyprland
This commit is contained in:
@@ -16,7 +16,7 @@ CHyprEasyLabel::CHyprEasyLabel(PHLWINDOW pWindow, SMotionActionDesc *actionDesc)
|
|||||||
m_pWindow = pWindow;
|
m_pWindow = pWindow;
|
||||||
|
|
||||||
const auto PMONITOR = pWindow->m_monitor.lock();
|
const auto PMONITOR = pWindow->m_monitor.lock();
|
||||||
PMONITOR->scheduledRecalc = true;
|
PMONITOR->m_scheduledRecalc = true;
|
||||||
m_szWindowAddress = std::format("0x{:x}", (uintptr_t)pWindow.get());
|
m_szWindowAddress = std::format("0x{:x}", (uintptr_t)pWindow.get());
|
||||||
m_szActionCmd = std::vformat(actionDesc->commandString, std::make_format_args(m_szWindowAddress));
|
m_szActionCmd = std::vformat(actionDesc->commandString, std::make_format_args(m_szWindowAddress));
|
||||||
m_iTextSize = actionDesc->textSize;
|
m_iTextSize = actionDesc->textSize;
|
||||||
@@ -131,7 +131,7 @@ void CHyprEasyLabel::draw(PHLMONITOR pMonitor, float const &a) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const auto PWORKSPACE = PWINDOW->m_workspace;
|
const auto PWORKSPACE = PWINDOW->m_workspace;
|
||||||
const auto WORKSPACEOFFSET = PWORKSPACE && !PWINDOW->m_pinned ? PWORKSPACE->m_vRenderOffset->value() : Vector2D();
|
const auto WORKSPACEOFFSET = PWORKSPACE && !PWINDOW->m_pinned ? PWORKSPACE->m_renderOffset->value() : Vector2D();
|
||||||
|
|
||||||
const auto DECOBOX = assignedBoxGlobal();
|
const auto DECOBOX = assignedBoxGlobal();
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ void CHyprEasyLabel::draw(PHLMONITOR pMonitor, float const &a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CBox motionBox = {DECOBOX.x, DECOBOX.y, m_tTextTex->m_size.x, m_tTextTex->m_size.y};
|
CBox motionBox = {DECOBOX.x, DECOBOX.y, m_tTextTex->m_size.x, m_tTextTex->m_size.y};
|
||||||
motionBox.translate(pMonitor->m_vecPosition*-1).scale(pMonitor->m_scale).round();
|
motionBox.translate(pMonitor->m_position*-1).scale(pMonitor->m_scale).round();
|
||||||
|
|
||||||
if (motionBox.w < 1 || motionBox.h < 1)
|
if (motionBox.w < 1 || motionBox.h < 1)
|
||||||
{
|
{
|
||||||
@@ -171,7 +171,7 @@ void CHyprEasyLabel::draw(PHLMONITOR pMonitor, float const &a) {
|
|||||||
|
|
||||||
if (m_iBorderSize) {
|
if (m_iBorderSize) {
|
||||||
CBox borderBox = {DECOBOX.x, DECOBOX.y, static_cast<double>(layoutWidth), static_cast<double>(layoutHeight)};
|
CBox borderBox = {DECOBOX.x, DECOBOX.y, static_cast<double>(layoutWidth), static_cast<double>(layoutHeight)};
|
||||||
borderBox.translate(pMonitor->m_vecPosition*-1).scale(pMonitor->m_scale).round();
|
borderBox.translate(pMonitor->m_position*-1).scale(pMonitor->m_scale).round();
|
||||||
if (borderBox.w >= 1 && borderBox.h >= 1) {
|
if (borderBox.w >= 1 && borderBox.h >= 1) {
|
||||||
CBorderPassElement::SBorderData borderData;
|
CBorderPassElement::SBorderData borderData;
|
||||||
borderData.box = borderBox;
|
borderData.box = borderBox;
|
||||||
@@ -229,7 +229,7 @@ CBox CHyprEasyLabel::assignedBoxGlobal() {
|
|||||||
CBox box = {boxX, boxY, boxSize, boxSize};
|
CBox box = {boxX, boxY, boxSize, boxSize};
|
||||||
|
|
||||||
const auto PWORKSPACE = PWINDOW->m_workspace;
|
const auto PWORKSPACE = PWINDOW->m_workspace;
|
||||||
const auto WORKSPACEOFFSET = PWORKSPACE && !PWINDOW->m_pinned ? PWORKSPACE->m_vRenderOffset->value() : Vector2D();
|
const auto WORKSPACEOFFSET = PWORKSPACE && !PWINDOW->m_pinned ? PWORKSPACE->m_renderOffset->value() : Vector2D();
|
||||||
|
|
||||||
return box.translate(WORKSPACEOFFSET);
|
return box.translate(WORKSPACEOFFSET);
|
||||||
}
|
}
|
||||||
|
|||||||
6
main.cpp
6
main.cpp
@@ -215,10 +215,10 @@ SDispatchResult easymotionDispatch(std::string args)
|
|||||||
|
|
||||||
for (auto &w : g_pCompositor->m_windows) {
|
for (auto &w : g_pCompositor->m_windows) {
|
||||||
for (auto &m : g_pCompositor->m_monitors) {
|
for (auto &m : g_pCompositor->m_monitors) {
|
||||||
if (w->m_pWorkspace == m->activeWorkspace || m->activeSpecialWorkspace == w->m_pWorkspace) {
|
if (w->m_workspace == m->m_activeWorkspace || m->m_activeSpecialWorkspace == w->m_workspace) {
|
||||||
if (w->isHidden() || !w->m_bIsMapped || w->m_bFadingOut)
|
if (w->isHidden() || !w->m_isMapped || w->m_fadingOut)
|
||||||
continue;
|
continue;
|
||||||
if (m->activeSpecialWorkspace && w->m_pWorkspace != m->activeSpecialWorkspace && actionDesc.only_special)
|
if (m->m_activeSpecialWorkspace && w->m_workspace != m->m_activeSpecialWorkspace && actionDesc.only_special)
|
||||||
continue;
|
continue;
|
||||||
std::string lstr = actionDesc.motionKeys.substr(key_idx++, 1);
|
std::string lstr = actionDesc.motionKeys.substr(key_idx++, 1);
|
||||||
addLabelToWindow(w, &actionDesc, lstr);
|
addLabelToWindow(w, &actionDesc, lstr);
|
||||||
|
|||||||
Reference in New Issue
Block a user