Mercurial > tablet-emu
diff src/state.rs @ 14:adab13145994
Add support for remote clients.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 02 Nov 2020 00:06:09 +0100 |
parents | 97e543f50f62 |
children | d103f7cca0bd |
line wrap: on
line diff
--- a/src/state.rs +++ b/src/state.rs @@ -15,7 +15,6 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use std::fs::File; -use std::sync::{Arc, Mutex}; use input_linux::{AbsoluteAxis, Key, MiscKind, SynchronizeKind, UInputHandle}; use crate::{DEFAULT_WIDTH, DEFAULT_HEIGHT, MAX_X, MAX_Y}; @@ -30,7 +29,7 @@ pub struct State { } impl State { - pub fn new() -> std::io::Result<Arc<Mutex<State>>> { + pub fn new() -> std::io::Result<State> { let dev = create_uinput_device()?; println!( "New device at {:?} ({:?})", @@ -38,13 +37,13 @@ impl State { dev.sys_path()? ); - Ok(Arc::new(Mutex::new(State { + Ok(State { dev, width: DEFAULT_WIDTH as f64, height: DEFAULT_HEIGHT as f64, selected_tool: Key::ButtonToolPen, pressed: false, - }))) + }) } pub fn set_size(&mut self, (width, height): (u32, u32)) {