Skip to content

Better libddcutil error handling

Albert Vaca Cintora requested to merge work/libddcutil-error-handling into master

The previous detect code was never clearing the vector of displays, it would only append new displays leaving the old ones there.

Since we call detect when there's an error setting the brightness, it meant the vector would grow each time we try to set the brightness for a display that is in the vector but doesn't exist anymore (or even worse, for a faulty display causing an infinite loop).

This does two things:

  • Clears the vector of displays on each detect
  • Calls detect only once if there are errors when setting the brightness.

Merge request reports