Repository: zng-ui/zng (language: rust)

Issue:
Wayland fallback title text size affected by window font size
#### Following these steps:

1 - Run the `hot-reload` example.

#### I saw this happen:

Large title.

#### I expected this to happen:

Same size title as other examples.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d66f31c5..4b1b897d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
 # Unreleased
 
+* Fix window text properties affecting the Wayland fallback chrome text.
 * Fix `swgl` build error.
 * Changed how relative lengths are computed in `offset`, `x` and `y`, now uses the maximum bounded length from constraint, the same as `size` properties.
 * Fix display print of `FactorPercent` not rounding.
diff --git a/crates/zng-wgt-window/src/fallback_chrome.rs b/crates/zng-wgt-window/src/fallback_chrome.rs
index e76e28de2..8270a1fa9 100644
--- a/crates/zng-wgt-window/src/fallback_chrome.rs
+++ b/crates/zng-wgt-window/src/fallback_chrome.rs
@@ -143,6 +143,8 @@ pub fn fallback_chrome() -> impl UiNode {
     let cursor = var(CursorSource::Hidden);
 
     Container! {
+        exclude_text_context = true;
+
         hit_test_mode = HitTestMode::Detailed;
 
         child = title;
@@ -166,3 +168,24 @@ pub fn fallback_chrome() -> impl UiNode {
         }
     }
 }
+
+#[property(WIDGET)]
+fn exclude_text_context(child: impl UiNode, exclude: impl IntoValue<bool>) -> impl UiNode {
+    assert!(exclude.into());
+
+    // exclude all text context vars set on the window
+    let excluded_set = {
+        let mut c = ContextValueSet::new();
+        Text::context_vars_set(&mut c);
+        c
+    };
+    let child = match_node(child, move |c, op| {
+        let mut filtered = LocalContext::capture_filtered(CaptureFilter::Exclude(excluded_set.clone()));
+        filtered.with_context(|| {
+            c.op(op);
+        });
+    });
+
+    // override layout font size
+    zng_wgt_text::font_size(child, 16)
+}


Test patch: