summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2023-02-19 20:54:53 +0000
committerGitHub <noreply@github.com>2023-02-19 20:54:53 +0000
commit1b56cc4e99c391a94fc05a24e1f71c8e425168f1 (patch)
tree110cf0d60d9f01bcbcf3624458afa5ededb5fe8a /src/layout
parent6e16627cbcb5d4712195c97e106f2198076c8aff (diff)
Added an Event Hook System (#1578)
* added an eventHookSystem * Add all socket2 events to hooks
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/DwindleLayout.cpp1
-rw-r--r--src/layout/IHyprLayout.cpp1
-rw-r--r--src/layout/MasterLayout.cpp3
3 files changed, 4 insertions, 1 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 85993676..9e2a6012 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -741,6 +741,7 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscree
PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow;
g_pEventManager->postEvent(SHyprIPCEvent{"fullscreen", std::to_string((int)on)});
+ EMIT_HOOK_EVENT("fullscreen", pWindow);
if (!pWindow->m_bIsFullscreen) {
// if it got its fullscreen disabled, set back its node if it had one
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp
index 24e76035..d62556d5 100644
--- a/src/layout/IHyprLayout.cpp
+++ b/src/layout/IHyprLayout.cpp
@@ -322,6 +322,7 @@ void IHyprLayout::changeWindowFloatingMode(CWindow* pWindow) {
// event
g_pEventManager->postEvent(SHyprIPCEvent{"changefloatingmode", getFormat("%x,%d", pWindow, (int)TILED)});
+ EMIT_HOOK_EVENT("changeFloatingMode", pWindow);
if (!TILED) {
const auto PNEWMON = g_pCompositor->getMonitorFromVector(pWindow->m_vRealPosition.vec() + pWindow->m_vRealSize.vec() / 2.f);
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index 94d26c29..e349d650 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -228,7 +228,7 @@ void CHyprMasterLayout::calculateWorkspace(const int& ws) {
if (getNodesOnWorkspace(PWORKSPACE->m_iID) < 2) {
PMASTERNODE->position = PMONITOR->vecReservedTopLeft + PMONITOR->vecPosition;
PMASTERNODE->size = Vector2D(PMONITOR->vecSize.x - PMONITOR->vecReservedTopLeft.x - PMONITOR->vecReservedBottomRight.x,
- PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y - PMONITOR->vecReservedTopLeft.y);
+ PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y - PMONITOR->vecReservedTopLeft.y);
applyNodeDataToWindow(PMASTERNODE);
return;
} else if (PWORKSPACEDATA->orientation == ORIENTATION_LEFT || PWORKSPACEDATA->orientation == ORIENTATION_RIGHT) {
@@ -524,6 +524,7 @@ void CHyprMasterLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreen
PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow;
g_pEventManager->postEvent(SHyprIPCEvent{"fullscreen", std::to_string((int)on)});
+ EMIT_HOOK_EVENT("fullscreen", pWindow);
if (!pWindow->m_bIsFullscreen) {
// if it got its fullscreen disabled, set back its node if it had one