From 33a5c8ce325e1657ec5571b57e05c6378706f4cd Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 25 Jul 2024 15:29:39 +0200 Subject: [PATCH] config: avoid using initial ws tracking for exec-once --- src/config/ConfigManager.cpp | 2 ++ src/config/ConfigManager.hpp | 8 +++++--- src/managers/KeybindManager.cpp | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 5a8f2bd2..657d7aff 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1299,12 +1299,14 @@ void CConfigManager::dispatchExecOnce() { "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE QT_QPA_PLATFORMTHEME PATH XDG_DATA_DIRS"); firstExecDispatched = true; + isLaunchingExecOnce = true; for (auto& c : firstExecRequests) { handleRawExec("", c); } firstExecRequests.clear(); // free some kb of memory :P + isLaunchingExecOnce = false; // set input, fixes some certain issues g_pInputManager->setKeyboardLayout(); diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp index b4a49b7a..454a12c0 100644 --- a/src/config/ConfigManager.hpp +++ b/src/config/ConfigManager.hpp @@ -129,9 +129,6 @@ class CConfigManager { void performMonitorReload(); void appendMonitorRule(const SMonitorRule&); bool replaceMonitorRule(const SMonitorRule&); - bool m_bWantsMonitorReload = false; - bool m_bForceReload = false; - bool m_bNoMonitorReload = false; void ensureMonitorStatus(); void ensureVRR(CMonitor* pMonitor = nullptr); @@ -192,6 +189,11 @@ class CConfigManager { std::unordered_map*(PHLWINDOW)>> miWindowProperties = { {"rounding", [](PHLWINDOW pWindow) { return &pWindow->m_sWindowData.rounding; }}, {"bordersize", [](PHLWINDOW pWindow) { return &pWindow->m_sWindowData.borderSize; }}}; + bool m_bWantsMonitorReload = false; + bool m_bForceReload = false; + bool m_bNoMonitorReload = false; + bool isLaunchingExecOnce = false; // For exec-once to skip initial ws tracking + private: std::unique_ptr m_pConfig; diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index caa2b137..22d9c3d7 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -36,7 +36,7 @@ using namespace Hyprutils::String; static std::vector> getHyprlandLaunchEnv() { static auto PINITIALWSTRACKING = CConfigValue("misc:initial_workspace_tracking"); - if (!*PINITIALWSTRACKING) + if (!*PINITIALWSTRACKING || g_pConfigManager->isLaunchingExecOnce) return {}; const auto PMONITOR = g_pCompositor->m_pLastMonitor;