shell: Rework maximize/fullscreen
This commit is contained in:
parent
72df9d07e6
commit
69563420fb
10 changed files with 295 additions and 435 deletions
|
|
@ -100,11 +100,9 @@ impl Shell {
|
|||
// update FocusStack and notify layouts about new focus (if any window)
|
||||
let element = match target {
|
||||
Some(KeyboardFocusTarget::Element(mapped)) => Some(mapped.clone()),
|
||||
Some(KeyboardFocusTarget::Fullscreen(window)) => state
|
||||
.common
|
||||
.shell
|
||||
.element_for_surface(&window.surface())
|
||||
.cloned(),
|
||||
Some(KeyboardFocusTarget::Fullscreen(window)) => {
|
||||
state.common.shell.element_for_surface(window).cloned()
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
|
@ -237,7 +235,7 @@ impl Common {
|
|||
let workspace = state.common.shell.active_space(&output);
|
||||
let focus_stack = workspace.focus_stack.get(&seat);
|
||||
if focus_stack.last().map(|m| m == &mapped).unwrap_or(false)
|
||||
&& workspace.get_fullscreen(&output).is_none()
|
||||
&& workspace.get_fullscreen().is_none()
|
||||
{
|
||||
continue; // Focus is valid
|
||||
} else {
|
||||
|
|
@ -268,9 +266,9 @@ impl Common {
|
|||
|
||||
if focus_stack
|
||||
.last()
|
||||
.map(|m| m.has_active_window(&window.surface()))
|
||||
.map(|m| m.has_active_window(&window))
|
||||
.unwrap_or(false)
|
||||
&& workspace.get_fullscreen(&output).is_some()
|
||||
&& workspace.get_fullscreen().is_some()
|
||||
{
|
||||
continue; // Focus is valid
|
||||
} else {
|
||||
|
|
@ -313,7 +311,7 @@ impl Common {
|
|||
.common
|
||||
.shell
|
||||
.active_space(&output)
|
||||
.get_fullscreen(&output)
|
||||
.get_fullscreen()
|
||||
.cloned()
|
||||
.map(KeyboardFocusTarget::Fullscreen)
|
||||
.or_else(|| {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
use std::sync::Weak;
|
||||
|
||||
use crate::{
|
||||
shell::{
|
||||
element::{CosmicMapped, CosmicWindow},
|
||||
layout::tiling::ResizeForkTarget,
|
||||
},
|
||||
shell::{element::CosmicMapped, layout::tiling::ResizeForkTarget, CosmicSurface},
|
||||
utils::prelude::*,
|
||||
wayland::handlers::xdg_shell::popup::get_popup_toplevel,
|
||||
};
|
||||
|
|
@ -22,7 +19,6 @@ use smithay::{
|
|||
},
|
||||
Seat,
|
||||
},
|
||||
output::WeakOutput,
|
||||
reexports::wayland_server::{backend::ObjectId, protocol::wl_surface::WlSurface, Resource},
|
||||
utils::{IsAlive, Serial},
|
||||
wayland::seat::WaylandFocus,
|
||||
|
|
@ -32,7 +28,7 @@ use smithay::{
|
|||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum PointerFocusTarget {
|
||||
Element(CosmicMapped),
|
||||
Fullscreen(CosmicWindow),
|
||||
Fullscreen(CosmicSurface),
|
||||
LayerSurface(LayerSurface),
|
||||
Popup(PopupKind),
|
||||
OverrideRedirect(X11Surface),
|
||||
|
|
@ -42,7 +38,7 @@ pub enum PointerFocusTarget {
|
|||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum KeyboardFocusTarget {
|
||||
Element(CosmicMapped),
|
||||
Fullscreen(CosmicWindow),
|
||||
Fullscreen(CosmicSurface),
|
||||
Group(WindowGroup),
|
||||
LayerSurface(LayerSurface),
|
||||
Popup(PopupKind),
|
||||
|
|
@ -561,8 +557,8 @@ impl From<CosmicMapped> for PointerFocusTarget {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<CosmicWindow> for PointerFocusTarget {
|
||||
fn from(s: CosmicWindow) -> Self {
|
||||
impl From<CosmicSurface> for PointerFocusTarget {
|
||||
fn from(s: CosmicSurface) -> Self {
|
||||
PointerFocusTarget::Fullscreen(s)
|
||||
}
|
||||
}
|
||||
|
|
@ -597,8 +593,8 @@ impl From<CosmicMapped> for KeyboardFocusTarget {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<CosmicWindow> for KeyboardFocusTarget {
|
||||
fn from(s: CosmicWindow) -> Self {
|
||||
impl From<CosmicSurface> for KeyboardFocusTarget {
|
||||
fn from(s: CosmicSurface) -> Self {
|
||||
KeyboardFocusTarget::Fullscreen(s)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue