mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-02 18:31:50 -04:00
Compare commits
3 Commits
fe3d3df662
...
dc9480fd71
Author | SHA1 | Date | |
---|---|---|---|
|
dc9480fd71 | ||
|
fa2849a080 | ||
|
c70c7ee5b9 |
10
.github/workflows/build.yaml
vendored
10
.github/workflows/build.yaml
vendored
@ -152,11 +152,13 @@ jobs:
|
||||
- name: Build ${{ matrix.package }} package in Docker
|
||||
run: |
|
||||
docker run --pull=always --rm \
|
||||
-e COREPACK_INTEGRITY_KEYS=0 \
|
||||
-v $(pwd)/build-gp-${{ matrix.package }}:/${{ matrix.package }} \
|
||||
yuezk/gpdev:${{ matrix.package }}-builder-tauri2
|
||||
- name: Install ${{ matrix.package }} package in Docker
|
||||
run: |
|
||||
docker run --pull=always --rm \
|
||||
-e COREPACK_INTEGRITY_KEYS=0 \
|
||||
-e GPGUI_INSTALLED=0 \
|
||||
-v $(pwd)/build-gp-${{ matrix.package }}:/${{ matrix.package }} \
|
||||
yuezk/gpdev:${{ matrix.package }}-builder-tauri2 \
|
||||
@ -205,12 +207,16 @@ jobs:
|
||||
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
||||
- name: Build gpgui in Docker
|
||||
run: |
|
||||
docker run --pull=always --rm -v $(pwd)/gpgui-source:/gpgui yuezk/gpdev:gpgui-builder-tauri2
|
||||
docker run --pull=always --rm \
|
||||
-e COREPACK_INTEGRITY_KEYS=0 \
|
||||
-v $(pwd)/gpgui-source:/gpgui yuezk/gpdev:gpgui-builder-tauri2
|
||||
- name: Install gpgui in Docker
|
||||
run: |
|
||||
cd gpgui-source
|
||||
tar -xJf *.bin.tar.xz
|
||||
docker run --pull=always --rm -v $(pwd):/gpgui yuezk/gpdev:gpgui-builder-tauri2 \
|
||||
docker run --pull=always --rm \
|
||||
-e COREPACK_INTEGRITY_KEYS=0 \
|
||||
-v $(pwd):/gpgui yuezk/gpdev:gpgui-builder-tauri2 \
|
||||
bash -c "cd /gpgui/gpgui_*/ && ./gpgui --version"
|
||||
- name: Upload gpgui
|
||||
uses: actions/upload-artifact@v4
|
||||
|
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@ -112,12 +112,14 @@ jobs:
|
||||
run: |
|
||||
docker run --pull=always --rm \
|
||||
-v $(pwd)/build-${{ matrix.package }}:/${{ matrix.package }} \
|
||||
-e COREPACK_INTEGRITY_KEYS=0 \
|
||||
-e INCLUDE_GUI=1 \
|
||||
yuezk/gpdev:${{ matrix.package }}-builder-tauri2
|
||||
|
||||
- name: Install ${{ matrix.package }} package in Docker
|
||||
run: |
|
||||
docker run --pull=always --rm \
|
||||
-e COREPACK_INTEGRITY_KEYS=0 \
|
||||
-v $(pwd)/build-${{ matrix.package }}:/${{ matrix.package }} \
|
||||
yuezk/gpdev:${{ matrix.package }}-builder-tauri2 \
|
||||
bash install.sh
|
||||
|
453
Cargo.lock
generated
453
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ members = [
|
||||
|
||||
[workspace.package]
|
||||
rust-version = "1.80"
|
||||
version = "2.4.3"
|
||||
version = "2.4.4"
|
||||
authors = ["Kevin Yue <k3vinyue@gmail.com>"]
|
||||
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
||||
edition = "2021"
|
||||
|
193
apps/gpgui-helper/dist/assets/main-CQPVXkdn.js
vendored
193
apps/gpgui-helper/dist/assets/main-CQPVXkdn.js
vendored
File diff suppressed because one or more lines are too long
228
apps/gpgui-helper/dist/assets/main-sEPcTvJX.js
vendored
Normal file
228
apps/gpgui-helper/dist/assets/main-sEPcTvJX.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
apps/gpgui-helper/dist/index.html
vendored
2
apps/gpgui-helper/dist/index.html
vendored
@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>GlobalProtect</title>
|
||||
<script type="module" crossorigin src="/assets/main-CQPVXkdn.js"></script>
|
||||
<script type="module" crossorigin src="/assets/main-sEPcTvJX.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/main-B3YRsHQ2.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -11,27 +11,27 @@
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.0",
|
||||
"@mui/icons-material": "^6.3.0",
|
||||
"@mui/material": "^6.3.0",
|
||||
"@tauri-apps/api": "^2.1.1",
|
||||
"@mui/icons-material": "^6.4.3",
|
||||
"@mui/material": "^6.4.3",
|
||||
"@tauri-apps/api": "^2.2.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^2.1.0",
|
||||
"@types/node": "^22.10.2",
|
||||
"@types/react": "^19.0.2",
|
||||
"@types/react-dom": "^19.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
||||
"@typescript-eslint/parser": "^8.18.2",
|
||||
"@tauri-apps/cli": "^2.2.7",
|
||||
"@types/node": "^22.13.1",
|
||||
"@types/react": "^19.0.8",
|
||||
"@types/react-dom": "^19.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^8.23.0",
|
||||
"@typescript-eslint/parser": "^8.23.0",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint": "^9.20.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-react": "^7.37.3",
|
||||
"eslint-plugin-react": "^7.37.4",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"prettier": "3.4.2",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.0.5"
|
||||
"typescript": "^5.7.3",
|
||||
"vite": "^6.1.0"
|
||||
},
|
||||
"packageManager": "pnpm@9.15.1"
|
||||
}
|
||||
|
1412
apps/gpgui-helper/pnpm-lock.yaml
generated
1412
apps/gpgui-helper/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 2.4.4 - 2025-02-09
|
||||
|
||||
- GUI: fix multiple tray icons issue (fix [#464](https://github.com/yuezk/GlobalProtect-openconnect/issues/464))
|
||||
- CLI: check the cli running state before running the `gpclient` command (fix [#447](https://github.com/yuezk/GlobalProtect-openconnect/issues/447))
|
||||
|
||||
## 2.4.3 - 2025-01-21
|
||||
|
||||
- Do not use static default value for `--os-version` option.
|
||||
|
@ -39,6 +39,9 @@ clap-verbosity-flag = { workspace = true, optional = true }
|
||||
env_logger = { workspace = true, optional = true }
|
||||
log-reload = { version = "0.1", optional = true }
|
||||
|
||||
[target.'cfg(not(any(target_os="macos", target_os="windows")))'.dependencies]
|
||||
gtk = "0.18"
|
||||
|
||||
[features]
|
||||
tauri = ["dep:tauri"]
|
||||
clap = ["dep:clap", "dep:clap-verbosity-flag"]
|
||||
|
@ -41,12 +41,6 @@ pub fn patch_gui_runtime_env(hidpi: bool) {
|
||||
// This is to avoid blank screen on some systems
|
||||
std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1");
|
||||
|
||||
// Workaround for https://github.com/tauri-apps/tao/issues/929
|
||||
let is_wayland = std::env::var("XDG_SESSION_TYPE").unwrap_or_default() == "wayland";
|
||||
if is_wayland {
|
||||
env::set_var("GDK_BACKEND", "x11");
|
||||
}
|
||||
|
||||
if hidpi {
|
||||
info!("Setting GDK_SCALE=2 and GDK_DPI_SCALE=0.5");
|
||||
std::env::set_var("GDK_SCALE", "2");
|
||||
|
@ -1,73 +1,97 @@
|
||||
use std::{process::ExitStatus, time::Duration};
|
||||
|
||||
use anyhow::bail;
|
||||
use log::info;
|
||||
use tauri::WebviewWindow;
|
||||
use tokio::process::Command;
|
||||
|
||||
pub trait WindowExt {
|
||||
fn raise(&self) -> anyhow::Result<()>;
|
||||
}
|
||||
|
||||
impl WindowExt for WebviewWindow {
|
||||
#[cfg(any(target_os = "macos", target_os = "windows"))]
|
||||
fn raise(&self) -> anyhow::Result<()> {
|
||||
raise_window(self)
|
||||
self.show()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
|
||||
fn raise(&self) -> anyhow::Result<()> {
|
||||
unix::raise_window(self)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn raise_window(win: &WebviewWindow) -> anyhow::Result<()> {
|
||||
let is_wayland = std::env::var("XDG_SESSION_TYPE").unwrap_or_default() == "wayland";
|
||||
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
|
||||
mod unix {
|
||||
use std::{process::ExitStatus, time::Duration};
|
||||
|
||||
if is_wayland {
|
||||
win.hide()?;
|
||||
win.show()?;
|
||||
} else {
|
||||
if !win.is_visible()? {
|
||||
win.show()?;
|
||||
}
|
||||
let title = win.title()?;
|
||||
tokio::spawn(async move {
|
||||
if let Err(err) = wmctrl_raise_window(&title).await {
|
||||
info!("Window not raised: {}", err);
|
||||
use anyhow::bail;
|
||||
use gtk::{
|
||||
glib::Cast,
|
||||
traits::{EventBoxExt, GtkWindowExt, WidgetExt},
|
||||
EventBox,
|
||||
};
|
||||
use log::info;
|
||||
use tauri::WebviewWindow;
|
||||
use tokio::process::Command;
|
||||
|
||||
pub fn raise_window(win: &WebviewWindow) -> anyhow::Result<()> {
|
||||
let is_wayland = std::env::var("XDG_SESSION_TYPE").unwrap_or_default() == "wayland";
|
||||
|
||||
if is_wayland {
|
||||
let gtk_win = win.gtk_window()?;
|
||||
if let Some(header) = gtk_win.titlebar() {
|
||||
let _ = header.downcast::<EventBox>().map(|event_box| {
|
||||
event_box.set_above_child(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Calling window.show() on Windows will cause the menu to be shown.
|
||||
// We need to hide it again.
|
||||
win.hide_menu()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn wmctrl_raise_window(title: &str) -> anyhow::Result<()> {
|
||||
let mut counter = 0;
|
||||
|
||||
loop {
|
||||
if let Ok(exit_status) = wmctrl_try_raise_window(title).await {
|
||||
if exit_status.success() {
|
||||
info!("Window raised after {} attempts", counter + 1);
|
||||
return Ok(());
|
||||
gtk_win.hide();
|
||||
gtk_win.show_all();
|
||||
} else {
|
||||
if !win.is_visible()? {
|
||||
win.show()?;
|
||||
}
|
||||
let title = win.title()?;
|
||||
tokio::spawn(async move {
|
||||
if let Err(err) = wmctrl_raise_window(&title).await {
|
||||
info!("Window not raised: {}", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if counter >= 10 {
|
||||
bail!("Failed to raise window: {}", title)
|
||||
}
|
||||
// Calling window.show() on window object will cause the menu to be shown.
|
||||
// We need to hide it again.
|
||||
win.hide_menu()?;
|
||||
|
||||
counter += 1;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn wmctrl_raise_window(title: &str) -> anyhow::Result<()> {
|
||||
let mut counter = 0;
|
||||
|
||||
loop {
|
||||
if let Ok(exit_status) = wmctrl_try_raise_window(title).await {
|
||||
if exit_status.success() {
|
||||
info!("Window raised after {} attempts", counter + 1);
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
if counter >= 10 {
|
||||
bail!("Failed to raise window: {}", title)
|
||||
}
|
||||
|
||||
counter += 1;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
}
|
||||
}
|
||||
|
||||
async fn wmctrl_try_raise_window(title: &str) -> anyhow::Result<ExitStatus> {
|
||||
let exit_status = Command::new("wmctrl")
|
||||
.arg("-F")
|
||||
.arg("-a")
|
||||
.arg(title)
|
||||
.spawn()?
|
||||
.wait()
|
||||
.await?;
|
||||
|
||||
Ok(exit_status)
|
||||
}
|
||||
}
|
||||
|
||||
async fn wmctrl_try_raise_window(title: &str) -> anyhow::Result<ExitStatus> {
|
||||
let exit_status = Command::new("wmctrl")
|
||||
.arg("-F")
|
||||
.arg("-a")
|
||||
.arg(title)
|
||||
.spawn()?
|
||||
.wait()
|
||||
.await?;
|
||||
|
||||
Ok(exit_status)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user