This commit is contained in:
vaxerski 2022-03-19 17:00:52 +01:00
parent 0c88c0310e
commit dba7bbdcf3
2 changed files with 19 additions and 1 deletions

View File

@ -22,6 +22,18 @@ CConfigManager::CConfigManager() {
void CConfigManager::init() {
loadConfigLoadVars();
const char* const ENVHOME = getenv("HOME");
const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf");
struct stat fileStat;
int err = stat(CONFIGPATH.c_str(), &fileStat);
if (err != 0) {
Debug::log(WARN, "Error at statting config, error %i", errno);
}
lastModifyTime = fileStat.st_mtime;
isFirstLaunch = false;
}
@ -86,8 +98,8 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
curitem = argZ.substr(0, idx);
argZ = argZ.substr(idx + 1);
} else {
argZ = "";
curitem = argZ;
argZ = "";
}
};
@ -268,6 +280,8 @@ SMonitorRule CConfigManager::getMonitorRuleFor(std::string name) {
if (found)
return *found;
Debug::log(WARN, "No rule found for %s, trying to use the first.", name.c_str());
for (auto& r : m_dMonitorRules) {
if (r.name == "") {
found = &r;
@ -278,5 +292,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(std::string name) {
if (found)
return *found;
Debug::log(WARN, "No rules configured. Using the default hardcoded one.");
return SMonitorRule{.name = "", .resolution = Vector2D(1280, 720), .offset = Vector2D(0, 0), .mfact = 0.5f, .scale = 1};
}

View File

@ -232,6 +232,8 @@ void Events::listener_commitWindow(wl_listener* listener, void* data) {
void Events::listener_destroyWindow(wl_listener* listener, void* data) {
CWindow* PWINDOW = wl_container_of(listener, PWINDOW, listen_destroyWindow);
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);
g_pCompositor->removeWindowFromVectorSafe(PWINDOW);
Debug::log(LOG, "Window %x destroyed", PWINDOW);