Compare commits

...

3 commits

Author SHA1 Message Date
29a2fd6d01 wmstate in main 2024-02-01 13:10:14 -08:00
669c2909fd more shorthands 2024-01-31 22:35:46 -08:00
7252529777 shorthanding 2024-01-31 22:35:11 -08:00
2 changed files with 9 additions and 7 deletions

View file

@ -3,6 +3,7 @@ mod state;
use setup::{become_wm, handle_args};
use state::WmState;
use x11rb::{connect, connection::Connection};
fn main() -> anyhow::Result<()> {
@ -17,6 +18,7 @@ fn main() -> anyhow::Result<()> {
become_wm(&conn, screen)?;
let mut _wm_state = WmState::new(&conn, screen_num)?;
// TODO: setup
// Whole bunch to do here
// - setting up application state

View file

@ -27,16 +27,16 @@ impl<'a, C: Connection> WmState<'a, C> {
conn.create_gc(black_gc, screen.root, &gc_aux)?;
conn.close_font(font)?;
let wm_protocols = conn.intern_atom(false, b"WM_PROTOCOLS")?;
let wm_delete_window = conn.intern_atom(false, b"WM_DELETE_WINDOW")?;
let wm_protocols = conn.intern_atom(false, b"WM_PROTOCOLS")?.reply()?.atom;
let wm_delete_window = conn.intern_atom(false, b"WM_DELETE_WINDOW")?.reply()?.atom;
Ok(WmState {
conn: conn,
screen_num: screen_num,
black_gc: black_gc,
conn,
screen_num,
black_gc,
windows: Vec::default(),
wm_protocols: wm_protocols.reply()?.atom,
wm_delete_window: wm_delete_window.reply()?.atom,
wm_protocols,
wm_delete_window,
})
}
}