Skip to content

Commit

Permalink
x11: implement Window::size
Browse files Browse the repository at this point in the history
  • Loading branch information
micahrj committed Sep 27, 2023
1 parent e84ab6b commit 96427c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/backend/x11/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ impl WindowInner {
let state = Rc::new(WindowState {
window_id,
gc_id,

shm_state: RefCell::new(shm_state),
expose_rects: RefCell::new(Vec::new()),
app_state: Rc::clone(&cx.inner.state),
Expand All @@ -220,7 +219,12 @@ impl WindowInner {
}

pub fn size(&self) -> Size {
unimplemented!()
self.size_inner().unwrap_or(Size::new(0.0, 0.0))
}

fn size_inner(&self) -> Result<Size> {
let geom = self.state.app_state.connection.get_geometry(self.state.window_id)?.reply()?;
Ok(Size::new(geom.width as f64, geom.height as f64))
}

pub fn scale(&self) -> f64 {
Expand Down

0 comments on commit 96427c3

Please sign in to comment.