utils: New geometry spaces local/global

This commit is contained in:
Victoria Brekenfeld 2023-10-25 19:24:51 +02:00
parent c38a236ffa
commit 42aaafe586
18 changed files with 516 additions and 300 deletions

View file

@ -277,13 +277,16 @@ impl XwmHandler for State {
{
let space = self.common.shell.space_for(mapped).unwrap();
if space.is_floating(mapped) {
mapped.set_geometry(Rectangle::from_loc_and_size(
current_geo.loc,
(
w.map(|w| w as i32).unwrap_or(current_geo.size.w),
h.map(|h| h as i32).unwrap_or(current_geo.size.h),
),
))
mapped.set_geometry(
Rectangle::from_loc_and_size(
current_geo.loc,
(
w.map(|w| w as i32).unwrap_or(current_geo.size.w),
h.map(|h| h as i32).unwrap_or(current_geo.size.h),
),
)
.as_global(),
)
}
} else {
if let Some(x) = x {
@ -325,13 +328,13 @@ impl XwmHandler for State {
}
}
let geo = window.geometry();
let geo = window.geometry().as_global();
for (output, overlap) in self.common.shell.outputs().cloned().map(|o| {
let intersection = o.geometry().intersection(geo);
(o, intersection)
}) {
if let Some(overlap) = overlap {
window.output_enter(&output, overlap);
window.output_enter(&output, overlap.as_logical());
} else {
window.output_leave(&output);
}