drawin: Use get_object_mut() instead of set_state()
For the same reason as the last few commits did this.
@@ -74,10 +74,11 @@ impl <'lua> Drawin<'lua> {
}
fn set_visible(&mut self, val: bool) -> rlua::Result<()> {
- let mut drawin = self.state()?;
+ {
+ let mut drawin = self.get_object_mut()?;
drawin.visible = val;
- self.map()?;
- self.set_state(drawin)
+ }
+ self.map()
}
fn map(&mut self) -> rlua::Result<()> {
@@ -90,7 +91,8 @@ impl <'lua> Drawin<'lua> {
}
fn resize(&mut self, geometry: Geometry) -> rlua::Result<()> {
- let mut state = self.state()?;
+ {
+ let mut state = self.get_object_mut()?;
let old_geometry = state.geometry;
state.geometry = geometry;
if state.geometry.size.w <= 0 {
@@ -102,8 +104,7 @@ impl <'lua> Drawin<'lua> {
state.geometry_dirty = true;
// TODO emit signals
// TODO update screen workareas like in awesome? Might not be necessary
- // TODO Currently have to call set_state() before update_drawing; change that
- self.set_state(state)?;
+ }
self.update_drawing()
}
}
