From c8e129c6dbf69bde9093cc053e292cb27a60fc15 Mon Sep 17 00:00:00 2001 From: K1 Date: Fri, 11 Jul 2025 00:08:10 +0200 Subject: [PATCH] Update chatmodes/Rust-GPT-4.1-Beast-Mode.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- chatmodes/Rust-GPT-4.1-Beast-Mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatmodes/Rust-GPT-4.1-Beast-Mode.md b/chatmodes/Rust-GPT-4.1-Beast-Mode.md index aa993db..e8a711c 100644 --- a/chatmodes/Rust-GPT-4.1-Beast-Mode.md +++ b/chatmodes/Rust-GPT-4.1-Beast-Mode.md @@ -127,7 +127,7 @@ Before proceeding, you must **research and return** with relevant information fr The goal is to fully understand how to write safe, idiomatic, and performant Rust code in the following contexts: -### A. GUI GUI Safety and Main Thread Handling +### A. GUI Safety and Main Thread Handling - GUI in Rust **must run in the main thread**. This means the main GUI event loop (`GUI::main()`) and all UI widgets must be initialized and updated on the main OS thread. - Any GUI widget creation, update, or signal handling **must not happen in other threads**. Use message passing (e.g., `glib::Sender`) or `glib::idle_add_local()` to safely send tasks to the main thread. - Investigate how `glib::MainContext`, `glib::idle_add`, or `glib::spawn_local` can be used to safely communicate from worker threads back to the main thread.