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/mod.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/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 484a377a..1a9b5076 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -920,11 +920,18 @@ impl<W: LayoutElement> Layout<W> { monitors[*active_monitor_idx].focus() } + /// Returns the window under the cursor and the position of its toplevel surface within the + /// output. + /// + /// `Some((w, Some(p)))` means that the cursor is within the window's input region and can be + /// used for delivering events to the window. `Some((w, None))` means that the cursor is within + /// the window's activation region, but not within the window's input region. For example, the + /// cursor may be on the window's server-side border. pub fn window_under( &self, output: &Output, pos_within_output: Point<f64, Logical>, - ) -> Option<(&W, Point<i32, Logical>)> { + ) -> Option<(&W, Option<Point<i32, Logical>>)> { let MonitorSet::Normal { monitors, .. } = &self.monitor_set else { return None; }; |
