xwayland: disallow focusing invisible windows
This commit is contained in:
parent
6e244a08ab
commit
a474033bff
1 changed files with 13 additions and 10 deletions
|
|
@ -22,7 +22,7 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
state::State,
|
state::State,
|
||||||
time::Time,
|
time::Time,
|
||||||
tree::ToplevelNode,
|
tree::{Node, ToplevelNode},
|
||||||
utils::{
|
utils::{
|
||||||
bitflags::BitflagsExt, buf::Buf, clonecell::CloneCell, copyhashmap::CopyHashMap,
|
bitflags::BitflagsExt, buf::Buf, clonecell::CloneCell, copyhashmap::CopyHashMap,
|
||||||
errorfmt::ErrorFmt, linkedlist::LinkedList, numcell::NumCell, oserror::OsError,
|
errorfmt::ErrorFmt, linkedlist::LinkedList, numcell::NumCell, oserror::OsError,
|
||||||
|
|
@ -1757,15 +1757,18 @@ impl Wm {
|
||||||
let new_window = self.windows.get(&event.event);
|
let new_window = self.windows.get(&event.event);
|
||||||
let mut focus_window = self.focus_window.as_ref();
|
let mut focus_window = self.focus_window.as_ref();
|
||||||
if let Some(window) = new_window {
|
if let Some(window) = new_window {
|
||||||
if let Some(prev) = focus_window {
|
if let Some(w) = window.window.get() {
|
||||||
let prev_pid = prev.info.pid.get();
|
if let Some(prev) = focus_window {
|
||||||
let new_pid = window.info.pid.get();
|
let prev_pid = prev.info.pid.get();
|
||||||
if prev_pid.is_some()
|
let new_pid = window.info.pid.get();
|
||||||
&& prev_pid == new_pid
|
if prev_pid.is_some()
|
||||||
&& revent.serial() >= self.last_input_serial
|
&& prev_pid == new_pid
|
||||||
{
|
&& revent.serial() >= self.last_input_serial
|
||||||
// log::info!("xwm ACCEPT");
|
&& w.surface.node_visible()
|
||||||
focus_window = new_window;
|
{
|
||||||
|
// log::info!("xwm ACCEPT");
|
||||||
|
focus_window = new_window;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue