mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2025-05-13 05:40:41 +01:00
all: Change variable names to chase Hyprland (#322)
* flake.lock: update hyprland * Use correct var names after hyprland refactor
This commit is contained in:
parent
faa4e78275
commit
8e5e53adef
9 changed files with 39 additions and 39 deletions
|
@ -47,7 +47,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
|||
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "openWindow", [&](void* self, SCallbackInfo& info, std::any data) { onNewWindow(self, data); });
|
||||
|
||||
// add deco to existing windows
|
||||
for (auto& w : g_pCompositor->m_vWindows) {
|
||||
for (auto& w : g_pCompositor->m_windows) {
|
||||
if (w->isHidden() || !w->m_bIsMapped)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -32,10 +32,10 @@ void hkNotifyMotion(CSeatManager* thisptr, uint32_t time_msec, const Vector2D& l
|
|||
|
||||
Vector2D newCoords = local;
|
||||
|
||||
if (**PFIX && !g_pCompositor->m_pLastWindow.expired() && g_pCompositor->m_pLastWindow->m_szInitialClass == *PCLASS && g_pCompositor->m_pLastMonitor) {
|
||||
if (**PFIX && !g_pCompositor->m_lastWindow.expired() && g_pCompositor->m_lastWindow->m_szInitialClass == *PCLASS && g_pCompositor->m_lastMonitor) {
|
||||
// fix the coords
|
||||
newCoords.x *= (**RESX / g_pCompositor->m_pLastMonitor->vecSize.x) / g_pCompositor->m_pLastWindow->m_fX11SurfaceScaledBy;
|
||||
newCoords.y *= (**RESY / g_pCompositor->m_pLastMonitor->vecSize.y) / g_pCompositor->m_pLastWindow->m_fX11SurfaceScaledBy;
|
||||
newCoords.x *= (**RESX / g_pCompositor->m_lastMonitor->vecSize.x) / g_pCompositor->m_lastWindow->m_fX11SurfaceScaledBy;
|
||||
newCoords.y *= (**RESY / g_pCompositor->m_lastMonitor->vecSize.y) / g_pCompositor->m_lastWindow->m_fX11SurfaceScaledBy;
|
||||
}
|
||||
|
||||
(*(origMotion)g_pMouseMotionHook->m_pOriginal)(thisptr, time_msec, newCoords);
|
||||
|
|
18
flake.lock
18
flake.lock
|
@ -116,11 +116,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743953322,
|
||||
"narHash": "sha256-prQ5JKopXtzCMX2eT3dXbaVvGmzjMRE2bXStQDdazpM=",
|
||||
"lastModified": 1745015490,
|
||||
"narHash": "sha256-apEJ9zoSzmslhJ2vOKFcXTMZLUFYzh1ghfB6Rbw3Low=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprgraphics",
|
||||
"rev": "9d7f2687c84c729afbc3b13f7937655570f2978d",
|
||||
"rev": "60754910946b4e2dc1377b967b7156cb989c5873",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -145,11 +145,11 @@
|
|||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1744921985,
|
||||
"narHash": "sha256-to3lo8FYzHl4Z0O30wHprOZHUQdKYvAecWyX+zdoEEY=",
|
||||
"lastModified": 1745328209,
|
||||
"narHash": "sha256-eP3x+JNE1T6RjXhimaEnoc4GvNJcyzppW1vpAs287Zg=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"rev": "ddae3036ca6a1729ffe7854a59184116d2622809",
|
||||
"rev": "241a4935a244f403fa7108259075b04c81ed258f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -332,11 +332,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1744463964,
|
||||
"narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=",
|
||||
"lastModified": 1744932701,
|
||||
"narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650",
|
||||
"rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -83,7 +83,7 @@ bool CHyprBar::inputIsValid() {
|
|||
|
||||
const auto WINDOWATCURSOR = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING);
|
||||
|
||||
if (WINDOWATCURSOR != m_pWindow && m_pWindow != g_pCompositor->m_pLastWindow)
|
||||
if (WINDOWATCURSOR != m_pWindow && m_pWindow != g_pCompositor->m_lastWindow)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -106,7 +106,7 @@ void CHyprBar::onTouchDown(SCallbackInfo& info, ITouch::SDownEvent e) {
|
|||
return;
|
||||
|
||||
auto PMONITOR = g_pCompositor->getMonitorFromName(!e.device->boundOutput.empty() ? e.device->boundOutput : "");
|
||||
PMONITOR = PMONITOR ? PMONITOR : g_pCompositor->m_pLastMonitor.lock();
|
||||
PMONITOR = PMONITOR ? PMONITOR : g_pCompositor->m_lastMonitor.lock();
|
||||
g_pCompositor->warpCursorTo({PMONITOR->vecPosition.x + e.pos.x * PMONITOR->vecSize.x, PMONITOR->vecPosition.y + e.pos.y * PMONITOR->vecSize.y}, true);
|
||||
|
||||
handleDownEvent(info, e);
|
||||
|
@ -165,7 +165,7 @@ void CHyprBar::handleDownEvent(SCallbackInfo& info, std::optional<ITouch::SDownE
|
|||
return;
|
||||
}
|
||||
|
||||
if (g_pCompositor->m_pLastWindow.lock() != PWINDOW)
|
||||
if (g_pCompositor->m_lastWindow.lock() != PWINDOW)
|
||||
g_pCompositor->focusWindow(PWINDOW);
|
||||
|
||||
if (PWINDOW->m_bIsFloating)
|
||||
|
@ -179,7 +179,7 @@ void CHyprBar::handleDownEvent(SCallbackInfo& info, std::optional<ITouch::SDownE
|
|||
}
|
||||
|
||||
void CHyprBar::handleUpEvent(SCallbackInfo& info) {
|
||||
if (m_pWindow.lock() != g_pCompositor->m_pLastWindow.lock())
|
||||
if (m_pWindow.lock() != g_pCompositor->m_lastWindow.lock())
|
||||
return;
|
||||
|
||||
if (m_bCancelledDown)
|
||||
|
|
|
@ -146,7 +146,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
|||
static auto P4 = HyprlandAPI::registerCallbackDynamic(PHANDLE, "preConfigReload", [&](void* self, SCallbackInfo& info, std::any data) { onPreConfigReload(); });
|
||||
|
||||
// add deco to existing windows
|
||||
for (auto& w : g_pCompositor->m_vWindows) {
|
||||
for (auto& w : g_pCompositor->m_windows) {
|
||||
if (w->isHidden() || !w->m_bIsMapped)
|
||||
continue;
|
||||
|
||||
|
@ -161,7 +161,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
|||
}
|
||||
|
||||
APICALL EXPORT void PLUGIN_EXIT() {
|
||||
for (auto& m : g_pCompositor->m_vMonitors)
|
||||
for (auto& m : g_pCompositor->m_monitors)
|
||||
m->scheduledRecalc = true;
|
||||
|
||||
g_pHyprRenderer->m_sRenderPass.removeAllOfType("CBarPassElement");
|
||||
|
|
|
@ -91,7 +91,7 @@ static void swipeUpdate(void* self, SCallbackInfo& info, std::any param) {
|
|||
if (!swipeActive) {
|
||||
if (g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y <= 0) {
|
||||
renderingOverview = true;
|
||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_pLastMonitor->activeWorkspace, true);
|
||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->activeWorkspace, true);
|
||||
renderingOverview = false;
|
||||
gestured = **PDISTANCE;
|
||||
swipeActive = true;
|
||||
|
@ -99,7 +99,7 @@ static void swipeUpdate(void* self, SCallbackInfo& info, std::any param) {
|
|||
|
||||
else if (!g_pOverview && (**PPOSITIVE ? 1.0 : -1.0) * e.delta.y > 0) {
|
||||
renderingOverview = true;
|
||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_pLastMonitor->activeWorkspace, true);
|
||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->activeWorkspace, true);
|
||||
renderingOverview = false;
|
||||
gestured = 0;
|
||||
swipeActive = true;
|
||||
|
@ -135,7 +135,7 @@ static void onExpoDispatcher(std::string arg) {
|
|||
g_pOverview->close();
|
||||
else {
|
||||
renderingOverview = true;
|
||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->activeWorkspace);
|
||||
renderingOverview = false;
|
||||
}
|
||||
return;
|
||||
|
@ -151,7 +151,7 @@ static void onExpoDispatcher(std::string arg) {
|
|||
return;
|
||||
|
||||
renderingOverview = true;
|
||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||
g_pOverview = std::make_unique<COverview>(g_pCompositor->m_lastMonitor->activeWorkspace);
|
||||
renderingOverview = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ COverview::~COverview() {
|
|||
}
|
||||
|
||||
COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn_), swipe(swipe_) {
|
||||
const auto PMONITOR = g_pCompositor->m_pLastMonitor.lock();
|
||||
const auto PMONITOR = g_pCompositor->m_lastMonitor.lock();
|
||||
pMonitor = PMONITOR;
|
||||
|
||||
static auto* const* PCOLUMNS = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprexpo:columns")->getDataStaticPtr();
|
||||
|
|
|
@ -121,7 +121,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
|||
initGlobal();
|
||||
|
||||
// add deco to existing windows
|
||||
for (auto& w : g_pCompositor->m_vWindows) {
|
||||
for (auto& w : g_pCompositor->m_windows) {
|
||||
if (w->isHidden() || !w->m_bIsMapped)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ APICALL EXPORT std::string PLUGIN_API_VERSION() {
|
|||
static SDispatchResult moveOrExec(std::string in) {
|
||||
CVarList vars(in, 0, ',');
|
||||
|
||||
if (!g_pCompositor->m_pLastMonitor || !g_pCompositor->m_pLastMonitor->activeWorkspace)
|
||||
if (!g_pCompositor->m_lastMonitor || !g_pCompositor->m_lastMonitor->activeWorkspace)
|
||||
return SDispatchResult{.success = false, .error = "No active workspace"};
|
||||
|
||||
const auto PWINDOW = g_pCompositor->getWindowByRegex(vars[0]);
|
||||
|
@ -36,8 +36,8 @@ static SDispatchResult moveOrExec(std::string in) {
|
|||
if (!PWINDOW)
|
||||
g_pKeybindManager->spawn(vars[1]);
|
||||
else {
|
||||
if (g_pCompositor->m_pLastMonitor->activeWorkspace != PWINDOW->m_pWorkspace)
|
||||
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||
if (g_pCompositor->m_lastMonitor->activeWorkspace != PWINDOW->m_pWorkspace)
|
||||
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, g_pCompositor->m_lastMonitor->activeWorkspace);
|
||||
else
|
||||
g_pCompositor->warpCursorTo(PWINDOW->middle());
|
||||
g_pCompositor->focusWindow(PWINDOW);
|
||||
|
@ -52,15 +52,15 @@ static SDispatchResult throwUnfocused(std::string in) {
|
|||
if (id == WORKSPACE_INVALID)
|
||||
return SDispatchResult{.success = false, .error = "Failed to find workspace"};
|
||||
|
||||
if (!g_pCompositor->m_pLastWindow || !g_pCompositor->m_pLastWindow->m_pWorkspace)
|
||||
if (!g_pCompositor->m_lastWindow || !g_pCompositor->m_lastWindow->m_pWorkspace)
|
||||
return SDispatchResult{.success = false, .error = "No valid last window"};
|
||||
|
||||
auto pWorkspace = g_pCompositor->getWorkspaceByID(id);
|
||||
if (!pWorkspace)
|
||||
pWorkspace = g_pCompositor->createNewWorkspace(id, g_pCompositor->m_pLastWindow->m_pWorkspace->monitorID(), name, false);
|
||||
pWorkspace = g_pCompositor->createNewWorkspace(id, g_pCompositor->m_lastWindow->m_pWorkspace->monitorID(), name, false);
|
||||
|
||||
for (const auto& w : g_pCompositor->m_vWindows) {
|
||||
if (w == g_pCompositor->m_pLastWindow || w->m_pWorkspace != g_pCompositor->m_pLastWindow->m_pWorkspace)
|
||||
for (const auto& w : g_pCompositor->m_windows) {
|
||||
if (w == g_pCompositor->m_lastWindow || w->m_pWorkspace != g_pCompositor->m_lastWindow->m_pWorkspace)
|
||||
continue;
|
||||
|
||||
g_pCompositor->moveWindowToWorkspaceSafe(w, pWorkspace);
|
||||
|
@ -75,20 +75,20 @@ static SDispatchResult bringAllFrom(std::string in) {
|
|||
if (id == WORKSPACE_INVALID)
|
||||
return SDispatchResult{.success = false, .error = "Failed to find workspace"};
|
||||
|
||||
if (!g_pCompositor->m_pLastMonitor || !g_pCompositor->m_pLastMonitor->activeWorkspace)
|
||||
if (!g_pCompositor->m_lastMonitor || !g_pCompositor->m_lastMonitor->activeWorkspace)
|
||||
return SDispatchResult{.success = false, .error = "No active monitor"};
|
||||
|
||||
auto pWorkspace = g_pCompositor->getWorkspaceByID(id);
|
||||
if (!pWorkspace)
|
||||
return SDispatchResult{.success = false, .error = "Workspace isnt open"};
|
||||
|
||||
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow.lock();
|
||||
const auto PLASTWINDOW = g_pCompositor->m_lastWindow.lock();
|
||||
|
||||
for (const auto& w : g_pCompositor->m_vWindows) {
|
||||
for (const auto& w : g_pCompositor->m_windows) {
|
||||
if (w->m_pWorkspace != pWorkspace)
|
||||
continue;
|
||||
|
||||
g_pCompositor->moveWindowToWorkspaceSafe(w, g_pCompositor->m_pLastMonitor->activeWorkspace);
|
||||
g_pCompositor->moveWindowToWorkspaceSafe(w, g_pCompositor->m_lastMonitor->activeWorkspace);
|
||||
}
|
||||
|
||||
if (PLASTWINDOW) {
|
||||
|
@ -100,11 +100,11 @@ static SDispatchResult bringAllFrom(std::string in) {
|
|||
}
|
||||
|
||||
static SDispatchResult closeUnfocused(std::string in) {
|
||||
if (!g_pCompositor->m_pLastMonitor)
|
||||
if (!g_pCompositor->m_lastMonitor)
|
||||
return SDispatchResult{.success = false, .error = "No focused monitor"};
|
||||
|
||||
for (const auto& w : g_pCompositor->m_vWindows) {
|
||||
if (w->m_pWorkspace != g_pCompositor->m_pLastMonitor->activeWorkspace || w->m_pMonitor != g_pCompositor->m_pLastMonitor || !w->m_bIsMapped)
|
||||
for (const auto& w : g_pCompositor->m_windows) {
|
||||
if (w->m_pWorkspace != g_pCompositor->m_lastMonitor->activeWorkspace || w->m_pMonitor != g_pCompositor->m_lastMonitor || !w->m_bIsMapped)
|
||||
continue;
|
||||
|
||||
g_pCompositor->closeWindow(w);
|
||||
|
|
Loading…
Reference in a new issue