mirror of
https://github.com/godotengine/godot.git
synced 2025-01-30 21:33:18 +08:00
Implement screen_is_kept_on
for macOS.
This commit is contained in:
parent
cc35a8723c
commit
944779a132
@ -303,6 +303,7 @@ public:
|
||||
virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual void screen_set_keep_on(bool p_enable) override;
|
||||
virtual bool screen_is_kept_on() const override;
|
||||
|
||||
virtual Vector<int> get_window_list() const override;
|
||||
|
||||
|
@ -1892,6 +1892,10 @@ float DisplayServerMacOS::screen_get_refresh_rate(int p_screen) const {
|
||||
return SCREEN_REFRESH_RATE_FALLBACK;
|
||||
}
|
||||
|
||||
bool DisplayServerMacOS::screen_is_kept_on() const {
|
||||
return (screen_keep_on_assertion);
|
||||
}
|
||||
|
||||
void DisplayServerMacOS::screen_set_keep_on(bool p_enable) {
|
||||
if (screen_keep_on_assertion) {
|
||||
IOPMAssertionRelease(screen_keep_on_assertion);
|
||||
|
Loading…
Reference in New Issue
Block a user