diff --git a/docs/user/rules.md b/docs/user/rules.md index 13c40dd..ac2ff72 100644 --- a/docs/user/rules.md +++ b/docs/user/rules.md @@ -46,6 +46,7 @@ opening settings do not overwrite user changes made in the meantime. | `default_width` | float | Scrolling only. Column width fraction (0.1-1.0). Gap-aware: fractions that sum to 1 tile exactly. Overrides `layout.scrolling.default_width_fraction`. Dragging the column within or between scrolling workspaces retains its current width. Ignored in dwindle. | | `default_workspace` | int | Place on workspace N from 1 to 64. On dynamic outputs, values beyond the current count clamp to the last workspace. | | `default_fullscreen` | bool | Open in fullscreen. | +| `default_maximize_to_edges` | bool | Open maximized to edges, expanding the window to the usable area's edges, without gaps or borders. Layer-shell exclusive zones remain visible. | | `default_maximize` | bool | Open maximized. For tiled windows, Umbriel expands the column to full width without changing the layout when the client requests maximize. Floating windows fill the usable area. | | `default_focused` | bool | Take focus when opening on the active workspace. Defaults to `true`; set to `false` to preserve the existing focus. | | `default_pinned` | bool | Open pinned above regular windows and keep the window visible across workspace changes. Pinning makes a tiled window floating. | diff --git a/examples/config.toml b/examples/config.toml index 70300c7..07ede18 100644 --- a/examples/config.toml +++ b/examples/config.toml @@ -227,6 +227,14 @@ follows_mouse = false # default_focused = false # default_pinned = true +# [[window_rule]] +# match.app_id = "^discord$" +# default_maximize_to_edges = true +# +# [[window_rule]] +# match.title = "^Discord Updater$" +# default_maximize_to_edges = false + [[window_rule]] match.app_id = "^dev.noctalia.Noctalia$" default_floating = true diff --git a/src/config/config.cpp b/src/config/config.cpp index 8a1edc6..7eab014 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -1031,6 +1031,7 @@ namespace umbriel { keys.boolean("default_floating", rule.defaultFloating) .boolean("default_fullscreen", rule.defaultFullscreen) + .boolean("default_maximize_to_edges", rule.defaultMaximizeToEdges) .boolean("default_maximize", rule.defaultMaximize) .boolean("default_focused", rule.defaultFocused) .boolean("default_pinned", rule.defaultPinned) diff --git a/src/config/config.h b/src/config/config.h index a3975bb..3ab6c24 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -144,6 +144,7 @@ namespace umbriel { std::optional defaultWidth; // column width fraction override std::optional defaultWorkspace; // 1-64 std::optional defaultFullscreen; + std::optional defaultMaximizeToEdges; std::optional defaultMaximize; std::optional defaultFocused; std::optional defaultPinned; @@ -167,6 +168,7 @@ namespace umbriel { && defaultWidth == other.defaultWidth && defaultWorkspace == other.defaultWorkspace && defaultFullscreen == other.defaultFullscreen + && defaultMaximizeToEdges == other.defaultMaximizeToEdges && defaultMaximize == other.defaultMaximize && defaultFocused == other.defaultFocused && defaultPinned == other.defaultPinned @@ -188,6 +190,7 @@ namespace umbriel { std::optional defaultWidth; std::optional defaultWorkspace; std::optional defaultFullscreen; + std::optional defaultMaximizeToEdges; std::optional defaultMaximize; std::optional defaultFocused; std::optional defaultPinned; diff --git a/src/config/resolve.cpp b/src/config/resolve.cpp index 7d1446a..23c281a 100644 --- a/src/config/resolve.cpp +++ b/src/config/resolve.cpp @@ -143,6 +143,9 @@ namespace umbriel { if (rule.defaultFullscreen) { resolved.defaultFullscreen = rule.defaultFullscreen; } + if (rule.defaultMaximizeToEdges) { + resolved.defaultMaximizeToEdges = rule.defaultMaximizeToEdges; + } if (rule.defaultMaximize) { resolved.defaultMaximize = rule.defaultMaximize; } diff --git a/src/view/view.cpp b/src/view/view.cpp index 3f7cdde..1e5b070 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -1457,6 +1457,10 @@ namespace umbriel { setFullscreen(true); } + if (rule.defaultMaximizeToEdges && *rule.defaultMaximizeToEdges) { + setMaximizedToEdges(true); + } + if (Overview* overview = m_server->overview(); overview != nullptr && overview->active()) { overview->onViewMapped(this); } @@ -2241,6 +2245,12 @@ namespace umbriel { setFullscreen(true); } + if (changedInitialRule(rule.defaultMaximizeToEdges, initiallyApplied.defaultMaximizeToEdges) + && *rule.defaultMaximizeToEdges + && !m_maximizedToEdges) { + setMaximizedToEdges(true); + } + if (changedInitialRule(rule.defaultMaximize, initiallyApplied.defaultMaximize) && *rule.defaultMaximize && !m_toplevel->scheduled.maximized) {