spacr.qt.screensaver

Show the backdrop alone, full screen, until any input is received.

A SEPARATE WINDOW, not the main one made full screen. Hiding spaCR’s own widgets and restoring them afterwards means remembering what was visible, what had focus, which docks were open and what the splitters were set to – and getting any of it wrong leaves the user’s layout rearranged by something that was meant to be a screensaver. A window of its own has nothing to restore: it is closed and the application is exactly as it was.

IT BUILDS ITS OWN BACKDROP for the same reason. Reparenting the running one would take it off the screen behind it, so leaving the screensaver would have to put it back – and a reparented GL canvas is a context that may not survive the move.

Classes

Screensaver

A full-screen backdrop that closes on any key or click.

Functions

show_screensaver(→ Optional[Screensaver])

Open the backdrop full screen on the parent's screen.

Module Contents

class spacr.qt.screensaver.Screensaver(parent: PySide6.QtWidgets.QWidget | None = None)[source]

Bases: PySide6.QtWidgets.QWidget

A full-screen backdrop that closes on any key or click.

Parameters:

parent – the window it was opened from, used only so Qt gives the screensaver the same screen.

Build the screensaver as its own full-screen window.

A Qt.Window and deliberately not parented into the layout: a child widget cannot go full screen on its own, and a tool window loses focus to the main window the moment it appears – which would send “any key” to the wrong place.

Parameters:

parent – the window it was opened from, remembered so it can be returned to; the screensaver is not parented into it.

closeEvent(event) None[source]

Stop the backdrop before the window goes.

A canvas whose widget is destroyed while its timer is still running is the crash this module must not cause: pause is the documented way to make one give its threads back.

keyPressEvent(event) None[source]

Dismiss on any key.

Parameters:

event – the Qt key event.

mousePressEvent(event) None[source]

Dismiss on any click.

Parameters:

event – the Qt mouse event.

paintEvent(_event) None[source]

Black behind the backdrop, so nothing shows through.

spacr.qt.screensaver.show_screensaver(parent: PySide6.QtWidgets.QWidget | None = None) Screensaver | None[source]

Open the backdrop full screen on the parent’s screen.

Returns:

the window, or None when it could not be opened.