diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-28 08:45:12 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-28 08:45:12 +0400 |
| commit | b13892ca637cccfb496e3204b2793c069af17ccb (patch) | |
| tree | 751ba2381c595baae1296eb8cbd5889418541b10 /src/layout/tile.rs | |
| parent | 777ad4ee5c8cf84b2bfa13c6bdb0d254c24881f9 (diff) | |
| download | niri-b13892ca637cccfb496e3204b2793c069af17ccb.tar.gz niri-b13892ca637cccfb496e3204b2793c069af17ccb.tar.bz2 niri-b13892ca637cccfb496e3204b2793c069af17ccb.zip | |
Activate windows when clicking on the border
Diffstat (limited to 'src/layout/tile.rs')
| -rw-r--r-- | src/layout/tile.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/layout/tile.rs b/src/layout/tile.rs index 56af4fa4..ea8515af 100644 --- a/src/layout/tile.rs +++ b/src/layout/tile.rs @@ -6,7 +6,7 @@ use smithay::backend::renderer::element::solid::{SolidColorBuffer, SolidColorRen use smithay::backend::renderer::element::utils::{Relocate, RelocateRenderElement}; use smithay::backend::renderer::element::Kind; use smithay::backend::renderer::{ImportAll, Renderer}; -use smithay::utils::{Logical, Point, Scale, Size}; +use smithay::utils::{Logical, Point, Rectangle, Scale, Size}; use super::focus_ring::FocusRing; use super::workspace::WorkspaceRenderElement; @@ -150,6 +150,11 @@ impl<W: LayoutElement> Tile<W> { self.window.is_in_input_region(point) } + pub fn is_in_activation_region(&self, point: Point<f64, Logical>) -> bool { + let activation_region = Rectangle::from_loc_and_size((0, 0), self.tile_size()); + activation_region.to_f64().contains(point) + } + pub fn request_tile_size(&mut self, mut size: Size<i32, Logical>) { // Can't go through effective_border_width() because we might be fullscreen. if !self.border.is_off() { |
