From db048e3634e95707cc4e13ae28c3d354930c1fca Mon Sep 17 00:00:00 2001 From: Jasson Date: Wed, 10 Jul 2024 07:35:04 -0400 Subject: [PATCH] Revert headers commit again --- hyprctl/main.cpp | 3 +++ src/config/ConfigManager.cpp | 6 +++--- src/config/ConfigManager.hpp | 6 ++++++ src/config/ConfigValue.hpp | 1 + src/desktop/LayerSurface.cpp | 5 +++-- src/layout/DwindleLayout.cpp | 2 +- src/layout/MasterLayout.cpp | 6 +++--- src/layout/MasterLayout.hpp | 6 ++++-- src/managers/input/InputManager.cpp | 9 +++++---- 9 files changed, 29 insertions(+), 15 deletions(-) diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 1e413ba0..45fe9142 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -9,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 011ebd7c..54d0c24a 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -3,6 +3,7 @@ #include "../render/decorations/CHyprGroupBarDecoration.hpp" #include "config/ConfigDataValues.hpp" +#include "helpers/varlist/VarList.hpp" #include "../protocols/LayerShell.hpp" #include "config/defaultConfig.hpp" @@ -27,7 +28,6 @@ #include using namespace Hyprutils::String; - extern "C" char** environ; /** @@ -1119,7 +1119,7 @@ std::vector CConfigManager::getMatchingRules(PHLWINDOW pWindow, boo if (!valid(pWindow)) return std::vector(); - // Adjust shadowExec based on window mapping status + // if the window is unmapped, don't process exec rules yet. shadowExec = shadowExec || !pWindow->m_bIsMapped; std::vector returns; @@ -2608,4 +2608,4 @@ std::optional CConfigManager::handlePlugin(const std::string& comma m_vDeclaredPlugins.push_back(path); return {}; -} \ No newline at end of file +} diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index e5986b45..1237bac2 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -3,17 +3,23 @@ #define CONFIG_MANAGER_H #include +#include "../debug/Log.hpp" #include #include "../defines.hpp" #include #include +#include +#include #include +#include #include #include "../helpers/WLClasses.hpp" #include "../helpers/Monitor.hpp" +#include "../helpers/varlist/VarList.hpp" #include "../desktop/Window.hpp" #include "../desktop/LayerSurface.hpp" +#include "defaultConfig.hpp" #include "ConfigDataValues.hpp" #include diff --git a/src/config/ConfigValue.hpp b/src/config/ConfigValue.hpp index 12c2c009..06be368d 100644 --- a/src/config/ConfigValue.hpp +++ b/src/config/ConfigValue.hpp @@ -3,6 +3,7 @@ #include #include #include +#include "../debug/Log.hpp" #include "../macros.hpp" #include "ConfigManager.hpp" diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp index 53affb86..82915a77 100644 --- a/src/desktop/LayerSurface.cpp +++ b/src/desktop/LayerSurface.cpp @@ -1,5 +1,6 @@ #include "LayerSurface.hpp" #include "../Compositor.hpp" +#include "../events/Events.hpp" #include "../protocols/LayerShell.hpp" #include "../protocols/core/Compositor.hpp" #include "../managers/SeatManager.hpp" @@ -366,12 +367,12 @@ void CLayerSurface::applyRules() { } else if (rule.rule == "dimaround") { dimAround = true; } else if (rule.rule.starts_with("xray")) { - Hyprutils::String::CVarList vars{rule.rule, 0, ' '}; + CVarList vars{rule.rule, 0, ' '}; try { xray = configStringToInt(vars[1]); } catch (...) {} } else if (rule.rule.starts_with("animation")) { - Hyprutils::String::CVarList vars{rule.rule, 2, 's'}; + CVarList vars{rule.rule, 2, 's'}; animationStyle = vars[1]; } } diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 8e8e1d87..cbeaa420 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -1019,7 +1019,7 @@ void CHyprDwindleLayout::alterSplitRatio(PHLWINDOW pWindow, float ratio, bool ex } std::any CHyprDwindleLayout::layoutMessage(SLayoutMessageHeader header, std::string message) { - const auto ARGS = Hyprutils::String::CVarList(message, 0, ' '); + const auto ARGS = CVarList(message, 0, ' '); if (ARGS[0] == "togglesplit") { toggleSplit(header.pWindow); } else if (ARGS[0] == "swapsplit") { diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 0fe9a0f2..965c0ed7 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -1096,7 +1096,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri g_pInputManager->m_pForcedFocus.reset(); }; - Hyprutils::String::CVarList vars(message, 0, ' '); + CVarList vars(message, 0, ' '); if (vars.size() < 1 || vars[0].empty()) { Debug::log(ERR, "layoutmsg called without params"); @@ -1376,7 +1376,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri } // If vars is null, we use the default list -void CHyprMasterLayout::runOrientationCycle(SLayoutMessageHeader& header, Hyprutils::String::CVarList* vars, int direction) { +void CHyprMasterLayout::runOrientationCycle(SLayoutMessageHeader& header, CVarList* vars, int direction) { std::vector cycle; if (vars != nullptr) buildOrientationCycleVectorFromVars(cycle, *vars); @@ -1416,7 +1416,7 @@ void CHyprMasterLayout::buildOrientationCycleVectorFromEOperation(std::vector& cycle, Hyprutils::String::CVarList& vars) { +void CHyprMasterLayout::buildOrientationCycleVectorFromVars(std::vector& cycle, CVarList& vars) { for (size_t i = 1; i < vars.size(); ++i) { if (vars[i] == "top") { cycle.push_back(ORIENTATION_TOP); diff --git a/src/layout/MasterLayout.hpp b/src/layout/MasterLayout.hpp index 0f8fa7be..30d5b3cf 100644 --- a/src/layout/MasterLayout.hpp +++ b/src/layout/MasterLayout.hpp @@ -2,8 +2,10 @@ #include "IHyprLayout.hpp" #include "../desktop/DesktopTypes.hpp" +#include "../config/ConfigManager.hpp" #include #include +#include #include enum eFullscreenMode : int8_t; @@ -75,9 +77,9 @@ class CHyprMasterLayout : public IHyprLayout { bool m_bForceWarps = false; - void buildOrientationCycleVectorFromVars(std::vector& cycle, Hyprutils::String::CVarList& vars); + void buildOrientationCycleVectorFromVars(std::vector& cycle, CVarList& vars); void buildOrientationCycleVectorFromEOperation(std::vector& cycle); - void runOrientationCycle(SLayoutMessageHeader& header, Hyprutils::String::CVarList* vars, int next); + void runOrientationCycle(SLayoutMessageHeader& header, CVarList* vars, int next); eOrientation getDynamicOrientation(PHLWORKSPACE); int getNodesOnWorkspace(const int&); void applyNodeDataToWindow(SMasterNodeData*); diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 00e13717..9180e9cd 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -861,7 +861,7 @@ void CInputManager::setupKeyboard(SP keeb) { keeb.get()); keeb->keyboardEvents.keymap.registerStaticListener( - [](void* owner, std::any data) { + [this](void* owner, std::any data) { auto PKEEB = ((IKeyboard*)owner)->self.lock(); const auto LAYOUT = PKEEB->getActiveLayout(); @@ -1173,7 +1173,7 @@ void CInputManager::setPointerConfigs() { } else if (ACCELPROFILE == "flat") { libinput_device_config_accel_set_profile(LIBINPUTDEV, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT); } else if (ACCELPROFILE.starts_with("custom")) { - Hyprutils::String::CVarList accelValues = {ACCELPROFILE, 0, ' '}; + CVarList accelValues = {ACCELPROFILE, 0, ' '}; try { double accelStep = std::stod(accelValues[1]); @@ -1185,7 +1185,7 @@ void CInputManager::setPointerConfigs() { const auto CONFIG = libinput_config_accel_create(LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM); if (!SCROLLPOINTS.empty()) { - Hyprutils::String::CVarList scrollValues = {SCROLLPOINTS, 0, ' '}; + CVarList scrollValues = {SCROLLPOINTS, 0, ' '}; try { double scrollStep = std::stod(scrollValues[0]); std::vector scrollPoints; @@ -1624,7 +1624,8 @@ void CInputManager::newSwitch(wlr_input_device* pDevice) { Debug::log(LOG, "New switch with name \"{}\" added", pDevice->name); - PNEWDEV->hyprListener_destroy.initCallback(&pDevice->events.destroy, [&](void* owner, void* data) { destroySwitch((SSwitchDevice*)owner); }, PNEWDEV, "SwitchDevice"); + PNEWDEV->hyprListener_destroy.initCallback( + &pDevice->events.destroy, [&](void* owner, void* data) { destroySwitch((SSwitchDevice*)owner); }, PNEWDEV, "SwitchDevice"); const auto PSWITCH = wlr_switch_from_input_device(pDevice);