diff options
author | Niklas Higi <niklas@shroudedcode.com> | 2020-04-02 23:46:34 +0200 |
---|---|---|
committer | Niklas Higi <niklas@shroudedcode.com> | 2021-06-20 21:57:33 +0200 |
commit | 0c83a23ab51126eb3bbec40d58c7a29a1454ede6 (patch) | |
tree | a64bcb98500d765aea169b7c113da9b63a5693b9 /platform/linuxbsd/display_server_x11.h | |
parent | 953de68cfc3e157ce7136081140317a2c946fa97 (diff) |
Add "Keep screen on" feature to `DisplayServerX11`
Diffstat (limited to 'platform/linuxbsd/display_server_x11.h')
-rw-r--r-- | platform/linuxbsd/display_server_x11.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h index 594a38d39e..707775a1da 100644 --- a/platform/linuxbsd/display_server_x11.h +++ b/platform/linuxbsd/display_server_x11.h @@ -55,6 +55,10 @@ #include "platform/linuxbsd/vulkan_context_x11.h" #endif +#if defined(DBUS_ENABLED) +#include "freedesktop_screensaver.h" +#endif + #include <X11/Xcursor/Xcursor.h> #include <X11/Xlib.h> #include <X11/extensions/XInput2.h> @@ -103,6 +107,11 @@ class DisplayServerX11 : public DisplayServer { RenderingDeviceVulkan *rendering_device_vulkan; #endif +#if defined(DBUS_ENABLED) + FreeDesktopScreenSaver *screensaver; + bool keep_screen_on = false; +#endif + struct WindowData { Window x11_window; ::XIC xic; @@ -291,6 +300,11 @@ public: virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const; virtual bool screen_is_touchscreen(int p_screen = SCREEN_OF_MAIN_WINDOW) const; +#if defined(DBUS_ENABLED) + virtual void screen_set_keep_on(bool p_enable); + virtual bool screen_is_kept_on() const; +#endif + virtual Vector<DisplayServer::WindowID> get_window_list() const; virtual WindowID create_sub_window(WindowMode p_mode, uint32_t p_flags, const Rect2i &p_rect = Rect2i()); |