Bug 1764544 Comment 27 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I tried this:
```diff
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -780,16 +780,20 @@ nsIXULRuntime::ContentWin32kLockdownStat
   return nsIXULRuntime::ContentWin32kLockdownState::OperatingSystemNotSupported;

 #endif
 }

 namespace mozilla {

 void EnsureWin32kInitialized() {
+  if (!NS_IsMainThread()) {
+    return;
+  }
+
   if (gWin32kInitialized) {
     return;
   }
   gWin32kInitialized = true;

 #ifdef XP_WIN

   // Initialize the Win32k experiment, configuring win32k's
```
and tests are ok.
But I've no idea if any other processes created before `EnsureWin32kInitialized` is called could need the values initialized here.
I tried this:
```diff
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -780,16 +780,20 @@ nsIXULRuntime::ContentWin32kLockdownStat
   return nsIXULRuntime::ContentWin32kLockdownState::OperatingSystemNotSupported;

 #endif
 }

 namespace mozilla {

 void EnsureWin32kInitialized() {
+  if (!NS_IsMainThread()) {
+    return;
+  }
+
   if (gWin32kInitialized) {
     return;
   }
   gWin32kInitialized = true;

 #ifdef XP_WIN

   // Initialize the Win32k experiment, configuring win32k's
```
and tests are still broken (I forgot to move the `EnsureWin32kInitialized` before to run the tests, it's why I edited this comment).

Back to Bug 1764544 Comment 27