Revert headers commit again

This commit is contained in:
Jasson 2024-07-10 07:35:04 -04:00
parent c78893b7a2
commit db048e3634
9 changed files with 29 additions and 15 deletions

View file

@ -1,3 +1,4 @@
#include <cctype>
#include <netdb.h>
#include <netinet/in.h>
#include <cstdio>
@ -9,6 +10,7 @@
#include <sys/un.h>
#include <pwd.h>
#include <unistd.h>
#include <ranges>
#include <algorithm>
#include <csignal>
#include <format>
@ -20,6 +22,7 @@
#include <vector>
#include <deque>
#include <filesystem>
#include <cstdarg>
#include <regex>
#include <sys/socket.h>
#include <hyprutils/string/String.hpp>

View file

@ -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 <hyprutils/string/String.hpp>
using namespace Hyprutils::String;
extern "C" char** environ;
/**
@ -1119,7 +1119,7 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(PHLWINDOW pWindow, boo
if (!valid(pWindow))
return std::vector<SWindowRule>();
// 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<SWindowRule> returns;

View file

@ -3,17 +3,23 @@
#define CONFIG_MANAGER_H
#include <map>
#include "../debug/Log.hpp"
#include <unordered_map>
#include "../defines.hpp"
#include <vector>
#include <deque>
#include <algorithm>
#include <regex>
#include <optional>
#include <functional>
#include <xf86drmMode.h>
#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 <hyprlang.hpp>

View file

@ -3,6 +3,7 @@
#include <string>
#include <typeindex>
#include <hyprlang.hpp>
#include "../debug/Log.hpp"
#include "../macros.hpp"
#include "ConfigManager.hpp"

View file

@ -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];
}
}

View file

@ -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") {

View file

@ -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<eOrientation> cycle;
if (vars != nullptr)
buildOrientationCycleVectorFromVars(cycle, *vars);
@ -1416,7 +1416,7 @@ void CHyprMasterLayout::buildOrientationCycleVectorFromEOperation(std::vector<eO
}
}
void CHyprMasterLayout::buildOrientationCycleVectorFromVars(std::vector<eOrientation>& cycle, Hyprutils::String::CVarList& vars) {
void CHyprMasterLayout::buildOrientationCycleVectorFromVars(std::vector<eOrientation>& cycle, CVarList& vars) {
for (size_t i = 1; i < vars.size(); ++i) {
if (vars[i] == "top") {
cycle.push_back(ORIENTATION_TOP);

View file

@ -2,8 +2,10 @@
#include "IHyprLayout.hpp"
#include "../desktop/DesktopTypes.hpp"
#include "../config/ConfigManager.hpp"
#include <vector>
#include <list>
#include <deque>
#include <any>
enum eFullscreenMode : int8_t;
@ -75,9 +77,9 @@ class CHyprMasterLayout : public IHyprLayout {
bool m_bForceWarps = false;
void buildOrientationCycleVectorFromVars(std::vector<eOrientation>& cycle, Hyprutils::String::CVarList& vars);
void buildOrientationCycleVectorFromVars(std::vector<eOrientation>& cycle, CVarList& vars);
void buildOrientationCycleVectorFromEOperation(std::vector<eOrientation>& 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*);

View file

@ -861,7 +861,7 @@ void CInputManager::setupKeyboard(SP<IKeyboard> 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<double> 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);