aboutsummaryrefslogtreecommitdiff
path: root/src/layout/monitor.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-10-05 14:18:35 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-10-15 09:04:16 +0300
commite5d4e7c1b1a0b61770b6711a53fe41920d56452d (patch)
tree2f344704c67cfa2391fb3ca27606d7c4fd885a31 /src/layout/monitor.rs
parente420bb5ad7cef528edff58fc76ff878c4e4310ac (diff)
downloadniri-e5d4e7c1b1a0b61770b6711a53fe41920d56452d.tar.gz
niri-e5d4e7c1b1a0b61770b6711a53fe41920d56452d.tar.bz2
niri-e5d4e7c1b1a0b61770b6711a53fe41920d56452d.zip
layout/monitor: Make between-workspace insert hint narrower
I've got feedback that full-width hint looks like the window will be maximized on the new workspace.
Diffstat (limited to 'src/layout/monitor.rs')
-rw-r--r--src/layout/monitor.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs
index 8f322e9e..211b5249 100644
--- a/src/layout/monitor.rs
+++ b/src/layout/monitor.rs
@@ -1152,11 +1152,15 @@ impl<W: LayoutElement> Monitor<W> {
let hint_height = gap - hint_gap * 2.;
let next_ws_geo = self.workspaces_render_geo().nth(ws_idx).unwrap();
- let hint_loc_diff = Point::from((0., hint_height + hint_gap));
+ let hint_width = round_logical_in_physical(scale, next_ws_geo.size.w * 0.75);
+ let hint_x =
+ round_logical_in_physical(scale, (next_ws_geo.size.w - hint_width) / 2.);
+
+ let hint_loc_diff = Point::from((-hint_x, hint_height + hint_gap));
let hint_loc = next_ws_geo.loc - hint_loc_diff;
- let hint_size = Size::from((next_ws_geo.size.w, hint_height));
+ let hint_size = Size::from((hint_width, hint_height));
- // FIXME: sometimes the hint ends up 1 px wider than necessary and/or 1 px
+ // Sometimes the hint ends up 1 px wider than necessary and/or 1 px
// narrower than necessary. The values here seem correct. Might have to do with
// how zooming out currently doesn't round to output scale properly.