Skip to content

Commit

Permalink
add function is_screensaver_enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
paddywwoof committed Nov 17, 2023
1 parent b370747 commit 0462a66
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pi3d/Display.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ def disable_screensaver(self):
import sdl2
sdl2.SDL_DisableScreenSaver()

def is_screensaver_enabled(self):
if pi3d.USE_SDL2: # if not will return None
import sdl2
return sdl2.SDL_IsScreenSaverEnabled() # returns SDL_boolean (0, 1)

def change_layer(self, layer=0):
self.layer = layer
self.opengl.change_layer(layer)
Expand Down

0 comments on commit 0462a66

Please sign in to comment.