mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
niri-ipc: Add window positions and sizes (#1265)
* Add window sizes and positions to the IPC * basic fixes * report window_loc instead of window pos * clean ups * make scrolling indices 1-based * add printing to niri msg windows * don't include render offset in floating tile pos --------- Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
This commit is contained in:
+17
-1
@@ -4,7 +4,7 @@ use std::rc::Rc;
|
||||
use std::time::Duration;
|
||||
|
||||
use niri_config::{CenterFocusedColumn, PresetSize, Struts};
|
||||
use niri_ipc::{ColumnDisplay, SizeChange};
|
||||
use niri_ipc::{ColumnDisplay, SizeChange, WindowLayout};
|
||||
use ordered_float::NotNan;
|
||||
use smithay::backend::renderer::gles::GlesRenderer;
|
||||
use smithay::utils::{Logical, Point, Rectangle, Scale, Serial, Size};
|
||||
@@ -2366,6 +2366,22 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn tiles_with_ipc_layouts(&self) -> impl Iterator<Item = (&Tile<W>, WindowLayout)> {
|
||||
self.columns
|
||||
.iter()
|
||||
.enumerate()
|
||||
.flat_map(move |(col_idx, col)| {
|
||||
col.tiles().enumerate().map(move |(tile_idx, (tile, _))| {
|
||||
let layout = WindowLayout {
|
||||
// Our indices are 1-based, consistent with the actions.
|
||||
pos_in_scrolling_layout: Some((col_idx + 1, tile_idx + 1)),
|
||||
..tile.ipc_layout_template()
|
||||
};
|
||||
(tile, layout)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
pub(super) fn insert_hint_area(
|
||||
&self,
|
||||
position: InsertPosition,
|
||||
|
||||
Reference in New Issue
Block a user