zhengqunkoo avatar

sxiv

0 subscribers
CRoffMakefile

Simple X Image Viewer

Created Aug 2020

GPL-2.0 license

Live activities

Introduced a new '-x' command-line flag for sxiv that triggers an automatic exit if the current zoom level falls below 100%. This provides a convenient way to close the viewer during mouse-wheel zoom navigation when the image is scaled down. Keep your workflow focused by exiting immediately upon reaching your preferred zoom threshold.

Implemented a threaded zooming mechanism in sxiv to improve responsiveness during zoom operations. Instead of blocking the main loop during the zoom animation, zoom commands now spawn a single thread that manages the velocity of the effect, allowing subsequent commands to adjust the velocity dynamically. This change adds pthreads usage to handle the animation concurrently, resulting in a smoother zooming experience.

Replaced the discrete zoom step behavior with a new smooth, velocity-based transition. By introducing friction-based physics to the zoom calculation, images now scale fluidly instead of jumping between fixed percentage levels. You can further customize the feel of the zoom via new configuration constants in config.def.h. Smooth animation

We updated the default mouse configuration in config.def.h to swap the middle and right mouse button actions. This change improves the standard interaction flow, making the primary utility workflows more ergonomic for common usage patterns.

The clean target in the Makefile now includes config.h. This ensures that local configuration state is properly cleared during a rebuild, preventing stale build artifacts.

The README now explicitly lists the libraries required to build sxiv, including which ones are optional and how they can be disabled at compile time. It also calls out the need for development packages on distros that split runtime and headers, which addresses common installation confusion behind issues #378 and #374. The practical effect is a smoother first build for contributors and packagers.

This change fixes a memory leak in win_res() by moving X resource database creation out of the helper and into win_init(), so the same XrmDatabase can be reused for font and color lookups instead of being recreated on every call. The function now accepts the database directly and safely falls back to defaults when no resource is available. It’s a small internal cleanup, but it removes unnecessary allocations during startup and fixes issue #372.

This push doesn’t change runtime behavior directly; it marks the repository’s next stable release by bumping the Makefile version from 25+ to 26 and adding the v26 entry to the changelog in README.md. The release is explicitly labeled as a maintenance release, so the main impact is cleaner versioning and an updated download/changelog reference for users and packagers. In practice, this makes the new stable snapshot official and easier to consume.

Following earlier updates that removed special color handling for fullscreen mode, tracking the application's fullscreen state is no longer necessary. This update removes the explicit state tracking and _NET_SUPPORTED Window Manager feature checks, instead simply sending a toggle request (_NET_WM_STATE_FULLSCREEN) directly to the WM. By dropping the synchronous X11 property queries during window initialization, this simplifies the code and marginally speeds up startup.

Previously, entering fullscreen mode would force a black background and attempt to calculate color luminance to adjust contrast. This logic has been completely removed in favor of simply respecting the configured background and foreground colors simultaneously in all contexts. This cleans up the drawing code and ensures your custom theme remains perfectly intact whether you are windowed or full screen. 🎨

This change expands the sxiv man page with a dedicated configuration section that lists the supported X resources: background, foreground, and font. It also updates the related references to point readers toward X and xrdb, making the customization path much clearer for anyone configuring the app through X resources. Practical effect: users can now find the theming knobs directly in the docs instead of digging through source or trial and error.

The window's fallback font, background color, and foreground color were previously hardcoded in config.def.h, meaning users had to modify source files for basic customization. These definitions have been removed, with the window initialization now relying purely on standard defaults when X resources are absent. This enforces appearance configuration exclusively through X resources (background, foreground, and font), simplifying setup by eliminating the need to recompile the project just to adjust its look.

The bar font can now be configured using the font property in Xresources, overriding the hardcoded BAR_FONT value in config.def.h. By querying the X resource manager during initialization, users can seamlessly match their bar's font and size with their existing system-wide Xresources themes.

Addressed a compilation warning generated on macOS by refactoring the error handling in tns_cache_write. The code now directly checks the return value of directory creation rather than incorrectly assigning it to an Imlib_Load_Error enum, which caused signedness comparison issues. This minor structural cleanup ensures directories for cached thumbnails are created properly without silent failures.

When rendering text with Xft, characters missing from the primary font require dynamically instantiated fallback fonts. Previously, these fallback fonts were loaded without a specific size, which could cause inconsistent scaling for emojis or alternate scripts. By explicitly querying the primary font's FC_SIZE property and applying it to the fallback request, secondary glyphs now accurately match the size of the surrounding text.

The Makefile previously hardcoded the include path for freetype2 headers to /usr/include/freetype2, causing build failures on systems with alternative package managers or non-standard setups. The compile flags have been updated to also search within $(PREFIX)/include/freetype2. This straightforward fix ensures compiling remains smooth and robust out of the box across different UNIX-like environments.

Version 25 introduces practical quality-of-life improvements, notably adding font fallback support to gracefully handle missing glyphs. It also integrates better with existing desktop themes by pulling background and foreground colors directly from the X resource database. Additionally, this release fixes a persistent busy loop issue on systems built without inotify, resulting in a more reliable and cohesive experience.

- End of feed -