Skip to content

Allow keyboard backlight to shut off during playback

This change updates how the screen is kept on during video playback.

Previously, sleep was prevented by injecting artificial user interaction on every timeChangeUpdate callback. This successfully keeps the display from dimming and the computer from going to sleep, but it also prevents the keyboard backlight from shutting off on laptops that have keyboard backlights.

This commit uses IOPMAssertionCreateWithName to assert to the operating system that the display should not sleep. It does this when playback is detected, rather than on every timer update, and releases the assertion when playback stops.

This results in new behavior in which the backlight will dim, based on the user's systemwide backlight preferences.

Taken from https://github.com/videolan/vlckit/pull/87

Merge request reports

Loading