From f4cf68f4ba9c3a6c32fb61c9d4448c580e59b41f Mon Sep 17 00:00:00 2001 From: UjinT34 Date: Sun, 16 Jun 2024 13:18:02 +0300 Subject: [PATCH] add getCurrentLayout to CWorkspace --- src/desktop/Workspace.cpp | 5 +++++ src/desktop/Workspace.hpp | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/desktop/Workspace.cpp b/src/desktop/Workspace.cpp index ed09fbc0..938803a3 100644 --- a/src/desktop/Workspace.cpp +++ b/src/desktop/Workspace.cpp @@ -1,6 +1,7 @@ #include "Workspace.hpp" #include "../Compositor.hpp" #include "../config/ConfigValue.hpp" +#include "managers/LayoutManager.hpp" #include using namespace Hyprutils::String; @@ -508,3 +509,7 @@ void CWorkspace::markInert() { bool CWorkspace::inert() { return m_bInert; } + +IHyprLayout* CWorkspace::getCurrentLayout() { + return g_pLayoutManager->getCurrentLayout(); +} diff --git a/src/desktop/Workspace.hpp b/src/desktop/Workspace.hpp index 17431215..696d9bec 100644 --- a/src/desktop/Workspace.hpp +++ b/src/desktop/Workspace.hpp @@ -63,21 +63,23 @@ class CWorkspace { bool m_bPersistent = false; // Inert: destroyed and invalid. If this is true, release the ptr you have. - bool inert(); + bool inert(); - void startAnim(bool in, bool left, bool instant = false); - void setActive(bool on); + void startAnim(bool in, bool left, bool instant = false); + void setActive(bool on); - void moveToMonitor(const int&); + void moveToMonitor(const int&); - PHLWINDOW getLastFocusedWindow(); - void rememberPrevWorkspace(const PHLWORKSPACE& prevWorkspace); + PHLWINDOW getLastFocusedWindow(); + void rememberPrevWorkspace(const PHLWORKSPACE& prevWorkspace); - std::string getConfigName(); + std::string getConfigName(); - bool matchesStaticSelector(const std::string& selector); + bool matchesStaticSelector(const std::string& selector); - void markInert(); + void markInert(); + + IHyprLayout* getCurrentLayout(); private: void init(PHLWORKSPACE self);