mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-12-04 19:15:28 -05:00
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:
11 files changed
+254
No files matched your search
@@ -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"]
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
Reference in new issue
Block a user