shell: Focus new windows
This commit is contained in:
parent
ae33728a4e
commit
65046f1265
2 changed files with 6 additions and 3 deletions
|
|
@ -530,13 +530,14 @@ impl Shell {
|
||||||
.refresh(Some(&self.workspace_state));
|
.refresh(Some(&self.workspace_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn map_window(&mut self, window: &Window, output: &Output) {
|
pub fn map_window(&mut self, window: &Window, output: &Output, dh: &DisplayHandle) {
|
||||||
let pos = self
|
let pos = self
|
||||||
.pending_windows
|
.pending_windows
|
||||||
.iter()
|
.iter()
|
||||||
.position(|(w, _)| w == window)
|
.position(|(w, _)| w == window)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let (window, seat) = self.pending_windows.remove(pos);
|
let (window, seat) = self.pending_windows.remove(pos);
|
||||||
|
let surface = window.toplevel().wl_surface().clone();
|
||||||
|
|
||||||
let workspace = match &self.workspace_mode {
|
let workspace = match &self.workspace_mode {
|
||||||
WorkspaceMode::OutputBound => {
|
WorkspaceMode::OutputBound => {
|
||||||
|
|
@ -555,12 +556,12 @@ impl Shell {
|
||||||
.remove_workspace_state(&workspace.handle, WState::Hidden);
|
.remove_workspace_state(&workspace.handle, WState::Hidden);
|
||||||
self.toplevel_info_state
|
self.toplevel_info_state
|
||||||
.toplevel_enter_workspace(&window, &workspace.handle);
|
.toplevel_enter_workspace(&window, &workspace.handle);
|
||||||
let focus_stack = workspace.focus_stack(&seat);
|
|
||||||
if layout::should_be_floating(&window) {
|
if layout::should_be_floating(&window) {
|
||||||
workspace
|
workspace
|
||||||
.floating_layer
|
.floating_layer
|
||||||
.map_window(&mut workspace.space, window, &seat);
|
.map_window(&mut workspace.space, window, &seat);
|
||||||
} else {
|
} else {
|
||||||
|
let focus_stack = workspace.focus_stack(&seat);
|
||||||
workspace.tiling_layer.map_window(
|
workspace.tiling_layer.map_window(
|
||||||
&mut workspace.space,
|
&mut workspace.space,
|
||||||
window,
|
window,
|
||||||
|
|
@ -569,6 +570,8 @@ impl Shell {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.set_focus(dh, Some(&surface), &seat, None);
|
||||||
|
|
||||||
for window in self.active_space(output).space.windows() {
|
for window in self.active_space(output).space.windows() {
|
||||||
self.update_reactive_popups(window);
|
self.update_reactive_popups(window);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ impl CompositorHandler for State {
|
||||||
Kind::Xdg(toplevel) => {
|
Kind::Xdg(toplevel) => {
|
||||||
if self.toplevel_ensure_initial_configure(&toplevel) {
|
if self.toplevel_ensure_initial_configure(&toplevel) {
|
||||||
let output = active_output(&seat, &self.common);
|
let output = active_output(&seat, &self.common);
|
||||||
self.common.shell.map_window(&window, &output);
|
self.common.shell.map_window(&window, &output, dh);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue