mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 22:26:33 +00:00
fix: suppress GTK file-open warning, read server URL from env
This commit is contained in:
parent
76af07de61
commit
e7237d077f
2 changed files with 5 additions and 2 deletions
|
|
@ -13,5 +13,7 @@ fn main() {
|
|||
|
||||
gstreamer::init().expect("Failed to init GStreamer");
|
||||
let app = ui::build_app();
|
||||
std::process::exit(app.run().into());
|
||||
// Pass empty args to GTK — server URL handled via env or argv directly
|
||||
app.set_flags(gtk4::gio::ApplicationFlags::NON_UNIQUE | gtk4::gio::ApplicationFlags::HANDLES_COMMAND_LINE);
|
||||
std::process::exit(app.run_with_args::<&str>(&[]).into());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ fn activate(app: &Application) {
|
|||
|
||||
let (tx, rx) = mpsc::channel::<WorkerMsg>();
|
||||
|
||||
let server_url = std::env::args().nth(1);
|
||||
let server_url = std::env::var("BETTERFRAME_SERVER").ok()
|
||||
.or_else(|| std::env::args().nth(1));
|
||||
std::thread::spawn(move || {
|
||||
let server = server::discover_server(server_url.as_deref());
|
||||
info!("server: {server}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue