summaryrefslogtreecommitdiffstats
path: root/src/core/desktop_screen_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/desktop_screen_qt.cpp')
-rw-r--r--src/core/desktop_screen_qt.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/core/desktop_screen_qt.cpp b/src/core/desktop_screen_qt.cpp
index fd7a2c54f..e81dbb9ac 100644
--- a/src/core/desktop_screen_qt.cpp
+++ b/src/core/desktop_screen_qt.cpp
@@ -46,6 +46,15 @@
#include <QGuiApplication>
#include <QScreen>
+#if defined(USE_OZONE)
+#include "ui/ozone/buildflags.h"
+#if BUILDFLAG(OZONE_PLATFORM_X11)
+#define USE_XSCREENSAVER
+#include "ui/base/x/x11_screensaver.h"
+#include "ui/base/x/x11_util.h"
+#endif
+#endif
+
#include <cmath>
namespace QtWebEngineCore {
@@ -137,4 +146,22 @@ display::Display DesktopScreenQt::GetDisplayNearestWindow(gfx::NativeWindow /*wi
return GetPrimaryDisplay();
}
+bool DesktopScreenQt::SetScreenSaverSuspended(bool suspend)
+{
+#if defined(USE_XSCREENSAVER)
+ return ui::SuspendX11ScreenSaver(suspend);
+#else
+ return false;
+#endif
+}
+
+bool DesktopScreenQt::IsScreenSaverActive() const
+{
+#if defined(USE_XSCREENSAVER)
+ return ui::IsXScreensaverActive();
+#else
+ return false;
+#endif
+}
+
} // namespace QtWebEngineCore