mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Account for border in contents_under()
Fixes pointer clicks going through window borders to a layer surface below, also fixes window not getting activated in all cases from a border click.
This commit is contained in:
@@ -14,7 +14,7 @@ use super::tile::Tile;
|
||||
use super::workspace::{
|
||||
OutputId, Workspace, WorkspaceAddWindowTarget, WorkspaceId, WorkspaceRenderElement,
|
||||
};
|
||||
use super::{ActivateWindow, LayoutElement, Options};
|
||||
use super::{ActivateWindow, HitType, LayoutElement, Options};
|
||||
use crate::animation::{Animation, Clock};
|
||||
use crate::input::swipe_tracker::SwipeTracker;
|
||||
use crate::render_helpers::renderer::NiriRenderer;
|
||||
@@ -1007,13 +1007,10 @@ impl<W: LayoutElement> Monitor<W> {
|
||||
Some((ws, bounds.loc))
|
||||
}
|
||||
|
||||
pub fn window_under(
|
||||
&self,
|
||||
pos_within_output: Point<f64, Logical>,
|
||||
) -> Option<(&W, Option<Point<f64, Logical>>)> {
|
||||
pub fn window_under(&self, pos_within_output: Point<f64, Logical>) -> Option<(&W, HitType)> {
|
||||
let (ws, offset) = self.workspace_under(pos_within_output)?;
|
||||
let (win, win_pos) = ws.window_under(pos_within_output - offset)?;
|
||||
Some((win, win_pos.map(|p| p + offset)))
|
||||
let (win, hit) = ws.window_under(pos_within_output - offset)?;
|
||||
Some((win, hit.offset_win_pos(offset)))
|
||||
}
|
||||
|
||||
pub fn resize_edges_under(&self, pos_within_output: Point<f64, Logical>) -> Option<ResizeEdge> {
|
||||
|
||||
Reference in New Issue
Block a user