Merge pull request #8036 from dotCooCoo/feat/display-profile-read-again

Color: Edit › Refresh Monitor Profile reads the display's profile again
This commit is contained in:
BFlat
2026-11-18 13:13:37 +07:00
committed by GitHub
39 changed files with 282 additions and 14 deletions
+88 -10
View File
@@ -10,7 +10,7 @@
//! - macOS: the window's layer is tagged sRGB and macOS converts it (`mac_color_space`).
//!
//! While the preference is on, a background thread reads the display every [`EVERY`] seconds,
//! and at once when the window moves to another display.
//! and at once when the window moves to another display or Edit › Refresh Monitor Profile asks.
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
@@ -31,6 +31,8 @@ pub(crate) struct Reader {
looked: Option<f64>,
/// A reading is running.
busy: Arc<AtomicBool>,
/// [`DisplayProfile::attach_reader`] was called.
attached: bool,
}
/// Clears [`Reader::busy`] when the reading thread ends, also by a panic.
@@ -45,22 +47,22 @@ impl Drop for Done {
impl Reader {
/// Starts a reading when one is due and none is running. `now` is the frame's time in seconds.
pub(crate) fn tick(&mut self, window: &winit::window::Window, now: f64, enabled: bool, profile: &DisplayProfile, ctx: &egui::Context) {
if !enabled || self.busy.load(Ordering::Acquire) || self.looked.is_some_and(|at| (at..at + LOOK_EVERY).contains(&now)) {
return;
if !self.attached {
profile.attach_reader();
self.attached = true;
}
self.looked = Some(now);
let display = window.current_monitor().and_then(|m| m.name());
if !due(self.last.as_ref(), now, display.as_deref()) {
let Some(display) = self.start(now, enabled, profile, || window.current_monitor().and_then(|m| m.name())) else {
return;
}
self.last = Some((now, display.clone()));
};
profile.pending();
self.busy.store(true, Ordering::Release);
let done = Done(self.busy.clone());
let (profile, ctx) = (profile.clone(), ctx.clone());
let spawned = std::thread::Builder::new().name("display profile".into()).spawn(move || {
let _done = done;
if profile.report(read(display)) {
let changed = profile.report(read(display));
drop(done);
// A request made while this reading ran starts on the next frame.
if changed || profile.read_requested() {
ctx.request_repaint();
}
});
@@ -68,6 +70,32 @@ impl Reader {
log::warn!("couldn't start reading the display profile: {e}");
}
}
/// The display to read at `now` when a reading is to start, looked up with `display`. A
/// request from Refresh Monitor Profile ([`DisplayProfile::request_read`]) starts one at once,
/// past [`EVERY`] and [`LOOK_EVERY`]; while a reading runs it waits, and a frame that finds the
/// preference off drops it. A request made with the preference on is kept when the preference
/// goes off and on again between two frames.
fn start(&mut self, now: f64, enabled: bool, profile: &DisplayProfile, display: impl FnOnce() -> Option<String>) -> Option<Option<String>> {
if !enabled {
profile.take_request();
return None;
}
if self.busy.load(Ordering::Acquire) {
return None;
}
let asked = profile.take_request();
if !asked && self.looked.is_some_and(|at| (at..at + LOOK_EVERY).contains(&now)) {
return None;
}
self.looked = Some(now);
let display = display();
if !asked && !due(self.last.as_ref(), now, display.as_deref()) {
return None;
}
self.last = Some((now, display.clone()));
Some(display)
}
}
/// Whether a reading of `display` is due at `now`, after the last one (`last`): none yet, another
@@ -570,6 +598,56 @@ mod tests {
assert!(due(Some(&last), 50.0, Some("DP-1")));
}
fn attached() -> DisplayProfile {
let profile = DisplayProfile::default();
profile.attach_reader();
profile
}
#[test]
fn a_requested_reading_starts_on_the_next_frame_past_both_intervals() {
let (mut r, profile) = (Reader::default(), attached());
let dp1 = || Some("DP-1".to_string());
assert_eq!(r.start(100.0, true, &profile, dp1), Some(Some("DP-1".into())));
// Inside the display lookup interval and the reading interval: nothing starts.
assert_eq!(r.start(100.5, true, &profile, || panic!("not looked up")), None);
assert_eq!(r.start(102.0, true, &profile, dp1), None);
profile.request_read(true).unwrap();
assert_eq!(r.start(102.1, true, &profile, dp1), Some(Some("DP-1".into())));
assert!(!profile.read_requested(), "the request is taken");
// The intervals run again from the requested reading.
assert_eq!(r.start(102.2, true, &profile, dp1), None);
assert_eq!(r.start(111.0, true, &profile, dp1), None);
assert_eq!(r.start(113.0, true, &profile, dp1), Some(Some("DP-1".into())));
}
#[test]
fn a_request_made_while_a_reading_runs_waits_for_it_to_end() {
let (mut r, profile) = (Reader::default(), attached());
let dp1 = || Some("DP-1".to_string());
assert!(r.start(0.0, true, &profile, dp1).is_some());
r.busy.store(true, Ordering::Release);
profile.request_read(true).unwrap();
assert_eq!(r.start(0.1, true, &profile, dp1), None);
assert_eq!(r.start(5.0, true, &profile, dp1), None);
assert!(profile.read_requested(), "kept while the reading runs");
r.busy.store(false, Ordering::Release);
assert_eq!(r.start(5.1, true, &profile, dp1), Some(Some("DP-1".into())));
assert!(!profile.read_requested());
}
#[test]
fn a_request_is_dropped_when_the_preference_goes_off() {
let (mut r, profile) = (Reader::default(), attached());
let dp1 = || Some("DP-1".to_string());
assert!(r.start(0.0, true, &profile, dp1).is_some());
profile.request_read(true).unwrap();
assert_eq!(r.start(0.1, false, &profile, dp1), None);
assert!(!profile.read_requested());
assert_eq!(r.start(0.2, true, &profile, dp1), None, "no reading starts later for it");
assert!(profile.request_read(false).is_err());
}
#[test]
fn wayland_sessions_are_told_apart_from_x11_by_the_environment() {
let env = |pairs: &'static [(&'static str, &'static str)]| {
+6
View File
@@ -166,6 +166,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
("app.home", "Home", "", "{} shows the Home screen (new file presets, Open) over the open documents; choosing a document tab returns to it"),
("edit.preferences", "Preferences…", "Cmd+K", "{category?} open Preferences (engine: prefs.get / prefs.set / prefs.list)"),
("edit.keyboardShortcuts", "Keyboard Shortcuts…", "Cmd+Alt+Shift+K", "{}"),
(
"view.refreshMonitorProfile",
"Refresh Monitor Profile",
"",
"{} read the display's profile for Use Monitor Profile for Canvas (monitorProfileDisplay) again on the next frame, without waiting for the 10-second reading or the 1-second display check; while a reading runs, the request waits for it to end → {requested: true}, before the profile is read (ui.inspect › displayProfile reports the reading, and readRequested while it waits); an error while the preference is off, and where nothing reads the display's profile (the web build)",
),
(
"edit.autoSpellCheck",
"Auto Spell Check",
+62 -2
View File
@@ -78,6 +78,10 @@ struct State {
transform: Option<Arc<DisplayTransform>>,
/// The bytes last reported, so a reading of the same profile builds nothing.
reported: Option<(Option<String>, Vec<u8>)>,
/// The desktop app reads the display's profile ([`DisplayProfile::attach_reader`]).
reader: bool,
/// Refresh Monitor Profile asked for a reading that hasn't started yet.
requested: bool,
}
impl Default for State {
@@ -90,6 +94,8 @@ impl Default for State {
reason: Some("this build doesn't read display profiles".into()),
transform: None,
reported: None,
reader: false,
requested: false,
}
}
}
@@ -116,6 +122,42 @@ impl DisplayProfile {
}
}
/// The desktop app reads the display's profile, so [`Self::request_read`] can ask it to.
pub fn attach_reader(&self) {
self.write().reader = true;
}
/// Whether something reads the display's profile ([`Self::attach_reader`]).
pub(crate) fn has_reader(&self) -> bool {
self.read().reader
}
/// Edit › Refresh Monitor Profile: asks the desktop app to read the display's profile again on
/// its next frame, without waiting for its intervals; while a reading runs, the request waits
/// for it to end. Refused while `enabled` (the preference) is off, and when nothing reads the
/// profile. Nothing is queued when it is refused.
pub fn request_read(&self, enabled: bool) -> Result<(), String> {
if !enabled {
return Err("turn on Use Monitor Profile for Canvas first".into());
}
let mut s = self.write();
if !s.reader {
return Err("this build doesn't read display profiles".into());
}
s.requested = true;
Ok(())
}
/// Whether [`Self::request_read`] asked for a reading that hasn't started.
pub fn read_requested(&self) -> bool {
self.read().requested
}
/// Takes the request [`Self::request_read`] made: whether there was one.
pub fn take_request(&self) -> bool {
self.read_requested() && std::mem::take(&mut self.write().requested)
}
/// Takes `reading` in. A profile is checked, and its conversion built, on the calling thread;
/// a profile that can't be used leaves the canvas sRGB, with the reason in [`Self::status`].
/// The same profile reported again for the same display changes nothing. Returns whether the
@@ -170,8 +212,9 @@ impl DisplayProfile {
/// The status `ui.inspect` reports as `displayProfile`: the display, what was found
/// (`profile`, `srgbProfile`, `system`, `none`, `pending` or `unsupported`), the profile's
/// description and where it was read from, whether the canvas is converted, why not, and
/// whether the system converts the window.
/// description and where it was read from, whether the canvas is converted, why not, whether
/// the system converts the window, and whether a reading [`Self::request_read`] asked for
/// hasn't started.
pub fn status(&self, enabled: bool) -> Value {
let s = self.read();
json!({
@@ -183,6 +226,7 @@ impl DisplayProfile {
"applied": enabled && s.transform.is_some(),
"reason": s.reason,
"osManaged": s.kind == Kind::System,
"readRequested": s.requested,
})
}
@@ -535,6 +579,22 @@ pub(crate) mod tests {
assert!(d.key(true) > key);
}
#[test]
fn a_reading_is_requested_only_with_the_preference_on_and_a_reader() {
let d = DisplayProfile::default();
assert_eq!(d.request_read(true).unwrap_err(), "this build doesn't read display profiles");
d.attach_reader();
assert_eq!(d.request_read(false).unwrap_err(), "turn on Use Monitor Profile for Canvas first");
assert!(!d.read_requested() && !d.take_request(), "a refused request is not queued");
d.request_read(true).unwrap();
d.request_read(true).unwrap();
assert_eq!(d.status(true)["readRequested"].as_bool(), Some(true));
// Two requests before the reading starts make one reading.
assert!(d.take_request());
assert!(!d.take_request());
assert_eq!(d.status(true)["readRequested"].as_bool(), Some(false));
}
#[test]
fn a_profile_that_can_t_be_used_leaves_the_canvas_srgb_and_says_why() {
let d = DisplayProfile::default();
+1
View File
@@ -2798,6 +2798,7 @@ digits Malayalam Малаялам
Real World: Реален свят:
Real-time Drawing and Editing Чертане и редактиране в реално време
Use Monitor Profile for Canvas Използване на профила на монитора за платното
Refresh Monitor Profile Обновяване на профила на монитора
The canvas is drawn in sRGB. Платното се изобразява в sRGB.
Canvas display profile: Профил на дисплея за платното:
The system matches the window to the display's colors. Системата съгласува цветовете на прозореца с дисплея.
Can't render this file because it is too large.
+1
View File
@@ -4070,6 +4070,7 @@ theme Appearance Izgled
Printing / Exporting Štampanje / izvoz
Real-time Drawing and Editing Crtanje i uređivanje u stvarnom vremenu
Use Monitor Profile for Canvas Koristi profil monitora za platno
Refresh Monitor Profile Osvježi profil monitora
The canvas is drawn in sRGB. Platno se iscrtava u sRGB-u.
Canvas display profile: Profil ekrana za platno:
The system matches the window to the display's colors. Sistem prilagođava boje prozora ekranu.
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -3614,6 +3614,9 @@ digits Malayalam Malaiàlam
Real World: Món real:
Real-time Drawing and Editing Dibuix i edició en temps real
Use Monitor Profile for Canvas Utilitza el perfil del monitor per al llenç
Refresh Monitor Profile Actualitza el perfil del monitor
@msg turn on Use Monitor Profile for Canvas first activeu primer «Utilitza el perfil del monitor per al llenç»
@msg this build doesn't read display profiles aquesta versió no llegeix perfils de pantalla
The canvas is drawn in sRGB. El llenç es dibuixa en sRGB.
Canvas display profile: Perfil de pantalla del llenç:
The system matches the window to the display's colors. El sistema ajusta la finestra als colors de la pantalla.
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -4176,6 +4176,9 @@ theme Appearance Motiv
Printing / Exporting Tisk / export
Real-time Drawing and Editing Kreslení a úpravy v reálném čase
Use Monitor Profile for Canvas Použít profil monitoru pro plátno
Refresh Monitor Profile Obnovit profil monitoru
@msg turn on Use Monitor Profile for Canvas first nejprve zapněte „Použít profil monitoru pro plátno“
@msg this build doesn't read display profiles tato verze nečte profily displejů
The canvas is drawn in sRGB. Plátno se vykresluje v sRGB.
Canvas display profile: Profil displeje pro plátno:
The system matches the window to the display's colors. Systém přizpůsobuje okno barvám displeje.
Can't render this file because it is too large.
+3
View File
@@ -6610,6 +6610,9 @@ theme Appearance Udseende
Printing / Exporting Udskrivning / eksport
Real-time Drawing and Editing Tegning og redigering i realtid
Use Monitor Profile for Canvas Brug skærmprofil til canvas
Refresh Monitor Profile Opdatér skærmprofil
@msg turn on Use Monitor Profile for Canvas first slå først „Brug skærmprofil til canvas“ til
@msg this build doesn't read display profiles denne version læser ikke skærmprofiler
The canvas is drawn in sRGB. Canvasset tegnes i sRGB.
Canvas display profile: Canvassets skærmprofil:
The system matches the window to the display's colors. Systemet tilpasser vinduet til skærmens farver.
Can't render this file because it is too large.
+3
View File
@@ -2859,6 +2859,9 @@ digits Malayalam Malayalam
Real World: Reale Welt:
Real-time Drawing and Editing Zeichnen und Bearbeiten in Echtzeit
Use Monitor Profile for Canvas Monitorprofil für Arbeitsfläche verwenden
Refresh Monitor Profile Monitorprofil aktualisieren
@msg turn on Use Monitor Profile for Canvas first aktivieren Sie zuerst „Monitorprofil für Arbeitsfläche verwenden“
@msg this build doesn't read display profiles diese Version liest keine Bildschirmprofile
The canvas is drawn in sRGB. Die Arbeitsfläche wird in sRGB dargestellt.
Canvas display profile: Bildschirmprofil der Arbeitsfläche:
The system matches the window to the display's colors. Das System passt das Fenster an die Farben des Bildschirms an.
Can't render this file because it is too large.
+3
View File
@@ -3762,6 +3762,9 @@ digits Malayalam Μαλαγιάλαμ
Real World: Πραγματικός κόσμος:
Real-time Drawing and Editing Σχεδίαση και επεξεργασία σε πραγματικό χρόνο
Use Monitor Profile for Canvas Χρήση προφίλ οθόνης για τον καμβά
Refresh Monitor Profile Ανανέωση προφίλ οθόνης
@msg turn on Use Monitor Profile for Canvas first ενεργοποιήστε πρώτα τη «Χρήση προφίλ οθόνης για τον καμβά»
@msg this build doesn't read display profiles αυτή η έκδοση δεν διαβάζει προφίλ οθονών
The canvas is drawn in sRGB. Ο καμβάς σχεδιάζεται σε sRGB.
Canvas display profile: Προφίλ οθόνης καμβά:
The system matches the window to the display's colors. Το σύστημα προσαρμόζει το παράθυρο στα χρώματα της οθόνης.
Can't render this file because it is too large.
+3
View File
@@ -2896,6 +2896,9 @@ digits Malayalam Malayálam
Real World: Mundo real:
Real-time Drawing and Editing Dibujo y edición en tiempo real
Use Monitor Profile for Canvas Usar perfil del monitor para el lienzo
Refresh Monitor Profile Actualizar perfil del monitor
@msg turn on Use Monitor Profile for Canvas first activa primero «Usar perfil del monitor para el lienzo»
@msg this build doesn't read display profiles esta versión no lee perfiles de pantalla
The canvas is drawn in sRGB. El lienzo se dibuja en sRGB.
Canvas display profile: Perfil de pantalla del lienzo:
The system matches the window to the display's colors. El sistema ajusta la ventana a los colores de la pantalla.
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -4098,6 +4098,9 @@ theme Appearance Ulkoasu
Printing / Exporting Tulostus / vienti
Real-time Drawing and Editing Reaaliaikainen piirto ja muokkaus
Use Monitor Profile for Canvas Käytä näytön profiilia kankaalle
Refresh Monitor Profile Päivitä näytön profiili
@msg turn on Use Monitor Profile for Canvas first ota ensin käyttöön ”Käytä näytön profiilia kankaalle”
@msg this build doesn't read display profiles tämä versio ei lue näyttöjen profiileja
The canvas is drawn in sRGB. Kangas piirretään sRGB-tilassa.
Canvas display profile: Kankaan näyttöprofiili:
The system matches the window to the display's colors. Järjestelmä sovittaa ikkunan näytön väreihin.
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -2884,6 +2884,9 @@ digits Malayalam Malayalam
Real World: Monde réel :
Real-time Drawing and Editing Dessin et édition en temps réel
Use Monitor Profile for Canvas Utiliser le profil du moniteur pour la zone de travail
Refresh Monitor Profile Actualiser le profil du moniteur
@msg turn on Use Monitor Profile for Canvas first activez d’abord « Utiliser le profil du moniteur pour la zone de travail »
@msg this build doesn't read display profiles cette version ne lit pas les profils d’affichage
The canvas is drawn in sRGB. La zone de travail est affichée en sRGB.
Canvas display profile: Profil d’affichage de la zone de travail :
The system matches the window to the display's colors. Le système adapte la fenêtre aux couleurs de l’écran.
Can't render this file because it is too large.
+1
View File
@@ -4712,6 +4712,7 @@ antiAlias Sharp શાર્પ
Include Placed Images પ્લેસ કરેલી ઇમેજો સામેલ કરો
Include Fill Hatches ફિલ હેચિસ સામેલ કરો
Use Monitor Profile for Canvas કેનવાસ માટે મોનિટર પ્રોફાઇલ વાપરો
Refresh Monitor Profile મોનિટર પ્રોફાઇલ તાજી કરો
The canvas is drawn in sRGB. કેનવાસ sRGBમાં દોરાય છે.
Canvas display profile: કેનવાસ ડિસ્પ્લે પ્રોફાઇલ:
The system matches the window to the display's colors. સિસ્ટમ વિન્ડોના રંગો ડિસ્પ્લેના રંગો સાથે મેળવે છે.
Can't render this file because it contains an unexpected character in line 72 and column 5.
+3
View File
@@ -3954,6 +3954,9 @@ antiAlias Sharp शार्प
Real World: रियल वर्ल्ड:
Real-time Drawing and Editing रियल टाइम ड्राइंग और संपादन
Use Monitor Profile for Canvas कैनवास के लिए मॉनिटर प्रोफ़ाइल का उपयोग करें
Refresh Monitor Profile मॉनिटर प्रोफ़ाइल रिफ्रेश करें
@msg turn on Use Monitor Profile for Canvas first पहले "कैनवास के लिए मॉनिटर प्रोफ़ाइल का उपयोग करें" चालू करें
@msg this build doesn't read display profiles यह बिल्ड डिस्प्ले प्रोफ़ाइल नहीं पढ़ता
The canvas is drawn in sRGB. कैनवास sRGB में बनाया जाता है।
Canvas display profile: कैनवास की डिस्प्ले प्रोफ़ाइल:
The system matches the window to the display's colors. सिस्टम विंडो को डिस्प्ले के रंगों से मिलाता है।
Can't render this file because it is too large.
+3
View File
@@ -3466,6 +3466,9 @@ mark-style Japanese Japán
Real World: Valós méret:
Real-time Drawing and Editing Valós idejű rajzolás és szerkesztés
Use Monitor Profile for Canvas Monitorprofil használata a vászonhoz
Refresh Monitor Profile Monitorprofil frissítése
@msg turn on Use Monitor Profile for Canvas first előbb kapcsolja be a „Monitorprofil használata a vászonhoz” beállítást
@msg this build doesn't read display profiles ez a változat nem olvassa be a kijelzőprofilokat
The canvas is drawn in sRGB. A vászon sRGB-ben jelenik meg.
Canvas display profile: A vászon kijelzőprofilja:
The system matches the window to the display's colors. A rendszer a kijelző színeihez igazítja az ablakot.
Can't render this file because it is too large.
+1
View File
@@ -3829,6 +3829,7 @@ theme Appearance Tampilan
Printing / Exporting Pencetakan / Ekspor
Real-time Drawing and Editing Penggambaran dan pengeditan waktu nyata
Use Monitor Profile for Canvas Gunakan profil monitor untuk kanvas
Refresh Monitor Profile Segarkan profil monitor
The canvas is drawn in sRGB. Kanvas digambar dalam sRGB.
Canvas display profile: Profil layar kanvas:
The system matches the window to the display's colors. Sistem menyesuaikan jendela dengan warna layar.
Can't render this file because it contains an unexpected character in line 2537 and column 5.
+3
View File
@@ -2943,6 +2943,9 @@ digits Malayalam Malayalam
Real World: Mondo reale:
Real-time Drawing and Editing Disegno e modifica in tempo reale
Use Monitor Profile for Canvas Usa il profilo del monitor per l'area di disegno
Refresh Monitor Profile Aggiorna profilo del monitor
@msg turn on Use Monitor Profile for Canvas first attiva prima «Usa il profilo del monitor per l'area di disegno»
@msg this build doesn't read display profiles questa versione non legge i profili dei display
The canvas is drawn in sRGB. L'area di disegno è visualizzata in sRGB.
Canvas display profile: Profilo del display per l'area di disegno:
The system matches the window to the display's colors. Il sistema adatta la finestra ai colori del display.
Can't render this file because it is too large.
+3
View File
@@ -2976,6 +2976,9 @@ mark-style Japanese 日本式
Real World: 実寸:
Real-time Drawing and Editing リアルタイム描画および編集
Use Monitor Profile for Canvas キャンバスにモニタープロファイルを使用
Refresh Monitor Profile モニタープロファイルを更新
@msg turn on Use Monitor Profile for Canvas first 先に「キャンバスにモニタープロファイルを使用」をオンにしてください
@msg this build doesn't read display profiles このビルドはディスプレイプロファイルを読み込みません
The canvas is drawn in sRGB. キャンバスは sRGB で描画されます。
Canvas display profile: キャンバスのディスプレイプロファイル:
The system matches the window to the display's colors. システムがウィンドウをディスプレイのカラーに合わせます。
Can't render this file because it is too large.
+3
View File
@@ -5923,6 +5923,9 @@ theme Appearance იერსახე
Printing / Exporting ბეჭდვა / ექსპორტირება
Real-time Drawing and Editing რეალურ დროში ხატვა და რედაქტირება
Use Monitor Profile for Canvas მონიტორის პროფილის გამოყენება ტილოსთვის
Refresh Monitor Profile მონიტორის პროფილის განახლება
@msg turn on Use Monitor Profile for Canvas first ჯერ ჩართეთ „მონიტორის პროფილის გამოყენება ტილოსთვის“
@msg this build doesn't read display profiles ეს ვერსია ეკრანის პროფილებს არ კითხულობს
The canvas is drawn in sRGB. ტილო sRGB-ში იხატება.
Canvas display profile: ტილოს ეკრანის პროფილი:
The system matches the window to the display's colors. სისტემა ფანჯარას ეკრანის ფერებს უსადაგებს.
Can't render this file because it is too large.
+3
View File
@@ -2966,6 +2966,9 @@ mark-style Japanese 일본식
Real World: 실제 크기:
Real-time Drawing and Editing 실시간 그리기 및 편집
Use Monitor Profile for Canvas 캔버스에 모니터 프로필 사용
Refresh Monitor Profile 모니터 프로필 새로 고침
@msg turn on Use Monitor Profile for Canvas first 먼저 "캔버스에 모니터 프로필 사용"을 켜세요
@msg this build doesn't read display profiles 이 빌드는 디스플레이 프로필을 읽지 않습니다
The canvas is drawn in sRGB. 캔버스는 sRGB로 그려집니다.
Canvas display profile: 캔버스 디스플레이 프로필:
The system matches the window to the display's colors. 시스템이 창을 디스플레이 색상에 맞춥니다.
Can't render this file because it is too large.
+3
View File
@@ -4484,6 +4484,9 @@ theme Appearance Vormgeving
Printing / Exporting Afdrukken / exporteren
Real-time Drawing and Editing Tekenen en bewerken in realtime
Use Monitor Profile for Canvas Monitorprofiel gebruiken voor canvas
Refresh Monitor Profile Monitorprofiel vernieuwen
@msg turn on Use Monitor Profile for Canvas first schakel eerst 'Monitorprofiel gebruiken voor canvas' in
@msg this build doesn't read display profiles deze versie leest geen beeldschermprofielen
The canvas is drawn in sRGB. Het canvas wordt in sRGB getekend.
Canvas display profile: Weergaveprofiel van het canvas:
The system matches the window to the display's colors. Het systeem stemt het venster af op de kleuren van het scherm.
Can't render this file because it is too large.
+3
View File
@@ -4041,6 +4041,9 @@ theme Appearance Wygląd
Printing / Exporting Drukowanie / eksportowanie
Real-time Drawing and Editing Rysowanie i edycja w czasie rzeczywistym
Use Monitor Profile for Canvas Użyj profilu monitora dla płótna
Refresh Monitor Profile Odśwież profil monitora
@msg turn on Use Monitor Profile for Canvas first najpierw włącz „Użyj profilu monitora dla płótna”
@msg this build doesn't read display profiles ta wersja nie odczytuje profili wyświetlaczy
The canvas is drawn in sRGB. Płótno jest rysowane w sRGB.
Canvas display profile: Profil wyświetlacza płótna:
The system matches the window to the display's colors. System dopasowuje okno do kolorów wyświetlacza.
Can't render this file because it is too large.
+3
View File
@@ -2407,6 +2407,9 @@ digits Malayalam Malaiala
Real World: Mundo Real:
Real-time Drawing and Editing Desenho e Edição em Tempo Real
Use Monitor Profile for Canvas Usar Perfil do Monitor para a Tela
Refresh Monitor Profile Atualizar Perfil do Monitor
@msg turn on Use Monitor Profile for Canvas first ative primeiro "Usar Perfil do Monitor para a Tela"
@msg this build doesn't read display profiles esta versão não lê perfis de monitor
The canvas is drawn in sRGB. A tela é desenhada em sRGB.
Canvas display profile: Perfil do monitor para a tela:
The system matches the window to the display's colors. O sistema ajusta a janela às cores do monitor.
Can't render this file because it is too large.
+3
View File
@@ -2925,6 +2925,9 @@ digits Malayalam Малаялам
Real World: Реальный мир:
Real-time Drawing and Editing Рисование и редактирование в реальном времени
Use Monitor Profile for Canvas Использовать профиль монитора для холста
Refresh Monitor Profile Обновить профиль монитора
@msg turn on Use Monitor Profile for Canvas first сначала включите «Использовать профиль монитора для холста»
@msg this build doesn't read display profiles эта сборка не читает профили дисплеев
The canvas is drawn in sRGB. Холст отображается в sRGB.
Canvas display profile: Профиль дисплея для холста:
The system matches the window to the display's colors. Система согласует цвета окна с дисплеем.
Can't render this file because it is too large.
+3
View File
@@ -2821,6 +2821,9 @@ digits Malayalam Malayalam
Real World: Verkligt mått:
Real-time Drawing and Editing Ritning och redigering i realtid
Use Monitor Profile for Canvas Använd skärmprofil för arbetsytan
Refresh Monitor Profile Uppdatera skärmprofil
@msg turn on Use Monitor Profile for Canvas first slå först på ”Använd skärmprofil för arbetsytan”
@msg this build doesn't read display profiles den här versionen läser inte skärmprofiler
The canvas is drawn in sRGB. Arbetsytan ritas i sRGB.
Canvas display profile: Arbetsytans skärmprofil:
The system matches the window to the display's colors. Systemet anpassar fönstret till skärmens färger.
Can't render this file because it is too large.
+1
View File
@@ -634,6 +634,7 @@ fn monitor_profile_labels_are_in_complete_catalogs() {
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
for label in [
"Use Monitor Profile for Canvas",
"Refresh Monitor Profile",
"The canvas is drawn in sRGB.",
"Canvas display profile:",
"The system matches the window to the display's colors.",
+3
View File
@@ -2667,6 +2667,9 @@ digits Malayalam Malayalam
Real World: Gerçek Dünya:
Real-time Drawing and Editing Gerçek Zamanlı Çizim ve Düzenleme
Use Monitor Profile for Canvas Tuval için Monitör Profilini Kullan
Refresh Monitor Profile Monitör Profilini Yenile
@msg turn on Use Monitor Profile for Canvas first önce "Tuval için Monitör Profilini Kullan" seçeneğini açın
@msg this build doesn't read display profiles bu sürüm ekran profillerini okumaz
The canvas is drawn in sRGB. Tuval sRGB olarak çizilir.
Canvas display profile: Tuvalin ekran profili:
The system matches the window to the display's colors. Sistem pencereyi ekranın renklerine uyarlar.
Can't render this file because it is too large.
+3
View File
@@ -2935,6 +2935,9 @@ digits Malayalam Малаялам
Real World: Реальний світ:
Real-time Drawing and Editing Малювання та редагування у реальному часі
Use Monitor Profile for Canvas Використовувати профіль монітора для полотна
Refresh Monitor Profile Оновити профіль монітора
@msg turn on Use Monitor Profile for Canvas first спочатку увімкніть «Використовувати профіль монітора для полотна»
@msg this build doesn't read display profiles ця збірка не читає профілі дисплеїв
The canvas is drawn in sRGB. Полотно відображається в sRGB.
Canvas display profile: Профіль дисплея для полотна:
The system matches the window to the display's colors. Система узгоджує кольори вікна з дисплеєм.
Can't render this file because it is too large.
+3
View File
@@ -3260,6 +3260,9 @@ mark-style Japanese Kiểu Nhật
Real World: Thực tế:
Real-time Drawing and Editing Vẽ và chỉnh sửa theo thời gian thực
Use Monitor Profile for Canvas Dùng hồ sơ màn hình cho vùng vẽ
Refresh Monitor Profile Làm mới hồ sơ màn hình
@msg turn on Use Monitor Profile for Canvas first hãy bật "Dùng hồ sơ màn hình cho vùng vẽ" trước
@msg this build doesn't read display profiles bản dựng này không đọc hồ sơ màn hình
The canvas is drawn in sRGB. Vùng vẽ được hiển thị ở sRGB.
Canvas display profile: Hồ sơ màn hình của vùng vẽ:
The system matches the window to the display's colors. Hệ thống điều chỉnh cửa sổ theo màu của màn hình.
Can't render this file because it is too large.
+3
View File
@@ -2795,6 +2795,9 @@ digits Malayalam 马拉雅拉姆数字
Real World: 真实世界:
Real-time Drawing and Editing 实时绘图和编辑
Use Monitor Profile for Canvas 画布使用显示器配置文件
Refresh Monitor Profile 刷新显示器配置文件
@msg turn on Use Monitor Profile for Canvas first 请先打开“画布使用显示器配置文件”
@msg this build doesn't read display profiles 此版本不读取显示器配置文件
The canvas is drawn in sRGB. 画布以 sRGB 绘制。
Canvas display profile: 画布显示配置文件:
The system matches the window to the display's colors. 系统会使窗口匹配显示器的颜色。
Can't render this file because it is too large.
+3
View File
@@ -4137,6 +4137,9 @@ digits Malayalam 馬來亞拉姆數字
Real World: 真實世界:
Real-time Drawing and Editing 即時繪圖與編輯
Use Monitor Profile for Canvas 畫布使用顯示器描述檔
Refresh Monitor Profile 重新整理顯示器描述檔
@msg turn on Use Monitor Profile for Canvas first 請先開啟「畫布使用顯示器描述檔」
@msg this build doesn't read display profiles 此版本不讀取顯示器描述檔
The canvas is drawn in sRGB. 畫布以 sRGB 繪製。
Canvas display profile: 畫布顯示描述檔:
The system matches the window to the display's colors. 系統會讓視窗符合顯示器的色彩。
Can't render this file because it is too large.
+7
View File
@@ -261,6 +261,13 @@ fn run_ui_part2(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result<
app.session.execute(id, p).map_err(|e| e.to_string())
})
}
// Edit › Refresh Monitor Profile: the desktop app's next frame reads the display's profile.
"view.refreshMonitorProfile" => app.display_profile.request_read(app.session.prefs.monitor_profile_display).map(|()| {
if let Some(ctx) = &app.ui_ctx {
ctx.request_repaint();
}
json!({ "requested": true })
}),
// Outline or Preview is a setting of the active document's view.
"view.outline" => match app.view_mut() {
Some(v) => flag(&mut v.outline),
+1
View File
@@ -324,6 +324,7 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool {
"file.exportSelection" => app.session.active().is_some_and(|d| !d.selection.is_empty()),
"css.copy" | "css.exportFile" => app.session.active().is_some(),
"print.printerSetup" => app.services.print.as_ref().is_some_and(|s| s.has_setup()),
"view.refreshMonitorProfile" => app.session.prefs.monitor_profile_display && app.display_profile.has_reader(),
"plugin.dialog" => app.session.active().is_some(),
"ui.perspectiveGridDialog" | "ui.savePerspectivePreset" => app.session.active().is_some(),
id if id.starts_with(crate::dialogs::perspective_presets::SLOT) => {
+24
View File
@@ -605,6 +605,30 @@ fn color_settings_and_assign_profile_show_the_separations_panel() {
}
}
/// Edit › Refresh Monitor Profile, after Assign Profile…, asks the desktop app's next frame to read
/// the display's profile; it is off and refused with the preference off or nothing to read it.
#[test]
fn refresh_monitor_profile_asks_for_a_reading_of_the_display_profile() {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
let entries = menu_entries(&app);
let at = |label: &str| entries.iter().position(|e| e.label == label && e.path == ["Edit"]);
assert_eq!(at("Refresh Monitor Profile"), at("Assign Profile…").map(|i| i + 1));
let e = &entries[at("Refresh Monitor Profile").unwrap()];
assert_eq!((e.command.as_deref(), e.shortcut.as_str()), (Some("view.refreshMonitorProfile"), ""));
// Nothing reads the display's profile (the web build, tests).
assert!(!enabled(&app, "view.refreshMonitorProfile"));
assert_eq!(app.run("view.refreshMonitorProfile", json!({})).unwrap_err(), "this build doesn't read display profiles");
app.display_profile.attach_reader();
assert!(enabled(&app, "view.refreshMonitorProfile"));
assert_eq!(app.run("view.refreshMonitorProfile", json!({})).unwrap(), json!({"requested": true}));
assert!(app.display_profile.take_request());
// With the preference off nothing is asked for.
app.session.prefs.monitor_profile_display = false;
assert!(!enabled(&app, "view.refreshMonitorProfile"));
assert_eq!(app.run("view.refreshMonitorProfile", json!({})).unwrap_err(), "turn on Use Monitor Profile for Canvas first");
assert!(!app.display_profile.read_requested());
}
#[test]
fn saved_views_store_and_restore_the_view() {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
+1
View File
@@ -141,6 +141,7 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec<Item>)> {
Sep,
c("Color Settings…", "edit.colorSettings"),
c("Assign Profile…", "edit.assignProfile"),
c("Refresh Monitor Profile", "view.refreshMonitorProfile"),
Sep,
c("Keyboard Shortcuts…", "edit.keyboardShortcuts"),
c("Preferences…", "edit.preferences"),
+6
View File
@@ -167,6 +167,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
("app.home", "Home", "", "{} shows the Home screen (new file presets, Open) over the open documents; choosing a document tab returns to it"),
("edit.preferences", "Preferences…", "Cmd+K", "{category?} open Preferences (engine: prefs.get / prefs.set / prefs.list)"),
("edit.keyboardShortcuts", "Keyboard Shortcuts…", "Cmd+Alt+Shift+K", "{}"),
(
"view.refreshMonitorProfile",
"Refresh Monitor Profile",
"",
"{} read the display's profile for Use Monitor Profile for Canvas (monitorProfileDisplay) again on the next frame, without waiting for the 10-second reading or the 1-second display check; while a reading runs, the request waits for it to end → {requested: true}, before the profile is read (ui.inspect › displayProfile reports the reading, and readRequested while it waits); an error while the preference is off, and where nothing reads the display's profile (the web build)",
),
(
"edit.autoSpellCheck",
"Auto Spell Check",
+9 -2
View File
@@ -7366,13 +7366,20 @@ output's `_ICC_PROFILE` property when colord has no usable profile, then the scr
Color on (HDR or Automatic Color Management) and macOS windows are converted by the system, and nothing is converted
again. In a Wayland session, and where no profile is set or the profile is not an RGB display profile of at most 1 MiB,
the canvas stays sRGB. The app reads the display again every 10 seconds and when the window moves to another display.
Edit › Refresh Monitor Profile (`view.refreshMonitorProfile`, `{}`; a desktop UI command) reads it again on the next
frame without waiting for either interval, for example after a new profile is installed for the display; a request
made while a reading runs starts when that reading ends. It returns `{requested: true}` before the profile is read,
and is an error while `monitorProfileDisplay` is off (nothing is queued) and where nothing reads the display's profile
(the web build). It changes no document, proof setting or preference and records no undo step; reading the same
profile again leaves the canvas as it is.
Exports, `ui.render`, the document, panels and thumbnails are not converted; with Proof Colors on, the proof is drawn
first and then converted. Translucent art and the antialiased edges of art over an artboard's paper or the
transparency grid are blended with it in sRGB, and the blend is converted; over the pasteboard and in Outline the art
is converted on its own.
`ui.inspect` returns `displayProfile`: `{enabled, display, source, profile, from, applied, reason,
osManaged}`, where `source` is `profile`, `srgbProfile` (a profile that shows sRGB unchanged), `system`, `none`,
`pending` or `unsupported`, `applied` says whether the canvas is converted, and `reason` says why not.
osManaged, readRequested}`, where `source` is `profile`, `srgbProfile` (a profile that shows sRGB unchanged), `system`, `none`,
`pending` or `unsupported`, `applied` says whether the canvas is converted, `reason` says why not, and `readRequested`
says whether a reading Refresh Monitor Profile asked for has not started yet.
`lowLatencyDrawing` (Preferences › Performance › Low-Latency Drawing, off by default; desktop app) is read when the app
starts. On, the window presents without vsync (wgpu's `AutoNoVsync`) and frames start at most 240 times a second.
+1
View File
@@ -828,6 +828,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Document Setup › Color:** a Color tab shows the document color mode (RGB Color or CMYK Color), a Convert to CMYK or Convert to RGB box for a mode change (cleared: the colors keep their numbers), and the RGB and CMYK profiles assigned to the document, with a working-space entry for none. OK runs `edit.assignProfile` and then `file.documentColorMode` with the dialog's other changes in one `command.batch`, and the document's changes are one undo step. An unchanged Color tab adds no color commands, and Cancel, or OK with nothing changed, records no undo step. A Color tab field with a value of the wrong kind is an error, and the dialog stays open. The tab is VectorCraft's own layout; File › Document Color Mode and Edit › Assign Profile… stay as they are. Tests in `dialogs/document_setup.rs`.
- **Assign Profile's three choices:** the Assign rows of Edit › Assign Profile… (the Separations panel's Color Settings section) offer Don't Color Manage This Document, the working space of the document's color mode (Working RGB or Working CMYK, with its name) and Profile with the other profiles of that kind, as [Assign or remove a color profile](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=150) lists them. They act on the profile of the document's color mode: an RGB document's RGB profile, a CMYK document's CMYK profile; the other model's profile stays as it is (VectorCraft's own rule; Document Setup › Color sets both). Picking the working space assigns its profile, which stays when the working space changes later. A choice the document already has runs nothing. Tests in `panels/separations.rs`.
- **Canvas through the display's profile on Windows and X11:** Preferences › Performance › Use Monitor Profile for Canvas (on by default) converts the canvas's art, artboard paper and transparency grid from sRGB into the ICC profile of the display that shows most of the main window, after any proof, as the help page describes the monitor's profile translating the document's colors for the monitor ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=151)). Windows gives the display's default profile, and a display with Advanced Color on is left to Windows ([Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/wcs/advanced-color-icc-profiles)); X11 gives colord's profile for the output or the `_ICC_PROFILE` property. macOS converts the window itself, and a Wayland session stays sRGB. `ui.inspect` reports `displayProfile`. Tests in `color/src/cms/display.rs`, `ui-egui/src/display_profile.rs` and `canvas::tests::the_canvas_is_drawn_through_the_display_profile_while_the_preference_is_on`.
- **Refresh Monitor Profile:** Edit › Refresh Monitor Profile (`view.refreshMonitorProfile`), VectorCraft's own command, reads the display's profile again on the next frame instead of waiting up to 10 seconds, so a profile installed or changed while the app runs is used without a restart; a request made while a reading runs starts when it ends, and the command is off while Use Monitor Profile for Canvas is off. `ui.inspect`'s `displayProfile.readRequested` reports a request that hasn't started. Tests `display_profile::tests::a_requested_reading_starts_on_the_next_frame_past_both_intervals`, `a_request_made_while_a_reading_runs_waits_for_it_to_end`, `a_request_is_dropped_when_the_preference_goes_off` (desktop app) and `menus::tests::refresh_monitor_profile_asks_for_a_reading_of_the_display_profile`.
- **Translucent art blended before the display profile:** with Use Monitor Profile for Canvas converting, translucent art and the anti-aliased edges of art over an artboard's paper, a colored artboard or the transparency grid are blended with it in sRGB and the blend is converted, so the monitor's profile translates the document's colors as they are composited ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=151)). The frame rendered whole, the part an edit renders again, the render worker's frame, the pan fill and the other windows' panes do the same; over the pasteboard and in Outline the art is converted on its own, and with no profile to convert into nothing changes. Tests `display_profile::tests::translucent_pixels_over_the_paper_are_blended_before_they_are_converted`, `the_transparency_grid_is_blended_cell_by_cell`, `the_backdrop_is_found_through_the_view` and `canvas::tests::translucent_art_over_the_paper_is_blended_before_the_display_profile`.
- **Out-of-gamut warning after a profile change:** the out-of-gamut warning and its closest-color correction in the Color panel and Color Picker ([the help page](https://helpx.adobe.com/illustrator/using/adjusting-colors.html)) check the color against the document's assigned CMYK profile, else the working CMYK space, and update when Edit › Assign Profile… or Edit › Color Settings… changes that space or a loaded profile changes, without a change of color. Which CMYK space the warning uses is VectorCraft's own rule. Tests: `gamut_warning_follows_a_profile_change` and `gamut_warning_follows_a_profile_loaded_again` in `dialogs/color_picker/tests.rs`.
- **Swatch Options and New Swatch color warnings:** both dialogs show the out-of-gamut triangle and the out-of-web-color cube under the color, each with its correction beside it, and a click on the icon or the correction shifts the color to the closest printable or web-safe color ([the archived user guide](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=236), Swatch options; [the help page](https://helpx.adobe.com/illustrator/using/adjusting-colors.html)). The icons in the Color panel and the Color Picker correct the color too. VectorCraft's own rules: the triangle shows in RGB, HSB and Lab and the cube in every mode but Web Safe RGB, both can show at once, a web correction of a Grayscale, Lab or CMYK color is edited in RGB, a gamut correction keeps the CMYK equivalent and is edited in CMYK, and a correction keeps the name, the color type and Global and changes the dialog's fields only, so OK records one undo step. Tests: `swatch_options_shows_and_corrects_both_warnings` and `swatch_warnings_follow_the_mode` in `dialogs/swatch_options.rs`, `a_warning_corrects_the_new_colour_only_until_ok` in `dialogs/new_swatch.rs`.