options/m_option: allow /WS geometry parameter usable without XYWH

This allows specifying workspace while using autofit for window size
or leave it as default instead of mandatory geometry in pixels.
This commit is contained in:
nanahi authored and Kacper Michajłow committed 2026-04-06 18:23:25 +02:00
1 parent befe1e73a2
commit 94d06bc727
1 file changed
+4 -2
+4 -2
View File
@@ -2220,13 +2220,15 @@ static bool parse_geometry_str(struct m_geometry *gm, bstr s)
if (bstrchr(s, ':') < 0) {
gm->wh_valid = true;
if (!bstr_startswith0(s, "+") && !bstr_startswith0(s, "-")) {
if (!bstr_startswith0(s, "+") && !bstr_startswith0(s, "-") &&
!bstr_startswith0(s, "/"))
{
if (!bstr_startswith0(s, "x"))
READ_NUM(w, w_per);
if (bstr_eatstart0(&s, "x"))
READ_NUM(h, h_per);
}
if (s.len > 0) {
if (s.len > 0 && !bstr_startswith0(s, "/")) {
gm->xy_valid = true;
READ_SIGN(x_sign);
READ_NUM(x, x_per);