Mercurial > tablet-emu
diff src/gtk.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/gtk.rs +++ b/src/gtk.rs @@ -18,9 +18,8 @@ use gio::prelude::*; use glib::clone; use gtk::prelude::*; -use std::env::args; use std::io::ErrorKind; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; use input_linux::Key; use crate::{ @@ -68,7 +67,7 @@ fn build_ui(application: >k::Applicati build_main_menu(application); let state = match State::new() { - Ok(state) => state, + Ok(state) => Arc::new(Mutex::new(state)), Err(err) => { match err.kind() { ErrorKind::NotFound => { @@ -179,12 +178,12 @@ fn build_ui(application: >k::Applicati window.show_all(); } -pub fn main() { +pub fn main(args: &[String]) { let application = gtk::Application::new( Some("fr.linkmauve.TabletEmu"), gio::ApplicationFlags::empty(), ) .expect("Initialisation failed…"); application.connect_activate(build_ui); - application.run(&args().collect::<Vec<_>>()); + application.run(args); }