1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

eframe: Use NativeOptions::AppId for the persistance location (#3014)

* eframe: Use NativeOptions::AppId for the persistance location

* Fix doclinks

* Fix typo in docs

Closes https://github.com/emilk/egui/issues/3003
This commit is contained in:
Emil Ernerfeldt
2023-05-23 08:38:14 +02:00
committed by GitHub
parent 9d5b324787
commit 03bb89153b
5 changed files with 32 additions and 14 deletions

View File

@@ -3,9 +3,6 @@ use winit::event_loop::EventLoopWindowTarget;
#[cfg(target_os = "macos")]
use winit::platform::macos::WindowBuilderExtMacOS as _;
#[cfg(all(feature = "wayland", target_os = "linux"))]
use winit::platform::wayland::WindowBuilderExtWayland as _;
#[cfg(feature = "accesskit")]
use egui::accesskit;
use egui::NumExt as _;
@@ -123,6 +120,7 @@ pub fn window_builder<E>(
#[cfg(all(feature = "wayland", target_os = "linux"))]
if let Some(app_id) = &native_options.app_id {
use winit::platform::wayland::WindowBuilderExtWayland as _;
window_builder = window_builder.with_name(app_id, "");
}

View File

@@ -682,7 +682,12 @@ mod glow_integration {
}
fn init_run_state(&mut self, event_loop: &EventLoopWindowTarget<UserEvent>) -> Result<()> {
let storage = epi_integration::create_storage(&self.app_name);
let storage = epi_integration::create_storage(
self.native_options
.app_id
.as_ref()
.unwrap_or(&self.app_name),
);
let (gl_window, gl) = Self::create_glutin_windowed_context(
event_loop,
@@ -1350,7 +1355,12 @@ mod wgpu_integration {
self.set_window(window)?;
}
} else {
let storage = epi_integration::create_storage(&self.app_name);
let storage = epi_integration::create_storage(
self.native_options
.app_id
.as_ref()
.unwrap_or(&self.app_name),
);
let window = Self::create_window(
event_loop,
storage.as_deref(),