Skip to content

Commit

Permalink
Fix swayosd-server exiting when no monitors exist (e.g. on switch to …
Browse files Browse the repository at this point in the history
…another tty) (#111)
  • Loading branch information
Ferdi265 authored Nov 26, 2024
1 parent c21d34d commit 3ccc06a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ pub struct SwayOSDApplication {
#[shrinkwrap(main_field)]
app: gtk::Application,
windows: Rc<RefCell<Vec<SwayosdWindow>>>,
_hold: Rc<gio::ApplicationHoldGuard>,
}

impl SwayOSDApplication {
pub fn new(server_config: ServerConfig, action_receiver: Receiver<(ArgTypes, String)>) -> Self {
let app = Application::new(Some(APPLICATION_NAME), ApplicationFlags::FLAGS_NONE);
let hold = Rc::new(app.hold());

app.add_main_option(
"config",
Expand Down Expand Up @@ -66,6 +68,7 @@ impl SwayOSDApplication {
let osd_app = SwayOSDApplication {
app: app.clone(),
windows: Rc::new(RefCell::new(Vec::new())),
_hold: hold,
};

// Apply Server Config
Expand Down

0 comments on commit 3ccc06a

Please sign in to comment.