shell: disable WindowUI detection if constraint is active

This commit is contained in:
Skygrango 2026-05-27 14:17:01 +08:00 committed by Ian Douglas Scott
parent 208c2128cd
commit 203cad8cbd
8 changed files with 69 additions and 24 deletions

View file

@ -731,7 +731,11 @@ impl FloatingLayout {
self.space.element_geometry(elem).map(RectExt::as_local)
}
pub fn popup_element_under(&self, location: Point<f64, Local>) -> Option<KeyboardFocusTarget> {
pub fn popup_element_under(
&self,
location: Point<f64, Local>,
seat: &Seat<State>,
) -> Option<KeyboardFocusTarget> {
self.space
.elements()
.rev()
@ -752,6 +756,7 @@ impl FloatingLayout {
if e.focus_under(
point.as_logical(),
WindowSurfaceType::POPUP | WindowSurfaceType::SUBSURFACE,
seat,
)
.is_some()
{
@ -765,6 +770,7 @@ impl FloatingLayout {
pub fn toplevel_element_under(
&self,
location: Point<f64, Local>,
seat: &Seat<State>,
) -> Option<KeyboardFocusTarget> {
self.space
.elements()
@ -786,6 +792,7 @@ impl FloatingLayout {
if e.focus_under(
point.as_logical(),
WindowSurfaceType::TOPLEVEL | WindowSurfaceType::SUBSURFACE,
seat,
)
.is_some()
{
@ -799,6 +806,7 @@ impl FloatingLayout {
pub fn popup_surface_under(
&self,
location: Point<f64, Local>,
seat: &Seat<State>,
) -> Option<(PointerFocusTarget, Point<f64, Local>)> {
self.space
.elements()
@ -820,6 +828,7 @@ impl FloatingLayout {
e.focus_under(
point.as_logical(),
WindowSurfaceType::POPUP | WindowSurfaceType::SUBSURFACE,
seat,
)
.map(|(surface, surface_offset)| {
(surface, render_location + surface_offset.as_local())
@ -830,6 +839,7 @@ impl FloatingLayout {
pub fn toplevel_surface_under(
&self,
location: Point<f64, Local>,
seat: &Seat<State>,
) -> Option<(PointerFocusTarget, Point<f64, Local>)> {
self.space
.elements()
@ -851,6 +861,7 @@ impl FloatingLayout {
e.focus_under(
point.as_logical(),
WindowSurfaceType::TOPLEVEL | WindowSurfaceType::SUBSURFACE,
seat,
)
.map(|(surface, surface_offset)| {
(surface, render_location + surface_offset.as_local())

View file

@ -3145,6 +3145,7 @@ impl TilingLayout {
pub fn popup_element_under(
&self,
location_f64: Point<f64, Local>,
seat: &Seat<State>,
) -> Option<KeyboardFocusTarget> {
let location = location_f64.to_i32_round();
@ -3157,6 +3158,7 @@ impl TilingLayout {
.focus_under(
(location_f64 - geo.loc.to_f64()).as_logical() + mapped.geometry().loc.to_f64(),
WindowSurfaceType::POPUP | WindowSurfaceType::SUBSURFACE,
seat,
)
.is_some()
{
@ -3170,6 +3172,7 @@ impl TilingLayout {
pub fn toplevel_element_under(
&self,
location_f64: Point<f64, Local>,
seat: &Seat<State>,
) -> Option<KeyboardFocusTarget> {
let location = location_f64.to_i32_round();
@ -3182,6 +3185,7 @@ impl TilingLayout {
.focus_under(
(location_f64 - geo.loc.to_f64()).as_logical() + mapped.geometry().loc.to_f64(),
WindowSurfaceType::TOPLEVEL | WindowSurfaceType::SUBSURFACE,
seat,
)
.is_some()
{
@ -3196,6 +3200,7 @@ impl TilingLayout {
&self,
location_f64: Point<f64, Local>,
overview: OverviewMode,
seat: &Seat<State>,
) -> Option<(PointerFocusTarget, Point<f64, Local>)> {
let location = location_f64.to_i32_round();
@ -3210,6 +3215,7 @@ impl TilingLayout {
if let Some((target, surface_offset)) = mapped.focus_under(
(location_f64 - geo.loc.to_f64()).as_logical() + mapped.geometry().loc.to_f64(),
WindowSurfaceType::POPUP | WindowSurfaceType::SUBSURFACE,
seat,
) {
return Some((
target,
@ -3227,6 +3233,7 @@ impl TilingLayout {
&self,
location_f64: Point<f64, Local>,
overview: OverviewMode,
seat: &Seat<State>,
) -> Option<(PointerFocusTarget, Point<f64, Local>)> {
let tree = &self.queue.trees.back().unwrap().0;
let root = tree.root_node_id()?;
@ -3243,6 +3250,7 @@ impl TilingLayout {
if let Some((target, surface_offset)) = mapped.focus_under(
(location_f64 - geo.loc.to_f64()).as_logical() + mapped.geometry().loc.to_f64(),
WindowSurfaceType::TOPLEVEL | WindowSurfaceType::SUBSURFACE,
seat,
) {
return Some((
target,
@ -3293,6 +3301,7 @@ impl TilingLayout {
.focus_under(
test_point,
WindowSurfaceType::TOPLEVEL | WindowSurfaceType::SUBSURFACE,
seat,
)
.map(|(surface, surface_offset)| {
(