fix(linux): provide the XEmbed tray helper and i3 rules

Use the existing GTK 3 helper to render tray icons and menus for both desktop interfaces on X11. Ship optional i3 rules for centering GP Connect windows in Arch packages.
This commit is contained in:
Kevin Yue committed 2026-12-05 00:10:43 +08:00
1 parent ff10375b80
commit 9864560f99
11 files changed
+254

No files matched your search

+2
View File
@@ -39,6 +39,8 @@ pub mod rendering_recovery;
#[cfg(windows)]
#[path = "windows/user_process.rs"]
pub mod user_process;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
pub mod xembed_tray;
#[cfg(windows)]
#[path = "windows/desktop_auth.rs"]
+38
View File
@@ -0,0 +1,38 @@
//! Private protocol between the desktop and its GTK 3 tray helper.
use serde::{Deserialize, Serialize};
use std::process::Command;
pub const OPTION: &str = "--xembed-tray";
pub fn command() -> Command {
let mut command = Command::new(common::binary_paths::gpgui_helper());
command.arg(OPTION).env("GDK_BACKEND", "x11");
command
}
#[derive(Serialize, Deserialize)]
pub enum Request {
Frame {
png: Vec<u8>,
tooltip: String,
menu: Vec<MenuEntry>,
},
Icon(Vec<u8>),
}
#[derive(Serialize, Deserialize)]
pub enum MenuEntry {
Label(String),
Action {
id: String,
label: String,
enabled: bool,
checked: Option<bool>,
},
Submenu {
label: String,
enabled: bool,
items: Vec<MenuEntry>,
},
Separator,
}