2022-07-04 15:27:08 +02:00
|
|
|
use smithay::{
|
2022-09-09 20:00:00 -07:00
|
|
|
output::Output,
|
2024-04-05 13:53:35 +02:00
|
|
|
utils::{Rectangle, Transform},
|
2022-07-04 15:27:08 +02:00
|
|
|
};
|
|
|
|
|
|
2023-10-25 19:24:51 +02:00
|
|
|
pub use super::geometry::*;
|
2024-04-05 13:53:35 +02:00
|
|
|
pub use crate::shell::{SeatExt, Shell, Workspace};
|
2022-08-31 13:01:23 +02:00
|
|
|
pub use crate::state::{Common, State};
|
2022-07-05 18:46:38 +02:00
|
|
|
pub use crate::wayland::handlers::xdg_shell::popup::update_reactive_popups;
|
2022-07-04 15:27:08 +02:00
|
|
|
|
|
|
|
|
pub trait OutputExt {
|
2023-10-25 19:24:51 +02:00
|
|
|
fn geometry(&self) -> Rectangle<i32, Global>;
|
2022-07-04 15:27:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl OutputExt for Output {
|
2023-10-25 19:24:51 +02:00
|
|
|
fn geometry(&self) -> Rectangle<i32, Global> {
|
2022-07-04 16:00:29 +02:00
|
|
|
Rectangle::from_loc_and_size(self.current_location(), {
|
|
|
|
|
Transform::from(self.current_transform())
|
|
|
|
|
.transform_size(
|
|
|
|
|
self.current_mode()
|
|
|
|
|
.map(|m| m.size)
|
|
|
|
|
.unwrap_or_else(|| (0, 0).into()),
|
|
|
|
|
)
|
|
|
|
|
.to_f64()
|
|
|
|
|
.to_logical(self.current_scale().fractional_scale())
|
|
|
|
|
.to_i32_round()
|
|
|
|
|
})
|
2023-10-25 19:24:51 +02:00
|
|
|
.as_global()
|
2022-07-04 15:27:08 +02:00
|
|
|
}
|
|
|
|
|
}
|