Skip to content

Commit

Permalink
Merge pull request #85 from gabm/multiple-instances
Browse files Browse the repository at this point in the history
allow multiple instances to be run simultaneously
  • Loading branch information
gabm authored May 13, 2024
2 parents 8070c2a + 1743c31 commit 0380308
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::ptr;
use std::{io, time::Duration};

use configuration::{Configuration, APP_CONFIG};
use gdk_pixbuf::gio::ApplicationFlags;
use gdk_pixbuf::{Pixbuf, PixbufLoader};
use gtk::prelude::*;

Expand Down Expand Up @@ -297,7 +298,13 @@ fn run_satty() -> Result<()> {
};

// start GUI
let app = RelmApp::new("com.gabm.satty").with_args(vec![]);
let app = relm4::main_application();
app.set_application_id(Some("com.gabm.satty"));
// set flag to allow to run multiple instances
app.set_flags(ApplicationFlags::NON_UNIQUE);

// create relm app and run
let app = RelmApp::from_app(app).with_args(vec![]);
relm4_icons::initialize_icons();
app.run::<App>(image);
Ok(())
Expand Down

0 comments on commit 0380308

Please sign in to comment.