PhotoCraft: An open-source, photo editor written by scratch in pure Rust
Linux: display server preference (X11 / XWayland) so file drops work
Gert Pellina132e37ee17d
diff --git a/apps/photocraft/src/gpu_startup.rs b/apps/photocraft/src/gpu_startup.rsindex 03d8b11bc..5907ca7bd 100644--- a/apps/photocraft/src/gpu_startup.rs+++ b/apps/photocraft/src/gpu_startup.rs@@ -409,6 +409,16 @@ impl Sentinel {}/// Read the policy leniently at startup, including old settings without renderingMode.+/// The Linux display-server preference (`performance.linuxDisplayServer`) from the preferences+/// file, read before the window opens; `Auto` when the file or value is missing or unknown.+pub fn read_display_server(path: Option<&Path>) -> photocraft_engine::prefs::LinuxDisplayServer {+ let v: Value = path.and_then(|p| std::fs::read_to_string(p).ok()).and_then(|t| serde_json::from_str(&t).ok()).unwrap_or(Value::Null);+ v.get("performance")+ .and_then(|p| serde_json::from_value::<photocraft_engine::prefs::Performance>(p.clone()).ok())+ .map(|performance| performance.linux_display_server)+ .unwrap_or_default()+}+pub fn read_rendering_prefs(path: Option<&Path>) -> (GpuBackend, RenderingMode) {let v: Value = path.and_then(|p| std::fs::read_to_string(p).ok()).and_then(|t| serde_json::from_str(&t).ok()).unwrap_or(Value::Null);let perf = v.get("performance");@@ -428,6 +438,27 @@ mod tests {Marker { backend: backend.into(), adapter: "Intel(R) UHD Graphics".into(), adapter_backend: adapter_backend.into(), ..Default::default() }}+ #[test]+ fn display_server_preference_is_read_before_the_window_opens() {+ use photocraft_engine::prefs::LinuxDisplayServer;+ let dir = std::env::temp_dir().join(format!("photocraft-display-server-{}", std::process::id()));+ std::fs::create_dir_all(&dir).unwrap();+ let file = dir.join("preferences.json");+ let read = |json: &str| {+ std::fs::write(&file, json).unwrap();+ read_display_server(Some(&file))+ };+ assert_eq!(read(r#"{"performance":{"linuxDisplayServer":"x11"}}"#), LinuxDisplayServer::X11);+ assert_eq!(read(r#"{"performance":{"linuxDisplayServer":"auto","gpuBackend":"vulkan"}}"#), LinuxDisplayServer::Auto);+ // Unknown values, other types, broken JSON and a missing file all start as Auto.+ assert_eq!(read(r#"{"performance":{"linuxDisplayServer":"wayland"}}"#), LinuxDisplayServer::Auto);+ assert_eq!(read(r#"{"performance":{"linuxDisplayServer":11}}"#), LinuxDisplayServer::Auto);+ assert_eq!(read("{not json"), LinuxDisplayServer::Auto);+ assert_eq!(read_display_server(Some(&dir.join("missing.json"))), LinuxDisplayServer::Auto);+ assert_eq!(read_display_server(None), LinuxDisplayServer::Auto);+ let _ = std::fs::remove_dir_all(&dir);+ }+#[test]fn cpu_policy_ignores_hardware_backend_override() {let p = plan_with_mode(Vulkan, RenderingMode::Cpu, None, Some("vulkan"), false, Os::Windows);diff --git a/apps/photocraft/src/main.rs b/apps/photocraft/src/main.rsindex 934983a8f..c426910b7 100644--- a/apps/photocraft/src/main.rs+++ b/apps/photocraft/src/main.rs@@ -209,6 +209,20 @@ fn main() -> eframe::Result {// app no pen input (#639).#[cfg(target_os = "linux")]let session = tablet::display_session();+ // Preferences › Performance › Linux display server = X11: Xwayland on a Wayland session too,+ // where native file drops work (winit 0.30 has none on Wayland, #386). Only when Xwayland can+ // run the window ($DISPLAY set, X11 libraries installed); otherwise the session's own.+ #[cfg(target_os = "linux")]+ let session = if session == linux_libs::DisplaySession::Wayland+ && gpu_startup::read_display_server(services::prefs_file().as_deref()) == photocraft_engine::prefs::LinuxDisplayServer::X11+ && std::env::var_os("DISPLAY").is_some_and(|d| !d.is_empty())+ && linux_libs::available(linux_libs::DisplaySession::X11)+ {+ eprintln!("photocraft: opening the window through Xwayland (Preferences › Performance › Linux display server)");+ linux_libs::DisplaySession::X11+ } else {+ session+ };// winit and wgpu dlopen the windowing and GPU libraries, and some of those crates panic when// one is missing (issue #201). Name the package to install and exit instead.diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rsindex ab12a34d9..4b46e8acf 100644--- a/crates/engine/src/prefs.rs+++ b/crates/engine/src/prefs.rs@@ -71,6 +71,14 @@ choice!(/// CPU disables image acceleration; the native window may still need hardware graphics.RenderingMode { Auto = "auto", Gpu = "gpu", Cpu = "cpu" } default Auto);+choice!(+ /// Linux display server of the desktop app's window (applies at next launch). `x11` runs+ /// PhotoCraft through XWayland on a Wayland session, where native file drag and drop works+ /// (winit 0.30 has none on Wayland, issue #386); fractional scaling may then look softer.+ /// It needs an X server (`DISPLAY`); without one PhotoCraft starts as `auto`. Other+ /// platforms ignore it.+ LinuxDisplayServer { Auto = "auto", X11 = "x11" } default Auto+);choice!(UiFontSize { Tiny = "tiny", Small = "small", Medium = "medium", Large = "large" } default Small);choice!(LogDestination { Metadata = "metadata", TextFile = "textFile", Both = "both" } default Metadata);choice!(LogDetail { SessionsOnly = "sessionsOnly", Concise = "concise", Detailed = "detailed" } default Concise);@@ -412,6 +420,8 @@ pub struct Performance {/// sliders while they drag) render on a reduced copy: fast, but blocky when zoomed in. Off:/// they render at full resolution.pub low_resolution_previews: bool,+ /// Linux display server (applies at next launch; see [`LinuxDisplayServer`]).+ pub linux_display_server: LinuxDisplayServer,/// Memory budget of the layer-effect cache, in MB.pub effect_cache_mb: u32,pub legacy_compositing: bool,@@ -441,6 +451,7 @@ impl Default for Performance {rendering_mode: None,gpu_backend: GpuBackend::Auto,low_resolution_previews: true,+ linux_display_server: LinuxDisplayServer::Auto,effect_cache_mb: 768,legacy_compositing: false,}@@ -879,9 +890,13 @@ pub const HIDDEN_UNTIL_IMPLEMENTED: &[&str] = &[/// Is the preference at `path` (`"section.key"`) hidden from the Preferences dialog?pub fn is_hidden(path: &str) -> bool {- HIDDEN_UNTIL_IMPLEMENTED.contains(&path)+ HIDDEN_UNTIL_IMPLEMENTED.contains(&path) || (!cfg!(target_os = "linux") && LINUX_ONLY.contains(&path))}+/// Preferences that only do something on Linux; the dialog doesn't show them elsewhere. They+/// still load, save and round-trip on every platform.+pub const LINUX_ONLY: &[&str] = &["performance.linuxDisplayServer"];+/// Choices of an enumerated preference (dotted path, e.g. `"cursors.painting"`).pub fn choices(path: &str) -> Option<&'static [&'static str]> {Some(match path {@@ -913,6 +928,7 @@ pub fn choices(path: &str) -> Option<&'static [&'static str]> {"rawDefaults.bitDepth" => RawDepth::NAMES,"rawDefaults.sharpenFor" => RawSharpen::NAMES,"performance.gpuBackend" => GpuBackend::NAMES,+ "performance.linuxDisplayServer" => LinuxDisplayServer::NAMES,"performance.renderingMode" => RenderingMode::NAMES,_ => return None,})diff --git a/crates/engine/src/prefs/tests.rs b/crates/engine/src/prefs/tests.rsindex 99915b084..4cc86764f 100644--- a/crates/engine/src/prefs/tests.rs+++ b/crates/engine/src/prefs/tests.rs@@ -363,3 +363,10 @@ fn gpu_backend_round_trips_and_validates() {assert_eq!(GpuBackend::parse(n).map(GpuBackend::name), Some(*n));}}++#[test]+fn linux_only_preferences_show_only_on_linux() {+ assert_eq!(is_hidden("performance.linuxDisplayServer"), !cfg!(target_os = "linux"));+ assert!(!is_hidden("performance.gpuBackend"));+ assert!(LINUX_ONLY.iter().all(|p| choices(p).is_some()), "every Linux-only preference is a real one");+}diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsvindex 5b9feab5c..04c6673e3 100644--- a/crates/ui-egui/src/i18n/cs.tsv+++ b/crates/ui-egui/src/i18n/cs.tsv@@ -996,6 +996,7 @@Native file drag-and-drop is unavailable Nativní přetahování souborů ve Waylandu není dostupnéNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Nativní přetahování souborů ve Waylandu zatím není podporováno. Použijte Soubor › Otevřít, nebo obrázek zkopírujte ve správci souborů a vložte ho pomocí {paste}.To drop files, start PhotoCraft under XWayland: `{command}` Chcete-li soubory přetahovat, spusťte PhotoCraft v XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Nebo nastavte Předvolby › Výkon › Zobrazovací server Linuxu na X11: PhotoCraft se pak vždy spustí v XWayland.Edit › Paste Úpravy › VložitDuplicate Layers… Duplikovat vrstvy…Duplicate style Duplikovat styl@@ -2028,6 +2029,8 @@CPU (no GPU acceleration) CPU (bez akcelerace GPU)DirectX 12 DirectX 12GPU backend Grafický backend+ Linux display server Zobrazovací server Linuxu+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure Použít přítlak tabletudiff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsvindex 1d336fd21..ec053cdea 100644--- a/crates/ui-egui/src/i18n/de.tsv+++ b/crates/ui-egui/src/i18n/de.tsv@@ -980,6 +980,7 @@Native file drag-and-drop is unavailable Natives Ziehen und Ablegen von Dateien ist nicht verfügbarNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Natives Ziehen und Ablegen von Dateien wird unter Wayland noch nicht unterstützt. Nutze Datei › Öffnen oder kopiere das Bild im Dateimanager und füge es mit {paste} ein.To drop files, start PhotoCraft under XWayland: `{command}` Um Dateien abzulegen, starte PhotoCraft unter XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Oder stelle Voreinstellungen › Leistung › Linux-Anzeigeserver auf X11: PhotoCraft startet dann immer unter XWayland.Edit › Paste Bearbeiten › EinfügenDuplicate Layers… Ebenen duplizieren…Duplicate style Stil duplizieren@@ -2001,6 +2002,8 @@CPU (no GPU acceleration) CPU (keine GPU-Beschleunigung)DirectX 12 DirectX 12GPU backend GPU-Backend+ Linux display server Linux-Anzeigeserver+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure Tablettdruck verwendendiff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsvindex 38ee0c14d..3fdc5ea04 100644--- a/crates/ui-egui/src/i18n/el.tsv+++ b/crates/ui-egui/src/i18n/el.tsv@@ -1040,6 +1040,8 @@Keep Using CPU Συνέχεια με CPURetry GPU Νέα προσπάθεια χρήσης GPUGPU Backend Σύστημα GPU+ Linux display server Διακομιστής οθόνης Linux+ X11 X11Full-resolution preview unavailable Δεν είναι διαθέσιμη προεπισκόπηση πλήρους ανάλυσηςNo patterns Δεν υπάρχουν μοτίβαEnable {name} Ενεργοποίηση: {name}@@ -3332,6 +3334,7 @@ cameraRaw Yellow ΚίτρινοSeafoam ΘαλασσίSrgb sRGBTo drop files, start PhotoCraft under XWayland: `{command}` Για να αποθέσετε αρχεία, εκκινήστε το PhotoCraft μέσω XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Ή ορίστε Προτιμήσεις › Επιδόσεις › Διακομιστής οθόνης Linux σε X11: το PhotoCraft θα εκκινεί τότε πάντα μέσω XWayland.Vulkan VulkanWebP (lossless) WebP (χωρίς απώλειες)Webp WebPdiff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsvindex f9e7c1b07..54f435c87 100644--- a/crates/ui-egui/src/i18n/es.tsv+++ b/crates/ui-egui/src/i18n/es.tsv@@ -981,6 +981,7 @@Native file drag-and-drop is unavailable El arrastrar y soltar archivos de forma nativa no está disponible en WaylandNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. El arrastrar y soltar archivos de forma nativa aún no está disponible en Wayland. Usa Archivo › Abrir, o copia la imagen en tu gestor de archivos y pégala con {paste}.To drop files, start PhotoCraft under XWayland: `{command}` Para soltar archivos, inicia PhotoCraft bajo XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. O establece Preferencias › Rendimiento › Servidor de pantalla de Linux en X11: PhotoCraft se iniciará siempre bajo XWayland.Edit › Paste Edición › PegarDuplicate Layers… Duplicar capas…Duplicate style Duplicar estilo@@ -2013,6 +2014,8 @@CPU (no GPU acceleration) CPU (sin aceleración por GPU)DirectX 12 DirectX 12GPU backend Backend de GPU+ Linux display server Servidor de pantalla de Linux+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure Usar la presión de la tabletadiff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsvindex 8e683c025..7e2300e88 100644--- a/crates/ui-egui/src/i18n/fr.tsv+++ b/crates/ui-egui/src/i18n/fr.tsv@@ -1981,6 +1981,8 @@CPU (no GPU acceleration) CPU (sans accélération GPU)DirectX 12 DirectX 12GPU backend Moteur GPU+ Linux display server Serveur d'affichage Linux+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure Utiliser la pression de la tablette@@ -2471,6 +2473,7 @@Native file drag-and-drop is unavailable Le glisser-déposer natif de fichiers n'est pas disponibleNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Le glisser-déposer natif de fichiers n'est pas encore pris en charge sous Wayland. Utilisez Fichier › Ouvrir, ou copiez l'image dans votre gestionnaire de fichiers et collez-la avec {paste}.To drop files, start PhotoCraft under XWayland: `{command}` Pour déposer des fichiers, lancez PhotoCraft sous XWayland : `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Ou réglez Préférences › Performances › Serveur d'affichage Linux sur X11 : PhotoCraft démarre alors toujours sous XWayland.Edit › Paste Édition › CollerUse File › Open, or paste a copied image with {paste}. Utilisez Fichier › Ouvrir, ou collez une image copiée avec {paste}.Mixer Brush Tool Outil Pinceau mélangeurdiff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsvindex 101e24230..d0aa5b6ea 100644--- a/crates/ui-egui/src/i18n/id.tsv+++ b/crates/ui-egui/src/i18n/id.tsv@@ -1975,6 +1975,8 @@CPU (no GPU acceleration) CPU (tanpa akselerasi GPU)DirectX 12 DirectX 12GPU backend Backend GPU+ Linux display server Server tampilan Linux+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure Pakai tekanan tablet@@ -2460,6 +2462,7 @@Native file drag-and-drop is unavailable Seret dan lepas berkas native tidak tersediaNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Seret dan lepas berkas native belum didukung di Wayland. Gunakan Berkas › Buka, atau salin gambar di pengelola berkas lalu tempel dengan {paste}.To drop files, start PhotoCraft under XWayland: `{command}` Untuk menjatuhkan berkas, jalankan PhotoCraft di XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Atau atur Preferensi › Performa › Server tampilan Linux ke X11: PhotoCraft lalu selalu berjalan di XWayland.Edit › Paste Edit › TempelUse File › Open, or paste a copied image with {paste}. Gunakan Berkas › Buka, atau tempel gambar yang disalin dengan {paste}.Mixer Brush Tool Alat Kuas Pencampurdiff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsvindex d1da7e078..5138ef1a5 100644--- a/crates/ui-egui/src/i18n/it.tsv+++ b/crates/ui-egui/src/i18n/it.tsv@@ -980,6 +980,7 @@Native file drag-and-drop is unavailable Il drag-and-drop nativo file non è disponibile su WaylandNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Il drag-and-drop nativo non è ancora supportato su Wayland. Usa File › Apri, oppure copia l'immagine nel file manager e incollala con {paste}.To drop files, start PhotoCraft under XWayland: `{command}` Per trascinare file, avvia PhotoCraft sotto XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Oppure imposta Preferenze › Prestazioni › Server grafico Linux su X11: PhotoCraft partirà sempre sotto XWayland.Edit › Paste Modifica › IncollaDuplicate Layers… Duplica livelli…Duplicate style Duplica stile@@ -2011,6 +2012,8 @@CPU (no GPU acceleration) CPU (nessuna accelerazione GPU)DirectX 12 DirectX 12GPU backend Backend GPU+ Linux display server Server grafico Linux+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure Usa pressione tavolettadiff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsvindex 1e1bfda88..b4ed0ed5c 100644--- a/crates/ui-egui/src/i18n/ja.tsv+++ b/crates/ui-egui/src/i18n/ja.tsv@@ -986,6 +986,7 @@Native file drag-and-drop is unavailable Wayland ではネイティブのファイルドラッグ&ドロップを利用できませんNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Wayland ではネイティブのファイルドラッグ&ドロップはまだ利用できません。[ファイル › 開く] を使うか、ファイルマネージャーで画像をコピーして {paste} で貼り付けてください。To drop files, start PhotoCraft under XWayland: `{command}` ファイルをドロップするには、XWayland 上で PhotoCraft を起動してください: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. または 環境設定 › パフォーマンス › Linux ディスプレイサーバー を X11 にすると、PhotoCraft は常に XWayland 上で起動します。Edit › Paste [編集 › 貼り付け]Duplicate Layers… レイヤーを複製…Duplicate style スタイルを複製@@ -2019,6 +2020,8 @@CPU (no GPU acceleration) CPU(GPU アクセラレーションなし)DirectX 12 DirectX 12GPU backend GPU バックエンド+ Linux display server Linux ディスプレイサーバー+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure タブレットの筆圧を使用diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsvindex c61d03605..6fa17c456 100644--- a/crates/ui-egui/src/i18n/ko.tsv+++ b/crates/ui-egui/src/i18n/ko.tsv@@ -1975,6 +1975,8 @@CPU (no GPU acceleration) CPU(GPU 가속 없음)DirectX 12 DirectX 12GPU backend GPU 백엔드+ Linux display server Linux 디스플레이 서버+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure 태블릿 필압 사용@@ -2001,6 +2003,7 @@Native file drag-and-drop is unavailable 파일 드래그 앤 드롭을 사용할 수 없습니다Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Wayland에서는 아직 파일 드래그 앤 드롭을 지원하지 않습니다. 파일 › 열기를 사용하거나, 파일 관리자에서 이미지를 복사한 뒤 {paste}(으)로 붙여넣으세요.To drop files, start PhotoCraft under XWayland: `{command}` 파일을 끌어다 놓으려면 XWayland에서 PhotoCraft를 실행하세요: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. 또는 환경 설정 › 성능 › Linux 디스플레이 서버를 X11로 설정하면 PhotoCraft가 항상 XWayland에서 시작됩니다.Edit › Paste 편집 › 붙여넣기Use File › Open, or paste a copied image with {paste}. 파일 › 열기를 사용하거나, 복사한 이미지를 {paste}(으)로 붙여넣으세요.Invalid {mode} profile 유효하지 않은 {mode} 프로파일diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsvindex f12906d1f..be885dbe5 100644--- a/crates/ui-egui/src/i18n/pl.tsv+++ b/crates/ui-egui/src/i18n/pl.tsv@@ -2007,6 +2007,8 @@CPU (no GPU acceleration) CPU (bez akceleracji GPU)DirectX 12 DirectX 12GPU backend Backend GPU+ Linux display server Serwer wyświetlania Linuksa+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure Użyj nacisku tabletu@@ -3209,6 +3211,7 @@ cameraRaw Roughness Chropowatość{path}: the path is not valid Unicode; rename the file and open it again. {path}: ścieżka nie jest prawidłowym Unicode; zmień nazwę pliku i otwórz go ponownie.Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Natywne przeciąganie i upuszczanie plików nie jest jeszcze obsługiwane w Wayland. Użyj Plik › Otwórz albo skopiuj obraz w menedżerze plików i wklej go za pomocą {paste}.To drop files, start PhotoCraft under XWayland: `{command}` Aby upuszczać pliki, uruchom PhotoCraft pod XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Albo ustaw Preferencje › Wydajność › Serwer wyświetlania Linuksa na X11: PhotoCraft będzie wtedy zawsze uruchamiany pod XWayland.Edit › Paste Edycja › WklejUse File › Open, or paste a copied image with {paste}. Użyj Plik › Otwórz albo wklej skopiowany obraz za pomocą {paste}.diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsvindex 9dfb1cbcd..1a5fe80d0 100644--- a/crates/ui-egui/src/i18n/pt-br.tsv+++ b/crates/ui-egui/src/i18n/pt-br.tsv@@ -1980,6 +1980,8 @@CPU (no GPU acceleration) CPU (sem aceleração por GPU)DirectX 12 DirectX 12GPU backend Backend da GPU+ Linux display server Servidor de exibição Linux+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure Usar a pressão da mesa digitalizadora@@ -2467,6 +2469,7 @@Native file drag-and-drop is unavailable Arrastar e soltar arquivos não está disponívelNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. O recurso nativo de arrastar e soltar arquivos ainda não funciona no Wayland. Use Arquivo › Abrir ou copie a imagem no gerenciador de arquivos e cole-a com {paste}.To drop files, start PhotoCraft under XWayland: `{command}` Para soltar arquivos, execute o PhotoCraft no XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Ou defina Preferências › Desempenho › Servidor de exibição Linux como X11: o PhotoCraft passa a iniciar sempre no XWayland.Edit › Paste Editar › ColarUse File › Open, or paste a copied image with {paste}. Use Arquivo › Abrir ou cole uma imagem copiada com {paste}.Mixer Brush Tool Ferramenta Pincel misturadordiff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsvindex b91748719..f290472ab 100644--- a/crates/ui-egui/src/i18n/ru.tsv+++ b/crates/ui-egui/src/i18n/ru.tsv@@ -1395,6 +1395,7 @@Native file drag-and-drop is unavailable Нативное перетаскивание файлов в Wayland недоступноNative file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Нативное перетаскивание файлов в Wayland пока не поддерживается. Откройте файл через Файл › Открыть или скопируйте изображение в файловом менеджере и вставьте его с помощью {paste}.To drop files, start PhotoCraft under XWayland: `{command}` Чтобы перетаскивать файлы, запустите PhotoCraft в XWayland: `{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. Или выберите в Настройки › Производительность › Дисплейный сервер Linux значение X11: PhotoCraft будет всегда запускаться в XWayland.Edit › Paste Редактирование › ВставитьPhoto ФотоPrint Печать@@ -2179,6 +2180,8 @@Font preview Предпросмотр шрифтовFull size tip Весь диаметр кистиGPU backend Бэкенд GPU+ Linux display server Дисплейный сервер Linux+ X11 X11Gamut warning color Цвет предупреждения об охватеGamut warning opacity Непрозрачность предупреждения об охватеGeneral Основныеdiff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsvindex 6f3718676..948210702 100644--- a/crates/ui-egui/src/i18n/zh-hans.tsv+++ b/crates/ui-egui/src/i18n/zh-hans.tsv@@ -986,6 +986,7 @@Native file drag-and-drop is unavailable Wayland 上不支持原生文件拖放Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Wayland 尚不支持原生文件拖放。请使用“文件 › 打开”,或在文件管理器中复制图像后使用 {paste} 粘贴。To drop files, start PhotoCraft under XWayland: `{command}` 要拖放文件,请在 XWayland 下启动 PhotoCraft:`{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. 或将 首选项 › 性能 › Linux 显示服务器 设为 X11:PhotoCraft 将始终在 XWayland 下启动。Edit › Paste “编辑 › 粘贴”Duplicate Layers… 复制图层…Duplicate style 复制样式@@ -2069,6 +2070,8 @@ cameraRaw Blending 混合CPU (no GPU acceleration) CPU(无 GPU 加速)DirectX 12 DirectX 12GPU backend GPU 后端+ Linux display server Linux 显示服务器+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure 使用数位板压感diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsvindex edae3d5ff..bda89324a 100644--- a/crates/ui-egui/src/i18n/zh-hant.tsv+++ b/crates/ui-egui/src/i18n/zh-hant.tsv@@ -987,6 +987,7 @@Native file drag-and-drop is unavailable Wayland 不支援原生檔案拖放Native file drag-and-drop is not supported on Wayland yet. Use File › Open, or copy the image in your file manager and paste it with {paste}. Wayland 尚未支援原生檔案拖放。請使用「檔案 › 開啟」,或在檔案管理員中複製影像後使用 {paste} 貼上。To drop files, start PhotoCraft under XWayland: `{command}` 若要拖放檔案,請在 XWayland 下啟動 PhotoCraft:`{command}`+ Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland. 或將 偏好設定 › 效能 › Linux 顯示伺服器 設為 X11:PhotoCraft 之後一律在 XWayland 下啟動。Edit › Paste 「編輯 › 貼上」Duplicate Layers… 複製圖層…Duplicate style 複製樣式@@ -2010,6 +2011,8 @@CPU (no GPU acceleration) CPU (無 GPU 加速)DirectX 12 DirectX 12GPU backend GPU 後端+ Linux display server Linux 顯示伺服器+ X11 X11Metal MetalOpenGL OpenGLUse tablet pressure 使用繪圖板壓力diff --git a/crates/ui-egui/src/notices.rs b/crates/ui-egui/src/notices.rsindex b79512c03..75889979f 100644--- a/crates/ui-egui/src/notices.rs+++ b/crates/ui-egui/src/notices.rs@@ -79,6 +79,7 @@ pub fn wayland_file_drop_guidance(app: &mut PhotocraftApp) {if let Some(command) = &app.services.xwayland_command {lines.push("To drop files, start PhotoCraft under XWayland: `{command}`".to_owned());args.push(("command".to_owned(), command.clone()));+ lines.push("Or set Preferences › Performance › Linux display server to X11: PhotoCraft then always starts under XWayland.".to_owned());}let id = post(app, "Native file drag-and-drop is unavailable", lines, false, Some(WAYLAND_FILE_DROP_DISMISSED));if let Some(notice) = app.ui.notices.iter_mut().find(|notice| notice.id == id) {@@ -229,6 +230,7 @@ mod tests {assert!(guidance.contains(&format!("paste it with {paste}")), "{guidance}");// The relaunch command is the one for this install (an AppImage here), not a guess.assert!(guidance.contains("under XWayland: `WAYLAND_DISPLAY= '/apps/Photo Craft.AppImage'`"), "{guidance}");+ assert!(guidance.contains("Linux display server to X11"), "{guidance}");assert_eq!(app.ui.notices[0].dismiss_pref.as_deref(), Some(WAYLAND_FILE_DROP_DISMISSED));for i in 0..MAX_NOTICES {post(&mut app, format!("Transient {i}"), Vec::new(), false, None);