Merge pull request #63953 from bruvzg/mac_keep_on_read
Implement `screen_is_kept_on` for macOS.
This commit is contained in:
commit
91f14c40ff
2 changed files with 5 additions and 0 deletions
platform/macos
|
@ -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 a new issue