tiling: Fix swap preview on different workspaces/outputs
This commit is contained in:
parent
e992a4b442
commit
e2ac5c0a23
3 changed files with 1010 additions and 932 deletions
|
|
@ -14,7 +14,7 @@ use crate::{
|
|||
config::WorkspaceLayout,
|
||||
shell::{
|
||||
focus::target::WindowGroup, grabs::SeatMoveGrabState, layout::tiling::ANIMATION_DURATION,
|
||||
CosmicMapped, CosmicMappedRenderElement, WorkspaceRenderElement,
|
||||
CosmicMapped, CosmicMappedRenderElement, OverviewMode, Trigger, WorkspaceRenderElement,
|
||||
},
|
||||
state::{Common, Fps},
|
||||
utils::prelude::{OutputExt, SeatExt},
|
||||
|
|
@ -489,6 +489,26 @@ where
|
|||
let overview = state.shell.overview_mode();
|
||||
let (resize_mode, resize_indicator) = state.shell.resize_mode();
|
||||
let resize_indicator = resize_indicator.map(|indicator| (resize_mode, indicator));
|
||||
let swap_tree = if let OverviewMode::Started(Trigger::KeyboardSwap(_, desc), _) = &overview.0 {
|
||||
if let Some(desc_output) = desc.output.upgrade() {
|
||||
if output != &desc_output || current.0 != desc.handle {
|
||||
state
|
||||
.shell
|
||||
.space_for_handle(&desc.handle)
|
||||
.and_then(|w| w.tiling_layer.tree_for_output(&desc_output))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let overview = (
|
||||
overview.0,
|
||||
overview.1.map(|indicator| (indicator, swap_tree)),
|
||||
);
|
||||
|
||||
let last_active_seat = state.last_active_seat().clone();
|
||||
let move_active = last_active_seat
|
||||
|
|
|
|||
|
|
@ -955,6 +955,13 @@ impl TilingLayout {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn tree_for_output(&self, output: &Output) -> Option<&Tree<Data>> {
|
||||
self.queues
|
||||
.get(output)
|
||||
.and_then(|queue| queue.trees.back())
|
||||
.map(|tree| &tree.0)
|
||||
}
|
||||
|
||||
pub fn unmap(&mut self, window: &CosmicMapped) -> Option<Output> {
|
||||
let output = {
|
||||
let node_id = window.tiling_node_id.lock().unwrap().clone()?;
|
||||
|
|
@ -2771,9 +2778,9 @@ impl TilingLayout {
|
|||
placeholder_id,
|
||||
Some(None),
|
||||
None,
|
||||
None,
|
||||
)
|
||||
.map(|x| x.0)
|
||||
.unwrap_or_default();
|
||||
.0;
|
||||
|
||||
let mut result = None;
|
||||
let mut lookup = Some(root.clone());
|
||||
|
|
@ -3366,10 +3373,9 @@ impl TilingLayout {
|
|||
&self,
|
||||
renderer: &mut R,
|
||||
output: &Output,
|
||||
workspace: &WorkspaceHandle,
|
||||
seat: Option<&Seat<State>>,
|
||||
non_exclusive_zone: Rectangle<i32, Logical>,
|
||||
overview: (OverviewMode, Option<SwapIndicator>),
|
||||
overview: (OverviewMode, Option<(SwapIndicator, Option<&Tree<Data>>)>),
|
||||
resize_indicator: Option<(ResizeMode, ResizeIndicator)>,
|
||||
indicator_thickness: u8,
|
||||
) -> Result<
|
||||
|
|
@ -3426,20 +3432,14 @@ impl TilingLayout {
|
|||
.then(|| self.last_overview_hover.as_ref().map(|x| &x.1));
|
||||
let swap_desc = match &overview.0 {
|
||||
OverviewMode::Started(Trigger::KeyboardSwap(_, desc), _)
|
||||
| OverviewMode::Ended(Some(Trigger::KeyboardSwap(_, desc)), _) => {
|
||||
if desc.output == *output && desc.handle == *workspace {
|
||||
Some(desc.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
| OverviewMode::Ended(Some(Trigger::KeyboardSwap(_, desc)), _) => Some(desc.clone()),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
// all gone windows and fade them out
|
||||
let old_geometries = if let Some(reference_tree) = reference_tree.as_ref() {
|
||||
let (geometries, _) = if let Some(transition) = draw_groups {
|
||||
geometries_for_groupview(
|
||||
Some(geometries_for_groupview(
|
||||
reference_tree,
|
||||
&mut *renderer,
|
||||
non_exclusive_zone,
|
||||
|
|
@ -3451,7 +3451,8 @@ impl TilingLayout {
|
|||
&self.placeholder_id,
|
||||
is_mouse_tiling,
|
||||
swap_desc.clone(),
|
||||
)
|
||||
overview.1.as_ref().and_then(|(_, tree)| tree.clone()),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
@ -3476,7 +3477,7 @@ impl TilingLayout {
|
|||
};
|
||||
|
||||
let (geometries, group_elements) = if let Some(transition) = draw_groups {
|
||||
geometries_for_groupview(
|
||||
Some(geometries_for_groupview(
|
||||
target_tree,
|
||||
&mut *renderer,
|
||||
non_exclusive_zone,
|
||||
|
|
@ -3487,7 +3488,8 @@ impl TilingLayout {
|
|||
&self.placeholder_id,
|
||||
is_mouse_tiling,
|
||||
swap_desc.clone(),
|
||||
)
|
||||
overview.1.as_ref().and_then(|(_, tree)| tree.clone()),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
@ -3498,6 +3500,7 @@ impl TilingLayout {
|
|||
target_tree,
|
||||
reference_tree,
|
||||
renderer,
|
||||
non_exclusive_zone,
|
||||
geometries,
|
||||
old_geometries,
|
||||
is_overview,
|
||||
|
|
@ -3519,6 +3522,7 @@ impl TilingLayout {
|
|||
resize_indicator,
|
||||
swap_desc.clone(),
|
||||
&self.swapping_stack_surface_id,
|
||||
&self.placeholder_id,
|
||||
);
|
||||
window_elements.extend(w_elements);
|
||||
popup_elements.extend(p_elements);
|
||||
|
|
@ -3558,8 +3562,8 @@ fn swap_geometry(
|
|||
));
|
||||
|
||||
let loc = Point::from((
|
||||
relative_to.loc.x + relative_to.size.w - new_size.w + 16,
|
||||
relative_to.loc.y - 16,
|
||||
relative_to.loc.x + relative_to.size.w - new_size.w,
|
||||
relative_to.loc.y,
|
||||
));
|
||||
|
||||
Rectangle::from_loc_and_size(loc, new_size)
|
||||
|
|
@ -3576,10 +3580,11 @@ fn geometries_for_groupview<'a, R>(
|
|||
placeholder_id: &Id,
|
||||
mouse_tiling: Option<Option<&TargetZone>>,
|
||||
swap_desc: Option<NodeDesc>,
|
||||
) -> Option<(
|
||||
swap_tree: Option<&Tree<Data>>,
|
||||
) -> (
|
||||
HashMap<NodeId, Rectangle<i32, Logical>>,
|
||||
Vec<CosmicMappedRenderElement<R>>,
|
||||
)>
|
||||
)
|
||||
where
|
||||
R: Renderer + ImportAll + ImportMem + AsGlowRenderer + 'a,
|
||||
<R as Renderer>::TextureId: 'static,
|
||||
|
|
@ -3587,7 +3592,6 @@ where
|
|||
CosmicWindowRenderElement<R>: RenderElement<R>,
|
||||
{
|
||||
// we need to recalculate geometry for all elements, if we are drawing groups
|
||||
if let Some(root) = tree.root_node_id() {
|
||||
let gap: i32 = (if mouse_tiling.is_some() {
|
||||
GAP_MOUSE
|
||||
} else {
|
||||
|
|
@ -3597,7 +3601,16 @@ where
|
|||
.round() as i32;
|
||||
let mut renderer = renderer.into();
|
||||
|
||||
let mut stack = vec![(non_exclusive_zone, 0)];
|
||||
let root = tree.root_node_id();
|
||||
let mut stack = Vec::new();
|
||||
if swap_tree.is_some() {
|
||||
// push bogos value, that will get ignored anyway
|
||||
stack.push((Rectangle::from_loc_and_size((0, 0), (320, 240)), 0));
|
||||
}
|
||||
if root.is_some() {
|
||||
stack.push((non_exclusive_zone, 0));
|
||||
}
|
||||
|
||||
let mut elements = Vec::new();
|
||||
let mut geometries: HashMap<NodeId, Rectangle<i32, Logical>> = HashMap::new();
|
||||
let alpha = alpha * transition;
|
||||
|
|
@ -3630,7 +3643,22 @@ where
|
|||
false
|
||||
};
|
||||
|
||||
for node_id in tree.traverse_pre_order_ids(root).unwrap() {
|
||||
for (tree, node_id) in root
|
||||
.into_iter()
|
||||
.flat_map(|root| tree.traverse_pre_order_ids(root).unwrap())
|
||||
.map(|id| (tree, id))
|
||||
.chain(
|
||||
swap_tree
|
||||
.as_ref()
|
||||
.filter(|_| swap_desc.as_ref().unwrap().stack_window.is_none())
|
||||
.into_iter()
|
||||
.flat_map(|tree| {
|
||||
tree.traverse_pre_order_ids(&swap_desc.as_ref().unwrap().node)
|
||||
.unwrap()
|
||||
})
|
||||
.map(|id| (*swap_tree.as_ref().unwrap(), id)),
|
||||
)
|
||||
{
|
||||
if let Some((mut geo, depth)) = stack.pop() {
|
||||
let node: &Node<Data> = tree.get(&node_id).unwrap();
|
||||
let data = node.data();
|
||||
|
|
@ -3738,7 +3766,8 @@ where
|
|||
geometries.insert(node_id.clone(), geo);
|
||||
|
||||
if let Some(renderer) = renderer.as_mut() {
|
||||
if (render_potential_group || render_active_child) && &node_id != root {
|
||||
if (render_potential_group || render_active_child) && Some(&node_id) != root
|
||||
{
|
||||
elements.push(
|
||||
IndicatorShader::element(
|
||||
*renderer,
|
||||
|
|
@ -3755,7 +3784,7 @@ where
|
|||
}
|
||||
if mouse_tiling.is_some()
|
||||
&& pill_indicator.is_some()
|
||||
&& &node_id != root
|
||||
&& Some(&node_id) != root
|
||||
{
|
||||
elements.push(
|
||||
IndicatorShader::element(
|
||||
|
|
@ -3803,16 +3832,13 @@ where
|
|||
Some(PillIndicator::Inner(pill_idx)) => {
|
||||
*pill_idx == own_idx || pill_idx + 1 == own_idx
|
||||
}
|
||||
Some(PillIndicator::Outer(dir)) => match (dir, orientation)
|
||||
{
|
||||
Some(PillIndicator::Outer(dir)) => match (dir, orientation) {
|
||||
(Direction::Left, Orientation::Horizontal)
|
||||
| (Direction::Right, Orientation::Horizontal)
|
||||
| (Direction::Up, Orientation::Vertical)
|
||||
| (Direction::Down, Orientation::Vertical) => true,
|
||||
(Direction::Left, Orientation::Vertical)
|
||||
| (Direction::Up, Orientation::Horizontal) => {
|
||||
own_idx == 0
|
||||
}
|
||||
| (Direction::Up, Orientation::Horizontal) => own_idx == 0,
|
||||
(Direction::Right, Orientation::Vertical)
|
||||
| (Direction::Down, Orientation::Horizontal) => {
|
||||
own_idx + 1 == parent.data().len()
|
||||
|
|
@ -3908,7 +3934,6 @@ where
|
|||
}
|
||||
|
||||
if matches!(swap_desc, Some(ref desc) if &desc.node == &node_id) {
|
||||
if let Some(focused_geo) = focused_geo {
|
||||
if let Some(renderer) = renderer.as_mut() {
|
||||
elements.push(
|
||||
BackdropShader::element(
|
||||
|
|
@ -3922,7 +3947,16 @@ where
|
|||
.into(),
|
||||
);
|
||||
}
|
||||
let swap_geo = swap_geometry(geo.size, focused_geo);
|
||||
let swap_geo = swap_geometry(
|
||||
geo.size,
|
||||
focused_geo.unwrap_or({
|
||||
let mut geo = non_exclusive_zone;
|
||||
geo.loc += (WINDOW_BACKDROP_BORDER, WINDOW_BACKDROP_BORDER).into();
|
||||
geo.size -=
|
||||
(WINDOW_BACKDROP_BORDER * 2, WINDOW_BACKDROP_BORDER * 2).into();
|
||||
geo
|
||||
}),
|
||||
);
|
||||
geo = ease(
|
||||
Linear,
|
||||
EaseRectangle(geo),
|
||||
|
|
@ -3931,7 +3965,6 @@ where
|
|||
)
|
||||
.unwrap();
|
||||
geometries.insert(node_id.clone(), geo);
|
||||
}
|
||||
};
|
||||
|
||||
let previous_length = match orientation {
|
||||
|
|
@ -3965,8 +3998,7 @@ where
|
|||
(geo.size.w, *size),
|
||||
);
|
||||
if mouse_tiling.is_some() {
|
||||
if let Some(PillIndicator::Inner(pill_idx)) = pill_indicator
|
||||
{
|
||||
if let Some(PillIndicator::Inner(pill_idx)) = pill_indicator {
|
||||
if *pill_idx == idx {
|
||||
geo.size.h -= 32;
|
||||
}
|
||||
|
|
@ -4008,8 +4040,7 @@ where
|
|||
(*size, geo.size.h),
|
||||
);
|
||||
if mouse_tiling.is_some() {
|
||||
if let Some(PillIndicator::Inner(pill_idx)) = pill_indicator
|
||||
{
|
||||
if let Some(PillIndicator::Inner(pill_idx)) = pill_indicator {
|
||||
if *pill_idx == idx {
|
||||
geo.size.w -= 32;
|
||||
}
|
||||
|
|
@ -4117,8 +4148,16 @@ where
|
|||
|
||||
if matches!(swap_desc, Some(ref desc) if &desc.node == &node_id && desc.stack_window.is_none())
|
||||
{
|
||||
if let Some(focused_geo) = focused_geo {
|
||||
let swap_geo = swap_geometry(geo.size, focused_geo);
|
||||
let swap_geo = swap_geometry(
|
||||
geo.size,
|
||||
focused_geo.unwrap_or({
|
||||
let mut geo = non_exclusive_zone;
|
||||
geo.loc += (WINDOW_BACKDROP_BORDER, WINDOW_BACKDROP_BORDER).into();
|
||||
geo.size -=
|
||||
(WINDOW_BACKDROP_BORDER * 2, WINDOW_BACKDROP_BORDER * 2).into();
|
||||
geo
|
||||
}),
|
||||
);
|
||||
geo = ease(
|
||||
Linear,
|
||||
EaseRectangle(geo),
|
||||
|
|
@ -4126,7 +4165,6 @@ where
|
|||
transition,
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
};
|
||||
|
||||
geometries.insert(node_id.clone(), geo);
|
||||
|
|
@ -4138,8 +4176,7 @@ where
|
|||
|
||||
if let Some(renderer) = renderer.as_mut() {
|
||||
geo.loc += (WINDOW_BACKDROP_BORDER, WINDOW_BACKDROP_BORDER).into();
|
||||
geo.size -=
|
||||
(WINDOW_BACKDROP_BORDER * 2, WINDOW_BACKDROP_BORDER * 2).into();
|
||||
geo.size -= (WINDOW_BACKDROP_BORDER * 2, WINDOW_BACKDROP_BORDER * 2).into();
|
||||
elements.push(
|
||||
BackdropShader::element(
|
||||
*renderer,
|
||||
|
|
@ -4159,10 +4196,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
Some((geometries, elements))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
(geometries, elements)
|
||||
}
|
||||
|
||||
fn render_old_tree<R>(
|
||||
|
|
@ -4301,6 +4335,7 @@ fn render_new_tree<R>(
|
|||
target_tree: &Tree<Data>,
|
||||
reference_tree: Option<&Tree<Data>>,
|
||||
renderer: &mut R,
|
||||
non_exclusive_zone: Rectangle<i32, Logical>,
|
||||
geometries: Option<HashMap<NodeId, Rectangle<i32, Logical>>>,
|
||||
old_geometries: Option<HashMap<NodeId, Rectangle<i32, Logical>>>,
|
||||
is_overview: bool,
|
||||
|
|
@ -4309,10 +4344,11 @@ fn render_new_tree<R>(
|
|||
percentage: f32,
|
||||
transition: Option<f32>,
|
||||
indicator_thickness: u8,
|
||||
overview: (OverviewMode, Option<SwapIndicator>),
|
||||
overview: (OverviewMode, Option<(SwapIndicator, Option<&Tree<Data>>)>),
|
||||
mut resize_indicator: Option<(ResizeMode, ResizeIndicator)>,
|
||||
swap_desc: Option<NodeDesc>,
|
||||
swapping_stack_surface_id: &Id,
|
||||
placeholder_id: &Id,
|
||||
) -> (
|
||||
Vec<CosmicMappedRenderElement<R>>,
|
||||
Vec<CosmicMappedRenderElement<R>>,
|
||||
|
|
@ -4339,6 +4375,7 @@ where
|
|||
})
|
||||
.map(|(id, _)| id);
|
||||
|
||||
let mut animating_window_elements = Vec::new();
|
||||
let mut window_elements = Vec::new();
|
||||
let mut popup_elements = Vec::new();
|
||||
|
||||
|
|
@ -4350,13 +4387,40 @@ where
|
|||
let output_geo = output.geometry();
|
||||
let output_scale = output.current_scale().fractional_scale();
|
||||
|
||||
if let Some(root) = target_tree.root_node_id() {
|
||||
let (swap_indicator, swap_tree) = overview.1.unzip();
|
||||
let swap_tree = swap_tree.flatten();
|
||||
|
||||
if target_tree.root_node_id().is_none() && swap_desc.is_some() {
|
||||
let mut geo = non_exclusive_zone;
|
||||
geo.loc += (WINDOW_BACKDROP_BORDER, WINDOW_BACKDROP_BORDER).into();
|
||||
geo.size -= (WINDOW_BACKDROP_BORDER * 2, WINDOW_BACKDROP_BORDER * 2).into();
|
||||
window_elements.push(
|
||||
BackdropShader::element(
|
||||
renderer,
|
||||
placeholder_id.clone(),
|
||||
geo,
|
||||
8.,
|
||||
transition.unwrap_or(1.0) * 0.4,
|
||||
GROUP_COLOR,
|
||||
)
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
|
||||
let old_geometries = old_geometries.unwrap_or_default();
|
||||
let geometries = geometries.unwrap_or_default();
|
||||
target_tree
|
||||
.traverse_pre_order_ids(root)
|
||||
.root_node_id()
|
||||
.into_iter()
|
||||
.flat_map(|root| target_tree.traverse_pre_order_ids(root).unwrap())
|
||||
.map(|id| (target_tree, id))
|
||||
.chain(swap_tree.into_iter().flat_map(|tree| {
|
||||
let sub_root = &swap_desc.as_ref().unwrap().node;
|
||||
tree.traverse_pre_order_ids(sub_root)
|
||||
.unwrap()
|
||||
.for_each(|node_id| {
|
||||
.map(move |id| (tree, id))
|
||||
}))
|
||||
.for_each(|(target_tree, node_id)| {
|
||||
let data = target_tree.get(&node_id).unwrap().data();
|
||||
let (original_geo, scaled_geo) = (data.geometry(), geometries.get(&node_id));
|
||||
|
||||
|
|
@ -4415,7 +4479,7 @@ where
|
|||
})
|
||||
.unwrap_or(*original_geo);
|
||||
|
||||
let (geo, alpha) = if let Some(old_geo) = old_geo.filter(|_| {
|
||||
let (geo, alpha, animating) = if let Some(old_geo) = old_geo.filter(|_| {
|
||||
swap_desc
|
||||
.as_ref()
|
||||
.map(|desc| desc.node != node_id && desc.stack_window.is_none())
|
||||
|
|
@ -4430,9 +4494,10 @@ where
|
|||
)
|
||||
.unwrap(),
|
||||
1.0,
|
||||
old_geo != new_geo,
|
||||
)
|
||||
} else {
|
||||
(new_geo, percentage)
|
||||
(new_geo, percentage, false)
|
||||
};
|
||||
if matches!(overview.0, OverviewMode::None) {
|
||||
crop_rect = &geo;
|
||||
|
|
@ -4463,9 +4528,6 @@ where
|
|||
));
|
||||
}
|
||||
|
||||
if swap_desc.as_ref().map(|desc| &desc.node) == Some(&node_id)
|
||||
|| focused.as_ref() == Some(&node_id)
|
||||
{
|
||||
if !swap_desc
|
||||
.as_ref()
|
||||
.map(|desc| desc.stack_window.is_some())
|
||||
|
|
@ -4475,13 +4537,10 @@ where
|
|||
indicators.push(IndicatorShader::focus_element(
|
||||
renderer,
|
||||
match data {
|
||||
Data::Mapped { mapped, .. } => Key::Window(
|
||||
Usage::FocusIndicator,
|
||||
mapped.clone().into(),
|
||||
),
|
||||
Data::Group { alive, .. } => {
|
||||
Key::Group(Arc::downgrade(alive))
|
||||
Data::Mapped { mapped, .. } => {
|
||||
Key::Window(Usage::FocusIndicator, mapped.clone().into())
|
||||
}
|
||||
Data::Group { alive, .. } => Key::Group(Arc::downgrade(alive)),
|
||||
_ => unreachable!(),
|
||||
},
|
||||
geo,
|
||||
|
|
@ -4539,9 +4598,9 @@ where
|
|||
CosmicMappedRenderElement::GrabbedWindow(
|
||||
RescaleRenderElement::from_element(
|
||||
window,
|
||||
swap_geo.loc.to_physical_precise_round(
|
||||
output_scale,
|
||||
),
|
||||
swap_geo
|
||||
.loc
|
||||
.to_physical_precise_round(output_scale),
|
||||
ease(
|
||||
Linear,
|
||||
1.0,
|
||||
|
|
@ -4558,7 +4617,7 @@ where
|
|||
if focused.as_ref() == Some(&node_id)
|
||||
&& swap_desc.as_ref().map(|desc| &desc.node) != Some(&node_id)
|
||||
{
|
||||
if let Some(swap) = &overview.1 {
|
||||
if let Some(swap) = swap_indicator.as_ref() {
|
||||
swap.resize(geo.size);
|
||||
swap.output_enter(output, output_geo);
|
||||
swap_elements.extend(
|
||||
|
|
@ -4574,7 +4633,6 @@ where
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some((mode, resize)) = resize_indicator.as_mut() {
|
||||
let mut geo = geo.clone();
|
||||
|
|
@ -4725,8 +4783,12 @@ where
|
|||
.unwrap_or(false)
|
||||
{
|
||||
swap_elements.extend(w_elements);
|
||||
} else {
|
||||
if animating {
|
||||
animating_window_elements.extend(w_elements);
|
||||
} else {
|
||||
window_elements.extend(w_elements);
|
||||
}
|
||||
popup_elements.extend(p_elements)
|
||||
}
|
||||
}
|
||||
|
|
@ -4738,9 +4800,9 @@ where
|
|||
.chain(swap_elements)
|
||||
.chain(indicators.into_iter().map(Into::into))
|
||||
.chain(window_elements)
|
||||
.chain(animating_window_elements)
|
||||
.chain(group_backdrop.into_iter().map(Into::into))
|
||||
.collect();
|
||||
}
|
||||
|
||||
(window_elements, popup_elements)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ use crate::{
|
|||
xwayland::XWaylandState,
|
||||
};
|
||||
|
||||
use id_tree::Tree;
|
||||
use indexmap::IndexSet;
|
||||
use smithay::{
|
||||
backend::renderer::{
|
||||
|
|
@ -57,7 +58,7 @@ use super::{
|
|||
FocusStack, FocusStackMut,
|
||||
},
|
||||
grabs::{ResizeEdge, ResizeGrab},
|
||||
layout::tiling::NodeDesc,
|
||||
layout::tiling::{Data, NodeDesc},
|
||||
CosmicMappedRenderElement, CosmicSurface, ResizeDirection, ResizeMode,
|
||||
};
|
||||
|
||||
|
|
@ -527,7 +528,7 @@ impl Workspace {
|
|||
override_redirect_windows: &[X11Surface],
|
||||
xwm_state: Option<&'a mut XWaylandState>,
|
||||
draw_focus_indicator: Option<&Seat<State>>,
|
||||
overview: (OverviewMode, Option<SwapIndicator>),
|
||||
overview: (OverviewMode, Option<(SwapIndicator, Option<&Tree<Data>>)>),
|
||||
resize_indicator: Option<(ResizeMode, ResizeIndicator)>,
|
||||
indicator_thickness: u8,
|
||||
) -> Result<
|
||||
|
|
@ -595,10 +596,6 @@ impl Workspace {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// TODO: Handle modes like
|
||||
// - keyboard window swapping
|
||||
// - resizing in tiling
|
||||
|
||||
// OR windows above all
|
||||
popup_elements.extend(
|
||||
override_redirect_windows
|
||||
|
|
@ -648,14 +645,25 @@ impl Workspace {
|
|||
popup_elements.extend(p_elements.into_iter().map(WorkspaceRenderElement::from));
|
||||
window_elements.extend(w_elements.into_iter().map(WorkspaceRenderElement::from));
|
||||
|
||||
let alpha = match &overview.0 {
|
||||
OverviewMode::Started(_, start) => Some(
|
||||
(Instant::now().duration_since(*start).as_millis() as f64 / 100.0).min(1.0)
|
||||
as f32,
|
||||
),
|
||||
OverviewMode::Ended(_, ended) => Some(
|
||||
1.0 - (Instant::now().duration_since(*ended).as_millis() as f64 / 100.0)
|
||||
.min(1.0) as f32,
|
||||
),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
//tiling surfaces
|
||||
let (w_elements, p_elements) = self.tiling_layer.render_output::<R>(
|
||||
renderer,
|
||||
output,
|
||||
&self.handle,
|
||||
draw_focus_indicator,
|
||||
layer_map.non_exclusive_zone(),
|
||||
overview.clone(),
|
||||
overview,
|
||||
resize_indicator,
|
||||
indicator_thickness,
|
||||
)?;
|
||||
|
|
@ -674,18 +682,6 @@ impl Workspace {
|
|||
}
|
||||
}
|
||||
|
||||
let alpha = match overview.0 {
|
||||
OverviewMode::Started(_, start) => Some(
|
||||
(Instant::now().duration_since(start).as_millis() as f64 / 100.0).min(1.0)
|
||||
as f32,
|
||||
),
|
||||
OverviewMode::Ended(_, ended) => Some(
|
||||
1.0 - (Instant::now().duration_since(ended).as_millis() as f64 / 100.0).min(1.0)
|
||||
as f32,
|
||||
),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
if let Some(alpha) = alpha {
|
||||
window_elements.push(
|
||||
Into::<CosmicMappedRenderElement<R>>::into(BackdropShader::element(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue