aboutsummaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-12-30 08:48:05 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-12-30 20:12:37 +0300
commit8409107a5bb04980ea196a5d7095d5c34f6b2e4e (patch)
tree18a3fbcc3cab75a080f9f1d9c1ef2f06e55df237 /src/handlers
parent9089c3fb0224a7f8d425a02fa299f6a5ea607b17 (diff)
downloadniri-8409107a5bb04980ea196a5d7095d5c34f6b2e4e.tar.gz
niri-8409107a5bb04980ea196a5d7095d5c34f6b2e4e.tar.bz2
niri-8409107a5bb04980ea196a5d7095d5c34f6b2e4e.zip
Implement default-window-height for scrolling windows
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/compositor.rs8
-rw-r--r--src/handlers/xdg_shell.rs12
2 files changed, 15 insertions, 5 deletions
diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs
index ff927531..dec86929 100644
--- a/src/handlers/compositor.rs
+++ b/src/handlers/compositor.rs
@@ -97,10 +97,11 @@ impl CompositorHandler for State {
let toplevel = window.toplevel().expect("no X11 support");
- let (rules, width, is_full_width, output, workspace_id) =
+ let (rules, width, height, is_full_width, output, workspace_id) =
if let InitialConfigureState::Configured {
rules,
width,
+ height,
floating_width: _,
floating_height: _,
is_full_width,
@@ -118,10 +119,10 @@ impl CompositorHandler for State {
.and_then(|n| self.niri.layout.find_workspace_by_name(n))
.map(|(_, ws)| ws.id());
- (rules, width, is_full_width, output, workspace_id)
+ (rules, width, height, is_full_width, output, workspace_id)
} else {
error!("window map must happen after initial configure");
- (ResolvedWindowRules::empty(), None, false, None, None)
+ (ResolvedWindowRules::empty(), None, None, false, None, None)
};
// The GTK about dialog sets min/max size after the initial configure but
@@ -189,6 +190,7 @@ impl CompositorHandler for State {
mapped,
target,
width,
+ height,
is_full_width,
is_floating,
activate,
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs
index 62eafb1b..e6167b0a 100644
--- a/src/handlers/xdg_shell.rs
+++ b/src/handlers/xdg_shell.rs
@@ -505,6 +505,7 @@ impl XdgShellHandler for State {
InitialConfigureState::Configured {
rules,
width,
+ height,
floating_width,
floating_height,
is_full_width,
@@ -569,7 +570,11 @@ impl XdgShellHandler for State {
} else {
*width
};
- let configure_height = if is_floating { *floating_height } else { None };
+ let configure_height = if is_floating {
+ *floating_height
+ } else {
+ *height
+ };
ws.configure_new_window(
&unmapped.window,
configure_width,
@@ -854,6 +859,7 @@ impl State {
let mut width = None;
let mut floating_width = None;
+ let mut height = None;
let mut floating_height = None;
let is_full_width = rules.open_maximized.unwrap_or(false);
let is_floating = rules.compute_open_floating(toplevel);
@@ -880,6 +886,7 @@ impl State {
width = ws.resolve_default_width(rules.default_width, false);
floating_width = ws.resolve_default_width(rules.default_width, true);
+ height = ws.resolve_default_height(rules.default_height, false);
floating_height = ws.resolve_default_height(rules.default_height, true);
let configure_width = if is_floating {
@@ -889,7 +896,7 @@ impl State {
} else {
width
};
- let configure_height = if is_floating { floating_height } else { None };
+ let configure_height = if is_floating { floating_height } else { height };
ws.configure_new_window(
window,
configure_width,
@@ -914,6 +921,7 @@ impl State {
*state = InitialConfigureState::Configured {
rules,
width,
+ height,
floating_width,
floating_height,
is_full_width,