summaryrefslogtreecommitdiff
path: root/src/events/Windows.cpp
diff options
context:
space:
mode:
authorEpilepsy Gatherings <73647246+phonetic112@users.noreply.github.com>2024-03-07 21:24:44 -0500
committerGitHub <noreply@github.com>2024-03-08 02:24:44 +0000
commite52d3fa8522ff83813a9006d4bf46b3057f4a4cc (patch)
tree31b7e16e9a76718fe6cb5b6b2c19948ef6f946b9 /src/events/Windows.cpp
parentceecdd0fd511122b7ff4f477a606880fe6599100 (diff)
windowrules: Make min/maxsize rules dynamic (#4775)
* rebase * simplify and remove prop * Stuff - add back win prop - change minsize defaults - change request formatting for setprop * style fix * remove empty line * change defaults * redo string to vec * remove redundant parsing * change to vec * support commas * remove static rules * take out garbage * format * don't allow commas and resize on setprop * use isNumber
Diffstat (limited to 'src/events/Windows.cpp')
-rw-r--r--src/events/Windows.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 0bf84f10..84040ad5 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -328,34 +328,6 @@ void Events::listener_mapWindow(void* owner, void* data) {
PWINDOW->setHidden(false);
} catch (...) { Debug::log(LOG, "Rule size failed, rule: {} -> {}", r.szRule, r.szValue); }
- } else if (r.szRule.starts_with("minsize")) {
- 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.goal().x), std::max((double)std::stoll(SIZEYSTR), PWINDOW->m_vRealSize.goal().y));
-
- PWINDOW->m_vRealSize = SIZE;
- g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goal());
-
- PWINDOW->setHidden(false);
- } catch (...) { Debug::log(LOG, "Rule minsize failed, rule: {} -> {}", r.szRule, r.szValue); }
- } else if (r.szRule.starts_with("maxsize")) {
- 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::min((double)std::stoll(SIZEXSTR), PWINDOW->m_vRealSize.goal().x), std::min((double)std::stoll(SIZEYSTR), PWINDOW->m_vRealSize.goal().y));
-
- PWINDOW->m_vRealSize = SIZE;
- g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goal());
-
- PWINDOW->setHidden(false);
- } catch (...) { Debug::log(LOG, "Rule maxsize failed, rule: {} -> {}", r.szRule, r.szValue); }
} else if (r.szRule.starts_with("move")) {
try {
auto value = r.szRule.substr(r.szRule.find(' ') + 1);