mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-10-05 20:48:58 +03:00
feat(core): set gtk app id (#9621)
* feat(core): set gtk app id ref: https://github.com/tauri-apps/tao/issues/910 * Update core/tauri-runtime-wry/Cargo.toml * Discard changes to Cargo.lock
This commit is contained in:
parent
faf282ca6c
commit
669b9c6b5a
7
.changes/linux-gtk-app-id.md
Normal file
7
.changes/linux-gtk-app-id.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
"tauri": "patch:enhance"
|
||||
"tauri-runtime-wry": "patch"
|
||||
---
|
||||
|
||||
Set the gtk application to the identifier defined in `tauri.conf.json` to ensure the app uniqueness.
|
||||
|
@ -2245,6 +2245,18 @@ impl<T: UserEvent> Wry<T> {
|
||||
use tao::platform::windows::EventLoopBuilderExtWindows;
|
||||
event_loop_builder.with_msg_hook(hook);
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "dragonfly",
|
||||
target_os = "freebsd",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd"
|
||||
))]
|
||||
if let Some(app_id) = args.app_id {
|
||||
use tao::platform::unix::EventLoopBuilderExtUnix;
|
||||
event_loop_builder.with_app_id(app_id);
|
||||
}
|
||||
Self::init(event_loop_builder.build())
|
||||
}
|
||||
|
||||
|
@ -339,6 +339,14 @@ pub trait EventLoopProxy<T: UserEvent>: Debug + Clone + Send + Sync {
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RuntimeInitArgs {
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "dragonfly",
|
||||
target_os = "freebsd",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd"
|
||||
))]
|
||||
pub app_id: Option<String>,
|
||||
#[cfg(windows)]
|
||||
pub msg_hook: Option<Box<dyn FnMut(*const std::ffi::c_void) -> bool + 'static>>,
|
||||
}
|
||||
|
@ -1633,6 +1633,15 @@ tauri::Builder::default()
|
||||
));
|
||||
|
||||
let runtime_args = RuntimeInitArgs {
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "dragonfly",
|
||||
target_os = "freebsd",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd"
|
||||
))]
|
||||
app_id: Some(manager.config.identifier.clone()),
|
||||
|
||||
#[cfg(windows)]
|
||||
msg_hook: {
|
||||
let menus = manager.menu.menus.clone();
|
||||
|
Loading…
Reference in New Issue
Block a user