mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2025-01-29 20:34:46 +01:00
Correct fullscreen mouse input on winit
This commit is contained in:
parent
7a8fc983a9
commit
77695c666e
1 changed files with 15 additions and 6 deletions
21
src/input.rs
21
src/input.rs
|
@ -5,6 +5,7 @@ use std::collections::HashMap;
|
|||
use crate::{
|
||||
api::msg::{CallbackId, Modifier, ModifierMask, OutgoingMsg},
|
||||
focus::FocusTarget,
|
||||
state::WithState,
|
||||
window::WindowElement,
|
||||
};
|
||||
use smithay::{
|
||||
|
@ -74,12 +75,20 @@ impl<B: Backend> State<B> {
|
|||
let layers = layer_map_for_output(output);
|
||||
|
||||
// I think I'm going a bit too far with the functional stuff
|
||||
layers
|
||||
.layer_under(wlr_layer::Layer::Overlay, point)
|
||||
.or_else(|| layers.layer_under(wlr_layer::Layer::Top, point))
|
||||
.map(|layer| {
|
||||
let layer_loc = layers.layer_geometry(layer).expect("no layer geo").loc;
|
||||
(FocusTarget::from(layer.clone()), output_geo.loc + layer_loc)
|
||||
[output]
|
||||
.into_iter()
|
||||
.flat_map(|op| op.with_state(|state| state.tags.clone()))
|
||||
.find(|tag| tag.fullscreen_window().is_some())
|
||||
.and_then(|tag| tag.fullscreen_window())
|
||||
.map(|window| (FocusTarget::from(window), output_geo.loc))
|
||||
.or_else(|| {
|
||||
layers
|
||||
.layer_under(wlr_layer::Layer::Overlay, point)
|
||||
.or_else(|| layers.layer_under(wlr_layer::Layer::Top, point))
|
||||
.map(|layer| {
|
||||
let layer_loc = layers.layer_geometry(layer).expect("no layer geo").loc;
|
||||
(FocusTarget::from(layer.clone()), output_geo.loc + layer_loc)
|
||||
})
|
||||
})
|
||||
.or_else(|| {
|
||||
self.space
|
||||
|
|
Loading…
Add table
Reference in a new issue