Repository: alacritty/alacritty (language: rust)

Issue:
Not picking up decorations_theme_variant on startup on macOS
Alacritty is not picking up `decorations_theme_variant = "Dark"` on startup on macOS.
I have to do `touch ~/.config/alacritty/alacritty.toml` to get Dark appearance to take effect.

Startup:
<img width="842" alt="Screenshot 2024-06-16 at 1 14 44 PM" src="https://github.com/alacritty/alacritty/assets/118104/f6c0f3a4-78c0-4e51-8de9-e245a7aa0854">

After `touch ~/.config/alacritty/alacritty.toml`:
<img width="842" alt="Screenshot 2024-06-16 at 1 14 54 PM" src="https://github.com/alacritty/alacritty/assets/118104/f31ee6ab-6ca2-43fc-9bc7-4fd9b8ef5e2e">

### System

OS: macOS Sonoma 14.5 (23F79)
Version: alacritty 0.14.0-dev (0d4ab7bc)


Discussion / hints:
@madsmtm Are you aware of any issues like this? We're using `with_theme`, seems like that might have issues?

@sfsam If you're comfortable changing a couple lines of code, I'd be curious if this diff fixes it:

```diff
diff --git a/alacritty/src/display/window.rs b/alacritty/src/display/window.rs
index 09793fa0..341d0faa 100644
--- a/alacritty/src/display/window.rs
+++ b/alacritty/src/display/window.rs
@@ -173,6 +173,7 @@ impl Window {
             .with_fullscreen(config.window.fullscreen());
 
         let window = event_loop.create_window(window_attributes)?;
+        window.set_theme(config.window.theme());
 
         // Text cursor.
         let current_mouse_cursor = CursorIcon::Text;
```
It's winit issue because it never sets the theme during the window creation with macOS API, it just gets it and stores, but never sets actually.
That's probably why I wasn't able to notice it, because I use the system's theme and not light theme with just dark for alacritty.
@chrisduerr Yes, your patch seems to fix it.

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 34cf72bccfc..92fe281f3b7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2499,9 +2499,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
 
 [[package]]
 name = "winit"
-version = "0.30.2"
+version = "0.30.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1dc930d6cfbf53c4fe0b95689cdc2e17b8658c3f4214b9953298ccb5a1a15c90"
+checksum = "49f45a7b7e2de6af35448d7718dab6d95acec466eb3bb7a56f4d31d1af754004"
 dependencies = [
  "ahash",
  "android-activity",
diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml
index 1abf49123d3..a2fd0433814 100644
--- a/alacritty/Cargo.toml
+++ b/alacritty/Cargo.toml
@@ -39,7 +39,7 @@ serde_json = "1"
 serde_yaml = "0.9.25"
 toml = "0.8.2"
 unicode-width = "0.1"
-winit = { version = "0.30.2", default-features = false, features = ["rwh_06", "serde"] }
+winit = { version = "0.30.3", default-features = false, features = ["rwh_06", "serde"] }
 
 [build-dependencies]
 gl_generator = "0.14.0"


Test patch: