mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-10 05:01:31 +11:00
Mark startup_notify
unsafe functions as safe
They are safe, since they use the rust `std::env` stuff. Making them safe lets downstream to determine that `std::env` is used and not the `libc` env manipulation routines, which are unsafe.
This commit is contained in:
parent
a06ea45c0f
commit
d68d9eab38
|
@ -18,6 +18,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
||||||
- On Web, take all transient activations on the canvas and window into account to queue a fullscreen request.
|
- On Web, take all transient activations on the canvas and window into account to queue a fullscreen request.
|
||||||
- On Web, remove any fullscreen requests from the queue when an external fullscreen activation was detected.
|
- On Web, remove any fullscreen requests from the queue when an external fullscreen activation was detected.
|
||||||
- On Wayland, fix `TouchPhase::Canceled` being sent for moved events.
|
- On Wayland, fix `TouchPhase::Canceled` being sent for moved events.
|
||||||
|
- Mark `startup_notify` unsafe functions as safe.
|
||||||
|
|
||||||
# 0.29.1-beta
|
# 0.29.1-beta
|
||||||
|
|
||||||
|
|
|
@ -85,12 +85,7 @@ impl WindowBuilderExtStartupNotify for WindowBuilder {
|
||||||
///
|
///
|
||||||
/// This is wise to do before running child processes,
|
/// This is wise to do before running child processes,
|
||||||
/// which may not to support the activation token.
|
/// which may not to support the activation token.
|
||||||
///
|
pub fn reset_activation_token_env() {
|
||||||
/// # Safety
|
|
||||||
///
|
|
||||||
/// While the function is safe internally, it mutates the global environment
|
|
||||||
/// state for the process, hence unsafe.
|
|
||||||
pub unsafe fn reset_activation_token_env() {
|
|
||||||
env::remove_var(X11_VAR);
|
env::remove_var(X11_VAR);
|
||||||
env::remove_var(WAYLAND_VAR);
|
env::remove_var(WAYLAND_VAR);
|
||||||
}
|
}
|
||||||
|
@ -98,12 +93,7 @@ pub unsafe fn reset_activation_token_env() {
|
||||||
/// Set environment variables responsible for activation token.
|
/// Set environment variables responsible for activation token.
|
||||||
///
|
///
|
||||||
/// This could be used before running daemon processes.
|
/// This could be used before running daemon processes.
|
||||||
///
|
pub fn set_activation_token_env(token: ActivationToken) {
|
||||||
/// # Safety
|
|
||||||
///
|
|
||||||
/// While the function is safe internally, it mutates the global environment
|
|
||||||
/// state for the process, hence unsafe.
|
|
||||||
pub unsafe fn set_activation_token_env(token: ActivationToken) {
|
|
||||||
env::set_var(X11_VAR, &token._token);
|
env::set_var(X11_VAR, &token._token);
|
||||||
env::set_var(WAYLAND_VAR, token._token);
|
env::set_var(WAYLAND_VAR, token._token);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue