linux/x11: Mark windows as destroyed after destroy request (#12892)
Turns out we still get FocusOut and UnmapNotify events after the window has been destroyed, which resulted in error messages popping up because we can't find the window anymore that we want to mark as unfocused. Release Notes: - N/A
This commit is contained in:
parent
a06189bbed
commit
ec9e700e70
2 changed files with 7 additions and 0 deletions
|
@ -458,6 +458,7 @@ impl X11Client {
|
|||
state
|
||||
.windows
|
||||
.get(&win)
|
||||
.filter(|window_reference| !window_reference.window.state.borrow().destroyed)
|
||||
.map(|window_reference| window_reference.window.clone())
|
||||
}
|
||||
|
||||
|
|
|
@ -154,6 +154,7 @@ pub struct Callbacks {
|
|||
}
|
||||
|
||||
pub struct X11WindowState {
|
||||
pub destroyed: bool,
|
||||
client: X11ClientStatePtr,
|
||||
executor: ForegroundExecutor,
|
||||
atoms: XcbAtoms,
|
||||
|
@ -368,6 +369,7 @@ impl X11WindowState {
|
|||
input_handler: None,
|
||||
appearance,
|
||||
handle,
|
||||
destroyed: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -394,6 +396,10 @@ impl Drop for X11Window {
|
|||
.unwrap();
|
||||
self.0.xcb_connection.flush().unwrap();
|
||||
|
||||
// Mark window as destroyed so that we can filter out when X11 events
|
||||
// for it still come in.
|
||||
state.destroyed = true;
|
||||
|
||||
let this_ptr = self.0.clone();
|
||||
let client_ptr = state.client.clone();
|
||||
state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue