Repository navigation
feat: better tray support on Linux - #100
christophehenry wants to merge 1 commit into
Conversation
d92977d to
b2d9c61
Compare
| let icon = self.app_handle.default_window_icon().unwrap(); | ||
| let rgba = icon.rgba().to_vec(); | ||
|
|
||
| // convert from rgba to argb | ||
| let mut bytes = rgba; | ||
| for i in 0..(bytes.len() / 4) { | ||
| let j = i * 4; | ||
| let a = bytes[j + 3]; | ||
| bytes[j + 3] = bytes[j + 2]; | ||
| bytes[j + 2] = bytes[j + 1]; | ||
| bytes[j + 1] = bytes[j]; | ||
| bytes[j] = a; | ||
| } |
There was a problem hiding this comment.
| if tauri_plugin_os::platform() == "linux" { | ||
| linux(app) | ||
| } else { | ||
| all(app) | ||
| } |
There was a problem hiding this comment.
Is this correct or there's a better way?
There was a problem hiding this comment.
you could use rust’s #[cfg] attribute for conditional compilation. (for example#[cfg(all(desktop, not(target_os = "macos")))] )
9b5483a to
45bc258
Compare
45bc258 to
7f5f24c
Compare
|
Hi! Can I have another review? |
|
Hi @christophehenry ! Thanks again for the PR. For now we won't be able to merge your PR since there is already a work on going on tauri side. |
|
I'm sorry to hear that. I'm really missing this and the code is safe. There's no alternative? |
|
So… With the announcement of securix do you have more bandwidth to talk about a Linux version of Tchap desktop? |
This is an effort to solve #99 by using ksni as the tray icon implementation on Linux. This currently work under KDE Fedora and should not break behavior for Windows and macOS. Can someone confirm this works under GTK too?
Please excuse the potential mess in the code, I'm still learning Rust.