Qt: fix inhibit screensaver on Linux (X11)

This change fixes https://github.com/PCSX2/pcsx2/issues/7367.
xdg-screensaver expects the given window ID to be that of the top level
window.
This commit is contained in:
David Scholberg authored and refractionpcsx2 committed 2022-11-13 09:29:41 +00:00
1 parent a874c5455d
commit ffe669137b
1 file changed
+3 -2
+3 -2
View File
@@ -430,8 +430,9 @@ void CommonHost::UpdateInhibitScreensaver(bool inhibit)
return;
WindowInfo wi;
if (g_host_display)
wi = g_host_display->GetWindowInfo();
auto top_level_wi = Host::GetTopLevelWindowInfo();
if (top_level_wi.has_value())
wi = top_level_wi.value();
s_screensaver_inhibited = inhibit;
if (!WindowInfo::InhibitScreensaver(wi, inhibit) && inhibit)