diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-10-06 09:09:58 +0100 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-10-06 09:09:58 +0100 |
| commit | 095688712d2a064bb7bfaded3ffc21580e5d338f (patch) | |
| tree | e0b1ecfabeb704a4d71bc0542c9a96e3457ed086 /src/events/Windows.cpp | |
| parent | d264fbd36a7085ac8078d120a88acf1b8cae9289 (diff) | |
add minsize rule
Diffstat (limited to 'src/events/Windows.cpp')
| -rw-r--r-- | src/events/Windows.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 9b58d0f5..54da4747 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -249,6 +249,21 @@ void Events::listener_mapWindow(void* owner, void* data) { } catch (...) { Debug::log(LOG, "Rule size failed, rule: %s -> %s", r.szRule.c_str(), r.szValue.c_str()); } + } else if (r.szRule.find("minsize") == 0) { + try { + const auto VALUE = r.szRule.substr(r.szRule.find(" ") + 1); + const auto SIZEXSTR = VALUE.substr(0, VALUE.find(" ")); + const auto SIZEYSTR = VALUE.substr(VALUE.find(" ") + 1); + + const auto SIZE = Vector2D(std::max((double)std::stoll(SIZEXSTR), PWINDOW->m_vRealSize.goalv().x), std::max((double)std::stoll(SIZEYSTR), PWINDOW->m_vRealSize.goalv().y)); + + PWINDOW->m_vRealSize = SIZE; + g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goalv()); + + PWINDOW->m_bHidden = false; + } catch (...) { + Debug::log(LOG, "Rule minsize failed, rule: %s -> %s", r.szRule.c_str(), r.szValue.c_str()); + } } else if (r.szRule.find("move") == 0) { try { const auto VALUE = r.szRule.substr(r.szRule.find(" ") + 1); |
