Be more honest about our Graphics.X11.XScreenSaver dependency #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At the moment, there is a runtime check whether the X11 package (which provides Graphics.X11.XScreenSaver) was compiled with the libXScrnSaver system library. If not, the code emits a warning and tries to go on.
However, the code still references the
getXIdleTime
function of theGraphics.X11.XScreenSaver
module. That module exportsgetXIdleTime
only if it has been compiled with the libXScrnSaver library.Thus at the moment, arbtt fails to compile if the X11 package was compiled without libXScrnSaver. (This is currently the default in NixOS, which is how I noticed this problem.)
This pull request simply removes the attempt to go on if libXScrnSaver is missing, since I deemed the idle time information to be too important. A perhaps better solution would be to upgrade
src/Capture/X11.hs
into anhsc
file and only importgetXIdleTime
if the C preprocessor flagHAVE_X11_EXTENSIONS_SCRNSAVER_H
is true, therefore feel exceptionally free to reject this pull request.If we go with the approach of this pull request, then we should also record somewhere that we require that the X11 package was compiled with libXScrnSaver. Ideally we would specify this in the Cabal file, but I don't think we can. Else it should at least be mentioned in the README. Please direct me to the correct place. :-)
This pull request was joint work with @xaverdh.