mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1230397 - Write safe mode pref on the main thread r=dbaron
This commit is contained in:
parent
24de0091b3
commit
7981998cc7
@ -937,8 +937,13 @@ nsAppShell::CheckPowerKey()
|
||||
// If Power is pressed while we startup, mark safe mode.
|
||||
// Consumers of the b2g.safe_mode preference need to listen on this
|
||||
// preference change to prevent startup races.
|
||||
Preferences::SetCString("b2g.safe_mode",
|
||||
(powerState == AKEY_STATE_DOWN) ? "yes" : "no");
|
||||
nsCOMPtr<nsIRunnable> prefSetter =
|
||||
NS_NewRunnableFunction([powerState] () -> void {
|
||||
Preferences::SetCString("b2g.safe_mode",
|
||||
(powerState == AKEY_STATE_DOWN) ? "yes" : "no");
|
||||
});
|
||||
NS_DispatchToMainThread(prefSetter.forget());
|
||||
|
||||
mPowerKeyChecked = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user