mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-28 23:50:55 +03:00
enable gtk frontend in windows (#58)
The gtk frontend can now be built in windows! The github workflow is updated to build GTK and add it to the releases section.
This commit is contained in:
committed by
GitHub
parent
cdd3a3b818
commit
d3fed1b769
@@ -27,7 +27,17 @@ use super::FrontendNotify;
|
||||
|
||||
pub fn run() -> glib::ExitCode {
|
||||
log::debug!("running gtk frontend");
|
||||
#[cfg(windows)]
|
||||
let ret = std::thread::Builder::new()
|
||||
.stack_size(8 * 1024 * 1024) // https://gitlab.gnome.org/GNOME/gtk/-/commit/52dbb3f372b2c3ea339e879689c1de535ba2c2c3 -> caused crash on windows
|
||||
.name("gtk".into())
|
||||
.spawn(gtk_main)
|
||||
.unwrap()
|
||||
.join()
|
||||
.unwrap();
|
||||
#[cfg(not(windows))]
|
||||
let ret = gtk_main();
|
||||
|
||||
log::debug!("frontend exited");
|
||||
ret
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
use std::{
|
||||
cell::{Cell, RefCell},
|
||||
os::unix::net::UnixStream,
|
||||
};
|
||||
use std::cell::{Cell, RefCell};
|
||||
|
||||
#[cfg(windows)]
|
||||
use std::net::TcpStream;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::net::UnixStream;
|
||||
|
||||
use adw::subclass::prelude::*;
|
||||
use adw::{
|
||||
@@ -29,7 +31,10 @@ pub struct Window {
|
||||
#[template_child]
|
||||
pub toast_overlay: TemplateChild<ToastOverlay>,
|
||||
pub clients: RefCell<Option<gio::ListStore>>,
|
||||
#[cfg(unix)]
|
||||
pub stream: RefCell<Option<UnixStream>>,
|
||||
#[cfg(windows)]
|
||||
pub stream: RefCell<Option<TcpStream>>,
|
||||
pub port: Cell<u16>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user