From d3b066218fd59b526a4b4e43e6b89a098d03fa44 Mon Sep 17 00:00:00 2001
From: Etienne Roesch <etienne.roesch@gmail.com>
Date: Mon, 31 Mar 2025 11:47:45 +0100
Subject: [PATCH] FIX: Silences error due to metallib on resizing of window

---
 MSG Desktop/ContentView.swift |  6 +++++-
 MSG Desktop/MSG_Desktop.metal | 11 +++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 MSG Desktop/MSG_Desktop.metal

diff --git a/MSG Desktop/ContentView.swift b/MSG Desktop/ContentView.swift
index 1d0b216..e367b39 100644
--- a/MSG Desktop/ContentView.swift	
+++ b/MSG Desktop/ContentView.swift	
@@ -121,7 +121,11 @@ struct ContentView: View {
             }
             .padding()
             .frame(maxHeight: .infinity)
-            // Removed fixed frame here to allow dynamic window sizing
+            .onAppear {
+                // Silences error due to metallib on resizing of window
+                let device = MTLCreateSystemDefaultDevice()
+                _ = device?.makeDefaultLibrary()
+            }
         }
     }
 
diff --git a/MSG Desktop/MSG_Desktop.metal b/MSG Desktop/MSG_Desktop.metal
new file mode 100644
index 0000000..1635f22
--- /dev/null
+++ b/MSG Desktop/MSG_Desktop.metal	
@@ -0,0 +1,11 @@
+//
+//  MGS_Desktop.metal
+//  MSG Desktop
+//
+//  Created by Etienne Roesch on 31/03/2025.
+//
+
+#include <metal_stdlib>
+using namespace metal;
+
+