Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ksni = ["dep:ksni"]
libappindicator = ["dep:libappindicator", "dep:gtk"]

[dependencies]
ksni = { version = "0.2.0", optional = true }
libappindicator = { version = "0.9", optional = true } # Tray icon
ksni = { version = "0.3.1", features = ["blocking"], optional = true }
gtk = { version = "0.18", optional = true }

[target.'cfg(target_os="windows")'.dependencies]
Expand Down
10 changes: 5 additions & 5 deletions src/api/linux_ksni/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{IconSource, TIError};
use ksni::{menu::StandardItem, Handle, Icon};
use ksni::blocking::TrayMethods;
use ksni::{blocking::Handle, menu::StandardItem, Icon};
use std::sync::{Arc, Mutex};

enum TrayItem {
Expand Down Expand Up @@ -85,15 +86,14 @@ impl ksni::Tray for Tray {

impl TrayItemLinux {
pub fn new(title: &str, icon: IconSource) -> Result<Self, TIError> {
let svc = ksni::TrayService::new(Tray {
let tray_handle = Tray {
title: title.to_string(),
icon,
actions: vec![],
next_id: 0,
});
};

let handle = svc.handle();
svc.spawn();
let handle = tray_handle.spawn().unwrap();

Ok(Self { tray: handle })
}
Expand Down