compositor: warn on start via a log about start-hyprland

This commit is contained in:
Vaxry 2025-12-17 19:26:10 +00:00
parent 18901b8e59
commit f88deb928a
Signed by: vaxry
GPG key ID: 665806380871D640
3 changed files with 10 additions and 3 deletions

View file

@ -142,8 +142,9 @@ static void aqLog(Aquamarine::eBackendLogLevel level, std::string msg) {
Debug::log(aqLevelToHl(level), "[AQ] {}", msg); Debug::log(aqLevelToHl(level), "[AQ] {}", msg);
} }
void CCompositor::setWatchdogFd(int fd) { bool CCompositor::setWatchdogFd(int fd) {
m_watchdogWriteFd = Hyprutils::OS::CFileDescriptor{fd}; m_watchdogWriteFd = Hyprutils::OS::CFileDescriptor{fd};
return m_watchdogWriteFd.isValid() && !m_watchdogWriteFd.isClosed();
} }
void CCompositor::bumpNofile() { void CCompositor::bumpNofile() {

View file

@ -67,7 +67,7 @@ class CCompositor {
void cleanup(); void cleanup();
void bumpNofile(); void bumpNofile();
void restoreNofile(); void restoreNofile();
void setWatchdogFd(int fd); bool setWatchdogFd(int fd);
bool m_readyToProcess = false; bool m_readyToProcess = false;
bool m_sessionActive = true; bool m_sessionActive = true;

View file

@ -211,10 +211,16 @@ int main(int argc, char** argv) {
reapZombieChildrenAutomatically(); reapZombieChildrenAutomatically();
bool watchdogOk = watchdogFd > 0;
if (watchdogFd > 0) if (watchdogFd > 0)
g_pCompositor->setWatchdogFd(watchdogFd); watchdogOk = g_pCompositor->setWatchdogFd(watchdogFd);
if (safeMode) if (safeMode)
g_pCompositor->m_safeMode = true; g_pCompositor->m_safeMode = true;
if (!watchdogOk)
Debug::log(WARN, "WARNING: Hyprland is being launched without start-hyprland. This is highly advised against.");
g_pCompositor->initServer(socketName, socketFd); g_pCompositor->initServer(socketName, socketFd);
if (verifyConfig) if (verifyConfig)