Skip to content

Draft: Various bugfixes (UI, screensaver)

Icham AIDIBE requested to merge blouf/vlc:variousbugfixes into 3.0.x

I'm continuing the series on those little bugs we all know, and have just learned to live with:

qt/fix : "Hide future errors" checkbox bug (ie. when a media in the playlist is not found …)

I've made a small change to how the error dialogs behave. Previously, the Hide future errors checkbox had a redundant line that checked the opposite of its initial state, which could lead to inconsistent behavior. It has to be unchecked/rechecked. I've corrected this logic to ensure the checkbox accurately reflects and controls the qt-error-dialogs setting. This change improves the reliability of our configuration and user experience.

hidecheckbox.png

qt/feature: Persist Preferences view mode per-session

The Preferences dialog provides two view modes: "Simple" and "All". However, the dialog always defaulted to "Simple" mode every time it was opened. A user who prefers the "All" view had to manually re-select it each time they accessed the preferences within the same application session, leading to a repetitive and inconvenient user experience.

This change persists the user's selected view mode for the duration of the application session - a way to meet halfway.

fix(win32): Prevent screensaver race condition on modern Windows

On modern Windows platforms (Windows 10 and 11), the screensaver can intermittently activate during video playback, even when inhibited by VLC.

This issue is caused by a race condition between two different APIs being used simultaneously:

  1. SetThreadExecutionState: The modern, recommended API for an application to signal it is active.
  2. SystemParametersInfo (SPI_SETSCREENSAVEACTIVE): A legacy API that modifies the global, persistent screensaver setting for the user.

On Windows 10/11, system services that manage user settings can conflict with the global change made by SystemParametersInfo, reverting it unexpectedly. This results in the intermittent bug. Technical discussions among developers confirm that using these two methods together for temporary inhibition is a known anti-pattern.

Solution: Instead of completely removing the legacy API calls, this change introduces conditional logic to apply the most appropriate method based on the OS version. A runtime check using IsWindows10OrGreater() has been added.

  • On Windows 10 and newer: We now rely exclusively on SetThreadExecutionState. This aligns with Microsoft's best practices, avoids modifying global user settings, and resolves the race condition.
  • On older Windows versions (e.g., 7, 8.1): The original behavior is preserved (using both APIs). This is a defensive measure to prevent any potential regressions on systems where the previous logic was stable. This conditional logic is applied consistently across the module, including the main Run loop and the RestoreStateOnCancel cleanup handler. This provides a targeted fix for modern systems while ensuring maximum compatibility and stability for older ones.

Merge request reports

Loading