Skip to content

Commit

Permalink
fix(wayland): exit on event dispatch error
Browse files Browse the repository at this point in the history
This should hopefully resolve log spamming issues.
  • Loading branch information
JakeStanger committed Jun 20, 2024
1 parent 167f23d commit 7e04e30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/clients/wayland/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ mod macros;
mod wl_output;
mod wl_seat;

use crate::error::ERR_CHANNEL_RECV;
use crate::error::{ExitCode, ERR_CHANNEL_RECV};
use crate::{arc_mut, lock, register_client, send, spawn, spawn_blocking};
use std::process::exit;
use std::sync::{Arc, Mutex};

use calloop_channel::Event::Msg;
Expand Down Expand Up @@ -305,6 +306,8 @@ impl Environment {
"{:?}",
Report::new(err).wrap_err("Failed to dispatch pending wayland events")
);

exit(ExitCode::WaylandDispatchError as i32)
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub enum ExitCode {
GtkDisplay = 1,
CreateBars = 2,
IpcResponseError = 3,
WaylandDispatchError = 4,
}

pub const ERR_MUTEX_LOCK: &str = "Failed to get lock on Mutex";
Expand Down

0 comments on commit 7e04e30

Please sign in to comment.