aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/util
diff options
context:
space:
mode:
authorQuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com>2026-10-31 14:33:08 +0100
committerGitHub <noreply@github.com>2026-10-31 14:33:08 +0100
commitd4e2dc88611252748b8dc3bb70baf56fc8bd2256 (patch)
tree88cf5a92002f58efee5de70df65fe40519a45b01 /src/yuzu/util
parent7b6f27b91e0ecaebcc4d66ee7dd3855bebce6c78 (diff)
Fix game list crash, unresponsive macOS menu, and missing SDL gamepad input (#100)
* game_list: fix crash when scanning games by removing nested event processing Assisted-by: DeepSeek V4 Pro (root cause diagnosis and fix) Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> * macos: fix unresponsive application menu by removing the SDL/Qt event loop conflict Assisted-by: GPT-6.1 Sol (root cause diagnosis and implementation) Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> * input_common: handle SDL gamepad button and axis events Assisted-by: DeepSeek V4 Pro (implementation) Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> --------- Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com>
Diffstat (limited to 'src/yuzu/util')
-rw-r--r--src/yuzu/util/macos_sleep.cpp25
-rw-r--r--src/yuzu/util/macos_sleep.h12
2 files changed, 37 insertions, 0 deletions
diff --git a/src/yuzu/util/macos_sleep.cpp b/src/yuzu/util/macos_sleep.cpp
new file mode 100644
index 0000000000..7525c37dca
--- /dev/null
+++ b/src/yuzu/util/macos_sleep.cpp
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include <IOKit/pwr_mgt/IOPMLib.h>
+#include "common/logging.h"
+#include "yuzu/util/macos_sleep.h"
+
+namespace MacOS {
+
+u32 PreventSleep() {
+ IOPMAssertionID assertion_id = kIOPMNullAssertionID;
+ const auto result =
+ IOPMAssertionCreateWithName(kIOPMAssertionTypePreventUserIdleDisplaySleep,
+ kIOPMAssertionLevelOn, CFSTR("Running a game"), &assertion_id);
+ if (result != kIOReturnSuccess) {
+ LOG_WARNING(Frontend, "Failed to prevent display sleep: {}", result);
+ return kIOPMNullAssertionID;
+ }
+ return assertion_id;
+}
+
+void AllowSleep(u32 assertion_id) {
+ IOPMAssertionRelease(assertion_id);
+}
+
+} // namespace MacOS
diff --git a/src/yuzu/util/macos_sleep.h b/src/yuzu/util/macos_sleep.h
new file mode 100644
index 0000000000..600dd7c553
--- /dev/null
+++ b/src/yuzu/util/macos_sleep.h
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#pragma once
+
+#include "common/common_types.h"
+
+namespace MacOS {
+
+u32 PreventSleep();
+void AllowSleep(u32 assertion_id);
+
+} // namespace MacOS