diff options
| author | QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> | 2026-10-31 14:33:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-31 14:33:08 +0100 |
| commit | d4e2dc88611252748b8dc3bb70baf56fc8bd2256 (patch) | |
| tree | 88cf5a92002f58efee5de70df65fe40519a45b01 /src/yuzu/util/macos_sleep.cpp | |
| parent | 7b6f27b91e0ecaebcc4d66ee7dd3855bebce6c78 (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/macos_sleep.cpp')
| -rw-r--r-- | src/yuzu/util/macos_sleep.cpp | 25 |
1 files changed, 25 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 |
