mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Prevent xdg-screensaver's "Protocol error" messages
This commit is contained in:
parent
d1c03b22e3
commit
214a80b338
@ -199,11 +199,24 @@ static void xdg_screensaver_inhibit(Window wnd)
|
||||
{
|
||||
int ret;
|
||||
char cmd[64];
|
||||
char title[128];
|
||||
|
||||
cmd[0] = '\0';
|
||||
title[0] = '\0';
|
||||
|
||||
RARCH_LOG("[X11]: Suspending screensaver (X11, xdg-screensaver).\n");
|
||||
|
||||
/* Make sure the window has a title, even if it's a bogus one, otherwise
|
||||
* xdg-screensaver will fail and report to stderr, framing RA for its bug.
|
||||
* A single space character is used so that the title bar stays visibly
|
||||
* the same, as if there's no title at all. */
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
if (strlen(title) == 0)
|
||||
snprintf(title, sizeof(title), " ");
|
||||
XChangeProperty(g_x11_dpy, g_x11_win, XA_WM_NAME, XA_STRING,
|
||||
8, PropModeReplace, (const unsigned char*) title,
|
||||
strlen(title));
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "xdg-screensaver suspend 0x%x", (int)wnd);
|
||||
|
||||
ret = system(cmd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user