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::{
|
use crate::{
|
||||||
api::msg::{CallbackId, Modifier, ModifierMask, OutgoingMsg},
|
api::msg::{CallbackId, Modifier, ModifierMask, OutgoingMsg},
|
||||||
focus::FocusTarget,
|
focus::FocusTarget,
|
||||||
|
state::WithState,
|
||||||
window::WindowElement,
|
window::WindowElement,
|
||||||
};
|
};
|
||||||
use smithay::{
|
use smithay::{
|
||||||
|
@ -74,12 +75,20 @@ impl<B: Backend> State<B> {
|
||||||
let layers = layer_map_for_output(output);
|
let layers = layer_map_for_output(output);
|
||||||
|
|
||||||
// I think I'm going a bit too far with the functional stuff
|
// I think I'm going a bit too far with the functional stuff
|
||||||
layers
|
[output]
|
||||||
.layer_under(wlr_layer::Layer::Overlay, point)
|
.into_iter()
|
||||||
.or_else(|| layers.layer_under(wlr_layer::Layer::Top, point))
|
.flat_map(|op| op.with_state(|state| state.tags.clone()))
|
||||||
.map(|layer| {
|
.find(|tag| tag.fullscreen_window().is_some())
|
||||||
let layer_loc = layers.layer_geometry(layer).expect("no layer geo").loc;
|
.and_then(|tag| tag.fullscreen_window())
|
||||||
(FocusTarget::from(layer.clone()), output_geo.loc + layer_loc)
|
.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(|| {
|
.or_else(|| {
|
||||||
self.space
|
self.space
|
||||||
|
|
Loading…
Add table
Reference in a new issue