1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Add support for system dark mode (Linux)

- Use `org.freedesktop.appearance color-scheme` to support system dark mode.
This commit is contained in:
Raul Santos
2022-08-30 17:04:17 +02:00
parent 6ccbc27093
commit 471c9c2969
7 changed files with 233 additions and 3 deletions

View File

@@ -60,6 +60,7 @@
#endif
#if defined(DBUS_ENABLED)
#include "freedesktop_portal_desktop.h"
#include "freedesktop_screensaver.h"
#endif
@@ -120,6 +121,10 @@ class DisplayServerX11 : public DisplayServer {
TTS_Linux *tts = nullptr;
#endif
#if defined(DBUS_ENABLED)
FreeDesktopPortalDesktop *portal_desktop = nullptr;
#endif
struct WindowData {
Window x11_window;
::XIC xic;
@@ -320,6 +325,11 @@ public:
virtual void tts_stop() override;
#endif
#if defined(DBUS_ENABLED)
virtual bool is_dark_mode_supported() const override;
virtual bool is_dark_mode() const override;
#endif
virtual void mouse_set_mode(MouseMode p_mode) override;
virtual MouseMode mouse_get_mode() const override;