mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 01:38:37 +12:00
Add option for preventing display sleep (#5783)
Adds support for preventing the display from sleeping while a game is running. Supports Windows, Linux (with the org.freedesktop.ScreenSaver D-Bus service), and macOS.
This commit is contained in:
parent
07022fd3b6
commit
3ad743ecaa
11 changed files with 118 additions and 16 deletions
|
@ -2,10 +2,6 @@
|
|||
#include "PadHandler.h"
|
||||
#include "pad_thread.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
cfg_input g_cfg_input;
|
||||
|
||||
PadHandlerBase::PadHandlerBase(pad_handler type) : m_type(type)
|
||||
|
@ -621,16 +617,5 @@ void PadHandlerBase::ThreadProc()
|
|||
get_mapping(device, pad);
|
||||
get_extended_info(device, pad);
|
||||
apply_pad_data(device, pad);
|
||||
|
||||
#ifdef _WIN32
|
||||
for (const auto& btn : pad->m_buttons)
|
||||
{
|
||||
if (pad->m_buttons[i].m_pressed)
|
||||
{
|
||||
SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue