xwm: Don't do multiple
This commit is contained in:
parent
7caae686fe
commit
659933b039
14 changed files with 114 additions and 90 deletions
|
|
@ -131,7 +131,7 @@ impl Shell {
|
|||
fn update_active<'a, 'b>(
|
||||
&mut self,
|
||||
seats: impl Iterator<Item = &'a Seat<State>>,
|
||||
xwms: impl Iterator<Item = &'b mut XWaylandState>,
|
||||
mut xwm: Option<&'b mut XWaylandState>,
|
||||
) {
|
||||
// update activate status
|
||||
let focused_windows = seats
|
||||
|
|
@ -144,16 +144,13 @@ impl Shell {
|
|||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let mut xwms = xwms.collect::<Vec<_>>();
|
||||
for output in self.outputs.iter() {
|
||||
let workspace = self.workspaces.active_mut(output);
|
||||
for focused in focused_windows.iter() {
|
||||
if workspace.floating_layer.mapped().any(|m| m == focused) {
|
||||
if let CosmicSurface::X11(window) = focused.active_window() {
|
||||
for xwm in xwms.iter_mut().flat_map(|state| state.xwm.as_mut()) {
|
||||
if Some(xwm.id()) == window.xwm_id() {
|
||||
let _ = xwm.raise_window(&window);
|
||||
}
|
||||
if let Some(xwm) = xwm.as_mut().and_then(|state| state.xwm.as_mut()) {
|
||||
let _ = xwm.raise_window(&window);
|
||||
}
|
||||
}
|
||||
workspace.floating_layer.space.raise_element(focused, true);
|
||||
|
|
@ -179,7 +176,7 @@ impl Common {
|
|||
state
|
||||
.common
|
||||
.shell
|
||||
.update_active(seats.iter(), state.common.xwayland_state.values_mut());
|
||||
.update_active(seats.iter(), state.common.xwayland_state.as_mut());
|
||||
}
|
||||
|
||||
pub fn refresh_focus(state: &mut State) {
|
||||
|
|
@ -274,6 +271,6 @@ impl Common {
|
|||
state
|
||||
.common
|
||||
.shell
|
||||
.update_active(seats.iter(), state.common.xwayland_state.values_mut())
|
||||
.update_active(seats.iter(), state.common.xwayland_state.as_mut())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1085,13 +1085,12 @@ impl Shell {
|
|||
.map(mapped.clone(), &seat, focus_stack.iter());
|
||||
}
|
||||
|
||||
if let CosmicSurface::X11(surface) = window {
|
||||
if let CosmicSurface::X11(_) = window {
|
||||
if let Some(xwm) = state
|
||||
.common
|
||||
.xwayland_state
|
||||
.values_mut()
|
||||
.flat_map(|state| state.xwm.as_mut())
|
||||
.find(|xwm| Some(xwm.id()) == surface.xwm_id())
|
||||
.as_mut()
|
||||
.and_then(|state| state.xwm.as_mut())
|
||||
{
|
||||
if let Err(err) = xwm.update_stacking_order_downwards(workspace.mapped()) {
|
||||
warn!(?err, "Failed to update Xwayland stacking order.");
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ impl Workspace {
|
|||
renderer: &mut R,
|
||||
output: &Output,
|
||||
override_redirect_windows: &[X11Surface],
|
||||
xwm_state: impl Iterator<Item = &'a mut XWaylandState>,
|
||||
xwm_state: Option<&'a mut XWaylandState>,
|
||||
draw_focus_indicator: Option<&Seat<State>>,
|
||||
exclude_workspace_overview: bool,
|
||||
) -> Result<Vec<WorkspaceRenderElement<R>>, OutputNotMapped>
|
||||
|
|
@ -502,7 +502,7 @@ impl Workspace {
|
|||
fullscreen, renderer, (0, 0).into(), output_scale.into()
|
||||
));
|
||||
|
||||
for xwm in xwm_state.flat_map(|state| state.xwm.as_mut()) {
|
||||
if let Some(xwm) = xwm_state.and_then(|state| state.xwm.as_mut()) {
|
||||
if let Err(err) =
|
||||
xwm.update_stacking_order_upwards(render_elements.iter().rev().map(|e| e.id()))
|
||||
{
|
||||
|
|
@ -584,7 +584,7 @@ impl Workspace {
|
|||
.map(WorkspaceRenderElement::from),
|
||||
);
|
||||
|
||||
for xwm in xwm_state.flat_map(|state| state.xwm.as_mut()) {
|
||||
if let Some(xwm) = xwm_state.and_then(|state| state.xwm.as_mut()) {
|
||||
if let Err(err) =
|
||||
xwm.update_stacking_order_upwards(render_elements.iter().rev().map(|e| e.id()))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue