not really sure
This commit is contained in:
parent
2304968de7
commit
1ee395e708
17
src/wm.rs
17
src/wm.rs
|
@ -3,6 +3,7 @@ use std::{
|
|||
cell::{Cell, RefCell, RefMut},
|
||||
collections::HashMap,
|
||||
ffi::CString,
|
||||
hash::{Hash, Hasher},
|
||||
io::{Error, ErrorKind, Result},
|
||||
ptr::{null, null_mut},
|
||||
sync::Arc,
|
||||
|
@ -76,6 +77,14 @@ pub struct Client {
|
|||
window: Window,
|
||||
}
|
||||
|
||||
impl PartialEq for Client {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.window == other.window
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Client {}
|
||||
|
||||
pub struct XLibState {
|
||||
display: Display,
|
||||
root: Window,
|
||||
|
@ -352,9 +361,8 @@ impl WMState {
|
|||
xlib::MapRequest => {
|
||||
let event = unsafe { &event.map_request };
|
||||
|
||||
self.mut_state
|
||||
.borrow_mut()
|
||||
.clients
|
||||
let _ = self.mut_state.try_borrow_mut().and_then(|mut_state| {
|
||||
RefMut::map(mut_state, |t| &mut t.clients)
|
||||
.entry(event.window)
|
||||
.or_insert_with(|| {
|
||||
unsafe { xlib::XMapWindow(self.dpy(), event.window) };
|
||||
|
@ -362,6 +370,9 @@ impl WMState {
|
|||
window: event.window,
|
||||
})
|
||||
});
|
||||
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
xlib::UnmapNotify => {
|
||||
let event = unsafe { &event.unmap };
|
||||
|
|
Loading…
Reference in a new issue