Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
cd53858190 | |||
3288f18d85 |
@ -47,6 +47,16 @@ async fn create_provider_socket(name: &'static str, socket: &'static str) -> Res
|
||||
let mut sock_path = get_run_path()?;
|
||||
sock_path.push(format!("{}.sock", socket));
|
||||
if smol::fs::metadata(&sock_path).await.is_ok() {
|
||||
for entry in smol::fs::read_to_string("/proc/net/unix").await?.lines() {
|
||||
if entry.contains(socket) {
|
||||
tracing::error!(
|
||||
"Another instance is already using the {} socket {}!",
|
||||
name,
|
||||
socket
|
||||
);
|
||||
return Err(anyhow!("Socket in use"));
|
||||
}
|
||||
}
|
||||
tracing::debug!("removing old {} socket", name);
|
||||
smol::fs::remove_file(&sock_path).await?;
|
||||
}
|
||||
|
@ -220,8 +220,11 @@ impl NiriTag {
|
||||
}
|
||||
TagExclusive(t) => {
|
||||
tracing::debug!("Changing all tags");
|
||||
let (active_wid, inactive_wid): (HashMap<u64, u8>, HashMap<u64, u8>) =
|
||||
self.windows.iter().partition(|(_, it)| **it == t);
|
||||
let (active_wid, inactive_wid): (HashMap<u64, u8>, HashMap<u64, u8>) = self
|
||||
.windows
|
||||
.iter()
|
||||
.filter(|(_, it)| **it != 0)
|
||||
.partition(|(_, it)| **it == t);
|
||||
let focus = active_wid.keys().last();
|
||||
self.move_windows(&inactive, inactive_wid.keys().cloned().collect())
|
||||
.await;
|
||||
|
Loading…
Reference in New Issue
Block a user