shell: Raise X11 surfaces on workspace activate
This commit is contained in:
parent
37623f063f
commit
8da782df67
2 changed files with 33 additions and 2 deletions
|
|
@ -1106,6 +1106,16 @@ impl Shell {
|
||||||
set.workspaces[set.active].tiling_layer.cleanup_drag();
|
set.workspaces[set.active].tiling_layer.cleanup_drag();
|
||||||
}
|
}
|
||||||
set.activate(idx, &mut self.workspace_state.update())?;
|
set.activate(idx, &mut self.workspace_state.update())?;
|
||||||
|
if let Some(xwm) = self
|
||||||
|
.xwayland_state
|
||||||
|
.as_mut()
|
||||||
|
.and_then(|state| state.xwm.as_mut())
|
||||||
|
{
|
||||||
|
let _ = set.workspaces[idx].raise_x11_windows(xwm);
|
||||||
|
for surface in &self.override_redirect_windows {
|
||||||
|
let _ = xwm.raise_window(surface);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let output_geo = output.geometry();
|
let output_geo = output.geometry();
|
||||||
Ok(Some(
|
Ok(Some(
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,17 @@ use smithay::{
|
||||||
desktop::{layer_map_for_output, space::SpaceElement},
|
desktop::{layer_map_for_output, space::SpaceElement},
|
||||||
input::{pointer::GrabStartData as PointerGrabStartData, Seat},
|
input::{pointer::GrabStartData as PointerGrabStartData, Seat},
|
||||||
output::Output,
|
output::Output,
|
||||||
reexports::wayland_server::{protocol::wl_surface::WlSurface, Client, Resource},
|
reexports::{
|
||||||
|
wayland_server::{protocol::wl_surface::WlSurface, Client, Resource},
|
||||||
|
x11rb::xcb_ffi::ConnectionError,
|
||||||
|
},
|
||||||
utils::{Buffer as BufferCoords, IsAlive, Logical, Physical, Point, Rectangle, Scale, Size},
|
utils::{Buffer as BufferCoords, IsAlive, Logical, Physical, Point, Rectangle, Scale, Size},
|
||||||
wayland::{
|
wayland::{
|
||||||
compositor::{add_blocker, Blocker, BlockerState},
|
compositor::{add_blocker, Blocker, BlockerState},
|
||||||
seat::WaylandFocus,
|
seat::WaylandFocus,
|
||||||
xdg_activation::{XdgActivationState, XdgActivationToken},
|
xdg_activation::{XdgActivationState, XdgActivationToken},
|
||||||
},
|
},
|
||||||
xwayland::X11Surface,
|
xwayland::{X11Surface, X11Wm},
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet, VecDeque},
|
collections::{HashMap, HashSet, VecDeque},
|
||||||
|
|
@ -866,6 +869,24 @@ impl Workspace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn raise_x11_windows(&mut self, xwm: &mut X11Wm) -> Result<(), ConnectionError> {
|
||||||
|
for window in self
|
||||||
|
.tiling_layer
|
||||||
|
.mapped()
|
||||||
|
.map(|(_, w, _)| w)
|
||||||
|
.chain(self.floating_layer.space.elements())
|
||||||
|
{
|
||||||
|
if let CosmicSurface::X11(surf) = window.active_window() {
|
||||||
|
xwm.raise_window(&surf)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if let Some(CosmicSurface::X11(ref surf)) = self.fullscreen.as_ref().map(|f| &f.surface) {
|
||||||
|
xwm.raise_window(surf)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn render<'a, R>(
|
pub fn render<'a, R>(
|
||||||
&self,
|
&self,
|
||||||
renderer: &mut R,
|
renderer: &mut R,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue