mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-05 04:45:59 +01:00
Fix exec-once being wack on launch
This commit is contained in:
parent
4bd23604f8
commit
17f63bf3e8
3 changed files with 22 additions and 1 deletions
|
@ -263,7 +263,7 @@ void CConfigManager::parseLine(std::string& line) {
|
|||
return;
|
||||
} else if (COMMAND == "exec-once") {
|
||||
if (isFirstLaunch) {
|
||||
handleRawExec(COMMAND, VALUE);
|
||||
firstExecRequests.push_back(VALUE);
|
||||
}
|
||||
return;
|
||||
} else if (COMMAND == "monitor") {
|
||||
|
@ -478,4 +478,17 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(CWindow* pWindow) {
|
|||
}
|
||||
|
||||
return returns;
|
||||
}
|
||||
|
||||
void CConfigManager::dispatchExecOnce() {
|
||||
if (firstExecDispatched || isFirstLaunch)
|
||||
return;
|
||||
|
||||
firstExecDispatched = true;
|
||||
|
||||
for (auto& c : firstExecRequests) {
|
||||
handleRawExec("", c);
|
||||
}
|
||||
|
||||
firstExecRequests.clear(); // free some kb of memory :P
|
||||
}
|
|
@ -51,6 +51,9 @@ public:
|
|||
|
||||
std::vector<SWindowRule> getMatchingRules(CWindow*);
|
||||
|
||||
// no-op when done.
|
||||
void dispatchExecOnce();
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, SConfigValue> configValues;
|
||||
time_t lastModifyTime = 0; // for reloading the config if changed
|
||||
|
@ -64,6 +67,9 @@ private:
|
|||
std::deque<SMonitorRule> m_dMonitorRules;
|
||||
std::deque<SWindowRule> m_dWindowRules;
|
||||
|
||||
bool firstExecDispatched = false;
|
||||
std::deque<std::string> firstExecRequests;
|
||||
|
||||
// internal methods
|
||||
void loadConfigLoadVars();
|
||||
SConfigValue getConfigValueSafe(std::string);
|
||||
|
|
|
@ -118,6 +118,8 @@ void Events::listener_monitorFrame(void* owner, void* data) {
|
|||
g_pCompositor->sanityCheckWorkspaces();
|
||||
g_pAnimationManager->tick();
|
||||
g_pCompositor->cleanupWindows();
|
||||
|
||||
g_pConfigManager->dispatchExecOnce(); // We exec-once when at least one monitor starts refreshing, meaning stuff has init'd
|
||||
}
|
||||
|
||||
timespec now;
|
||||
|
|
Loading…
Reference in a new issue