shell: handle fullscreen windows on a dedicated layer
I hoped to split this up into multiple commits, but the api
changes to `shell/workspace.rs` were to invasive to feasibly do this.
Here is a rough list of changes:
- Fullscreen windows aren't mapped to other layers anymore
- This they need their own logic for:
- Sending frames
- Dmabuf Feedback
- Primary outputs
- On commit handlers
- cursor tests
- They get their own unmap/remap logic
- They get a new restore state similar to minimized windows
- Refactored the minimized window state to reuse as much as possible
here
- They need to be part of focus stacks, which means adjusting them
to a new type `FocusTarget` as they previously only handled
`CosmicMapped`.
- Various shell handlers (minimize, move, menu) now have dedicated
logic for fullscreen surfaces
- This was partially necessary due to relying on CosmicSurface now,
partially because they should've had their own logic from the
start. E.g. the context menu is now reflecting the fullscreen
state
- Fullscreen windows may be rendered behind other windows now, when they
loose focus.
- This needed changes to input handling / rendering
This commit is contained in:
parent
8ef6c161a0
commit
adedb705e7
23 changed files with 2554 additions and 1796 deletions
|
|
@ -391,9 +391,14 @@ impl State {
|
|||
//If the pointer isn't grabbed, we should check if the focused element should be updated
|
||||
} else if self.common.config.cosmic_conf.focus_follows_cursor {
|
||||
let shell = self.common.shell.read();
|
||||
let old_keyboard_target =
|
||||
State::element_under(original_position, ¤t_output, &*shell);
|
||||
let new_keyboard_target = State::element_under(position, &output, &*shell);
|
||||
let old_keyboard_target = State::element_under(
|
||||
original_position,
|
||||
¤t_output,
|
||||
&*shell,
|
||||
&seat,
|
||||
);
|
||||
let new_keyboard_target =
|
||||
State::element_under(position, &output, &*shell, &seat);
|
||||
|
||||
if old_keyboard_target != new_keyboard_target
|
||||
&& new_keyboard_target.is_some()
|
||||
|
|
@ -705,7 +710,7 @@ impl State {
|
|||
seat.get_pointer().unwrap().current_location().as_global();
|
||||
let under = {
|
||||
let shell = self.common.shell.read();
|
||||
State::element_under(global_position, &output, &shell)
|
||||
State::element_under(global_position, &output, &shell, &seat)
|
||||
};
|
||||
if let Some(target) = under {
|
||||
if let Some(surface) = target.toplevel().map(Cow::into_owned) {
|
||||
|
|
@ -1878,7 +1883,7 @@ impl State {
|
|||
for elem in old_descriptor.focus_stack.iter().flat_map(|node_id| {
|
||||
old_workspace.tiling_layer.element_for_node(node_id)
|
||||
}) {
|
||||
stack.append(elem);
|
||||
stack.append(elem.clone());
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
@ -1886,7 +1891,7 @@ impl State {
|
|||
for elem in new_descriptor.focus_stack.iter().flat_map(|node_id| {
|
||||
new_workspace.tiling_layer.element_for_node(node_id)
|
||||
}) {
|
||||
stack.append(elem);
|
||||
stack.append(elem.clone());
|
||||
}
|
||||
}
|
||||
if let Some(focus) = TilingLayout::swap_trees(
|
||||
|
|
@ -1938,7 +1943,7 @@ impl State {
|
|||
for elem in old_descriptor.focus_stack.iter().flat_map(|node_id| {
|
||||
old_workspace.tiling_layer.element_for_node(node_id)
|
||||
}) {
|
||||
stack.append(elem);
|
||||
stack.append(elem.clone());
|
||||
}
|
||||
}
|
||||
if let Some(focus) = TilingLayout::move_tree(
|
||||
|
|
@ -1968,6 +1973,7 @@ impl State {
|
|||
global_pos: Point<f64, Global>,
|
||||
output: &Output,
|
||||
shell: &Shell,
|
||||
seat: &Seat<State>,
|
||||
) -> Option<KeyboardFocusTarget> {
|
||||
let (previous_workspace, workspace) = shell.workspaces.active(output)?;
|
||||
let (previous_idx, idx) = shell.workspaces.active_num(output);
|
||||
|
|
@ -2062,7 +2068,7 @@ impl State {
|
|||
geometry.contains(global_pos.to_local(output).to_i32_round())
|
||||
})
|
||||
{
|
||||
if let Some(element) = workspace.popup_element_under(location) {
|
||||
if let Some(element) = workspace.popup_element_under(location, seat) {
|
||||
return ControlFlow::Break(Ok(Some(element)));
|
||||
}
|
||||
}
|
||||
|
|
@ -2077,7 +2083,8 @@ impl State {
|
|||
geometry.contains(global_pos.to_local(output).to_i32_round())
|
||||
})
|
||||
{
|
||||
if let Some(element) = workspace.toplevel_element_under(location) {
|
||||
if let Some(element) = workspace.toplevel_element_under(location, seat)
|
||||
{
|
||||
return ControlFlow::Break(Ok(Some(element)));
|
||||
}
|
||||
}
|
||||
|
|
@ -2112,6 +2119,7 @@ impl State {
|
|||
let relative_pos = global_pos.to_local(output);
|
||||
let output_geo = output.geometry();
|
||||
let overview = shell.overview_mode().0;
|
||||
let seat = shell.seats.last_active();
|
||||
|
||||
render_input_order(
|
||||
shell,
|
||||
|
|
@ -2224,7 +2232,7 @@ impl State {
|
|||
Stage::WorkspacePopups { workspace, offset } => {
|
||||
let global_pos = global_pos + offset.to_f64().as_global();
|
||||
if let Some(under) =
|
||||
workspace.popup_surface_under(global_pos, overview.clone())
|
||||
workspace.popup_surface_under(global_pos, overview.clone(), seat)
|
||||
{
|
||||
return ControlFlow::Break(Ok(Some(under)));
|
||||
}
|
||||
|
|
@ -2232,7 +2240,7 @@ impl State {
|
|||
Stage::Workspace { workspace, offset } => {
|
||||
let global_pos = global_pos + offset.to_f64().as_global();
|
||||
if let Some(under) =
|
||||
workspace.toplevel_surface_under(global_pos, overview.clone())
|
||||
workspace.toplevel_surface_under(global_pos, overview.clone(), seat)
|
||||
{
|
||||
return ControlFlow::Break(Ok(Some(under)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue