mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
linux: Use D-Bus to inhibit screensaver
This commit is contained in:
@ -45,24 +45,6 @@ bool ToggleFullscreen(Display* dpy, Window win)
|
||||
return true;
|
||||
}
|
||||
|
||||
void InhibitScreensaver(Window win, bool suspend)
|
||||
{
|
||||
char id[11];
|
||||
snprintf(id, sizeof(id), "0x%lx", win);
|
||||
|
||||
// Call xdg-screensaver
|
||||
char* argv[4] = {(char*)"xdg-screensaver", (char*)(suspend ? "suspend" : "resume"), id, nullptr};
|
||||
pid_t pid;
|
||||
if (!posix_spawnp(&pid, "xdg-screensaver", nullptr, nullptr, argv, environ))
|
||||
{
|
||||
int status;
|
||||
while (waitpid(pid, &status, 0) == -1)
|
||||
;
|
||||
|
||||
INFO_LOG_FMT(VIDEO, "Started xdg-screensaver (PID = {})", pid);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_XRANDR
|
||||
XRRConfiguration::XRRConfiguration(Display* _dpy, Window _win)
|
||||
: dpy(_dpy), win(_win), screenResources(nullptr), outputInfo(nullptr), crtcInfo(nullptr),
|
||||
|
Reference in New Issue
Block a user