Bug 120326 - Running slideshow must disable screensaver/sleep mode on Windows
Summary: Running slideshow must disable screensaver/sleep mode on Windows
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
(earliest affected)
Hardware: All Windows (All)
: medium minor
Assignee: Mike Kaganski
Whiteboard: target:7.5.0
Depends on:
Reported: 2018-10-04 21:35 UTC by Mike Kaganski
Modified: 2022-10-13 14:21 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2018-10-04 21:35:16 UTC
When in presentation controlled using Impress Remote (at least on Windows), using next/previous slide from the Remote does not treated by OS as user events that reset screen saver; so after some time in the presentation, the screen may power off. The proposal is to send some user events to system to reset the idle timer at each Remote interaction.

1. Start a presentation using Impress Remote
2. Don't touch computer's keyboard or mouse; keep controlling the presentation using Remote

Actual results:
Eventually, screens (both main and presentation) would turn off after system-defined timeout

Expected Results:
If time since last Remote interaction is less than the screen saver timeout, it shouldn't be activated, even if the presentation itself is running long enough.
Comment 1 Xisco Faulí 2018-11-05 13:02:06 UTC
moving to NEW
Comment 2 QA Administrators 2019-11-06 03:30:53 UTC Comment hidden (noise)
Comment 3 Christian Lohmaier 2019-11-11 11:11:20 UTC
as the app only communicates with LibreOffice, and doesn't interact with the OS itself, this requires a change in LibreOffice Impress, thus reassigning
Comment 4 QA Administrators 2021-11-11 04:14:14 UTC Comment hidden (noise)
Comment 5 Mike Kaganski 2021-11-11 07:13:32 UTC
Code pointers:

The place where we should insert calls to inform OS about user input is

  Receiver::executeCommand in sd/source/ui/remotecontrol/Receiver.cxx

Additionally/alternatively, we might consider setting an OS flag on remote connection/initiated slideshow start, and clear it on disconnection/slideshow end. This needs to be done at

  Communicator ctor and dtor in sd/source/ui/remotecontrol/Communicator.cxx

The code to inform OS is necessarily OS/WM-specific. For Windows, informing OS about user input (in Receiver) should be done using SendInput [1], as discussed at [2]. Using PowerSetRequest [3] and/or SetThreadExecutionState [4] may be used in the Communicator, as these calls do not represent some events, but rather some state.

[1] https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput
[2] http://stackoverflow.com/a/1675793/1889329
[3] https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-powersetrequest
[4] https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate
Comment 7 Mike Kaganski 2022-10-13 08:39:43 UTC
Oh - it's actually a bug, and the presentation should disable screen saver completely:

Comment 8 Mike Kaganski 2022-10-13 10:56:30 UTC
Comment 9 Commit Notification 2022-10-13 14:21:37 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":


tdf#120326: properly prevent Windows from entering power saving

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.