shell: Focus window after unfullscreening
This commit is contained in:
parent
261134d827
commit
9d91014b8d
6 changed files with 55 additions and 25 deletions
|
|
@ -184,7 +184,11 @@ impl ToplevelManagementHandler for State {
|
|||
window: &<Self as ToplevelInfoHandler>::Window,
|
||||
) {
|
||||
let mut shell = self.common.shell.write();
|
||||
shell.unfullscreen_request(window, &self.common.event_loop_handle);
|
||||
if let Some(target) = shell.unfullscreen_request(window, &self.common.event_loop_handle) {
|
||||
let seat = shell.seats.last_active().clone();
|
||||
std::mem::drop(shell);
|
||||
Shell::set_focus(self, Some(&target), &seat, None, true);
|
||||
}
|
||||
}
|
||||
|
||||
fn maximize(&mut self, _dh: &DisplayHandle, window: &<Self as ToplevelInfoHandler>::Window) {
|
||||
|
|
|
|||
|
|
@ -261,7 +261,11 @@ impl XdgShellHandler for State {
|
|||
fn unfullscreen_request(&mut self, surface: ToplevelSurface) {
|
||||
let mut shell = self.common.shell.write();
|
||||
|
||||
if !shell.unfullscreen_request(&surface, &self.common.event_loop_handle) {
|
||||
if let Some(target) = shell.unfullscreen_request(&surface, &self.common.event_loop_handle) {
|
||||
let seat = shell.seats.last_active().clone();
|
||||
std::mem::drop(shell);
|
||||
Shell::set_focus(self, Some(&target), &seat, None, true);
|
||||
} else {
|
||||
if let Some(pending) = shell.pending_windows.iter_mut().find(|pending| {
|
||||
pending.surface.wl_surface().as_deref() == Some(surface.wl_surface())
|
||||
}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue