Compare commits
3 Commits
456f56f5b5
...
29a2fd6d01
Author | SHA1 | Date |
---|---|---|
Zynh0722 | 29a2fd6d01 | |
Zynh0722 | 669c2909fd | |
Zynh0722 | 7252529777 |
|
@ -3,6 +3,7 @@ mod state;
|
||||||
|
|
||||||
use setup::{become_wm, handle_args};
|
use setup::{become_wm, handle_args};
|
||||||
|
|
||||||
|
use state::WmState;
|
||||||
use x11rb::{connect, connection::Connection};
|
use x11rb::{connect, connection::Connection};
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
|
@ -17,6 +18,7 @@ fn main() -> anyhow::Result<()> {
|
||||||
|
|
||||||
become_wm(&conn, screen)?;
|
become_wm(&conn, screen)?;
|
||||||
|
|
||||||
|
let mut _wm_state = WmState::new(&conn, screen_num)?;
|
||||||
// TODO: setup
|
// TODO: setup
|
||||||
// Whole bunch to do here
|
// Whole bunch to do here
|
||||||
// - setting up application state
|
// - setting up application state
|
||||||
|
|
14
src/state.rs
14
src/state.rs
|
@ -27,16 +27,16 @@ impl<'a, C: Connection> WmState<'a, C> {
|
||||||
conn.create_gc(black_gc, screen.root, &gc_aux)?;
|
conn.create_gc(black_gc, screen.root, &gc_aux)?;
|
||||||
conn.close_font(font)?;
|
conn.close_font(font)?;
|
||||||
|
|
||||||
let wm_protocols = conn.intern_atom(false, b"WM_PROTOCOLS")?;
|
let wm_protocols = conn.intern_atom(false, b"WM_PROTOCOLS")?.reply()?.atom;
|
||||||
let wm_delete_window = conn.intern_atom(false, b"WM_DELETE_WINDOW")?;
|
let wm_delete_window = conn.intern_atom(false, b"WM_DELETE_WINDOW")?.reply()?.atom;
|
||||||
|
|
||||||
Ok(WmState {
|
Ok(WmState {
|
||||||
conn: conn,
|
conn,
|
||||||
screen_num: screen_num,
|
screen_num,
|
||||||
black_gc: black_gc,
|
black_gc,
|
||||||
windows: Vec::default(),
|
windows: Vec::default(),
|
||||||
wm_protocols: wm_protocols.reply()?.atom,
|
wm_protocols,
|
||||||
wm_delete_window: wm_delete_window.reply()?.atom,
|
wm_delete_window,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue