aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add thumb-info (#265)N-R-K2022-05-035-19/+69
| | | | Closes: https://github.com/nsxiv/nsxiv/issues/88 Closes: https://github.com/nsxiv/nsxiv/pull/253
* replace select() with poll() (#270)N-R-K2022-04-282-18/+14
| | | | | | | | | | usage of select (3) in modern programs is typically discouraged. this simply replaces the select call with poll (3) instead. and since poll conveniently ignores negative fds, this also reduces needs for some special casing. this also handles error if they occur, while old implementation didn't. other than the error handling, no change in functionality should occur.
* README: some wording change and cosmetics (#269)N-R-K2022-04-281-6/+8
|
* merge autoreload_{inotify,nop}.c into autoreload.c (#263)explosion-mental2022-04-273-45/+30
|
* code-style: reduce some unnecessary if-elses (#261)N-R-K2022-04-272-16/+5
| | | | also change the condition inside img_frame_animate() to check for positive value rather than comparing against 0.
* Update .desktop entry's mimetypes (#260)Michael2022-04-171-1/+1
| | | Co-authored-by: NRK <nrk@disroot.org>
* don't quit if imlib_create_image() fails (#248)N-R-K2022-04-121-2/+8
| | | | | ...simply print an error msg and try (slower) fallback. also adds a useful comment explaining why we're doing manual blending.
* fix: correctly close the font (#250)N-R-K2022-04-101-2/+3
| | | | | | | currently we immediately close the font on win_init_font(), which was introduced in 0d8dcfd. this was probably not correct since we use `font` later in win_draw_text(). instead, the font should be closed at exit/cleanup.
* Improve starting in fullscreen modeKim Woelders2022-03-311-3/+6
| | | | | | Instead of effectively first mapping the window at regular size and then fullscreening it, tell the WM to map the window at fullscreen size by setting _NET_WM_STATE_FULLSCREEN before mapping the window.
* Correct setting of _NET_WM_PIDKim Woelders2022-03-311-2/+2
| | | | | | | The property _NET_WM_PID is a CARDINAL which per definition has format 32, whatever the size of pid_t may be. CARDINALS (and other format 32 items) must always be passed to Xlib in long's, whatever the size of long may be.
* fix: thumbnail memory leak when removing file (#247)N-R-K2022-03-271-0/+4
|
* Fix typo and manpage improvement (#249)Nick Morrott2022-03-262-16/+27
| | | | | | | * Fixes some typo and adds some consistency to the manpage Typo detected automatically whilst packaging nsxiv for Debian Co-authored-by: NRK <nrk@disroot.org>
* fix: close the file descriptor in get_win_title() (#245)N-R-K2022-03-171-0/+1
| | | | this would eventually end up opening too many fds and erroring out with "too many open files".
* Export known issues in readme to GitHub issues (#243)Berke Kocaoğlu2022-03-081-4/+1
| | | Export known issues in readme to GitHub issues and link the issue
* Release version 29N-R-K2022-03-033-2/+32
|
* fix: window title not working on certain WMsNRK2022-03-022-11/+12
| | | | | | | not all WMs support `_NET_WM_NAME` and `_NET_WM_ICON_NAME` this patch sets `WM_NAME` and `WM_ICON_NAME` inside win_set_title() Closes: https://github.com/nsxiv/nsxiv/issues/233
* always initialize window titleNRK2022-03-023-21/+27
| | | | | before if exec/win-title didn't exist then window title wouldn't be set. this patch makes it so window title is always set to something.
* code-style: slight cleanupsNRK2022-03-024-8/+8
| | | | | | * put TOP_STATUSBAR under the HAVE_LIBFONTS guard * change get_win_title param to take unsigned char ptr * init UTF8_STRING like other atoms
* Makefile: cleanup non-posix stuff (#225)N-R-K2022-02-272-29/+24
| | | | | | | | | | remove some non-posix extensions which slipped through and adjust ci to new Makefile changes users can still overwrite the variables explicitly by using `make VAR=VALUE` packagers can also add extra libs to LDLIBS, we're internally using NSXIV_LDLIBS now.
* add config.h option for top statusbar (#231)N-R-K2022-02-265-5/+11
| | | | Closes: https://github.com/nsxiv/nsxiv/issues/230 Co-authored-by: mamg22 <45301823+mamg22@users.noreply.github.com>
* Add libXft-bgra to FAQ in readme (#229)Berke Kocaoğlu2022-02-251-0/+5
| | | | | | Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: eylles <ed.ylles1997@gmail.com> Co-authored-by: explosion-mental <explosion0mental@gmail.com> Co-authored-by: mamg22 <marcomonizg@gmail.com>
* use win-title script for customizing window title (#213)N-R-K2022-02-238-69/+103
| | | | | this removes the cli flag `-T` as well as related config.h options. Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
* Add reuseable abstraction over fork/exec/dup2 (#211)N-R-K2022-02-203-45/+113
|
* Fix broken ci and enable higher level optimization (#220)N-R-K2022-02-201-0/+6
| | | | | | | | | * [ci] fix broken ci * [ci] enable higher optimization level and lto higher optimization levels enable more warnings and deeper analysis. likewise, lto can catch a couple errors which typically goes unnoticed without it.
* declare internal variables as staticNRK2022-02-171-4/+4
|
* code-style: prefer calloc over malloc+memsetNRK2022-02-174-7/+15
|
* update copyright yearNRK2022-02-138-8/+8
|
* Add keybind to scroll to image center (#203)Nick Hanley2022-01-156-0/+20
| | | There are keybinds for scrolling to the edges of an image but there's no way back to the center. This is particularly annoying while zooming.
* make thumbnail bindings configureable via config.h (#167)N-R-K2022-01-104-53/+82
| | | | | | | | | | | | | | this allows for configuring thumbnail mode mouse bindings similar to image mode bindings. however we can't put the thumbnails bindings into the existing buttons[] array due to fallthrough. For example M3 would switch mode and then end up selecting an image. which is why thumbnail bindings have been put into it's own array `buttons_tns[]` and `buttons[]` has been renamed to `buttons_img[]` for consistency. Closes: https://github.com/nsxiv/nsxiv/issues/131
* Document development workflow for maintainers (#202)mamg222022-01-081-0/+36
| | | | Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
* [ci] separate dep from buildNRK2022-01-061-9/+13
| | | | | removes /dev/null redirections from the dep step so in case some dep fails to install/compile we will have the log.
* [ci] fetch tcc from a known working commitNRK2022-01-061-5/+7
| | | | avoids our ci failing in case there's a faulty new commit on tcc.
* add additional warning and -Werror to github workflowNRK2022-01-061-0/+18
|
* fix -Wwrite-strings related warningsNRK2022-01-061-4/+6
|
* fix tcc warningNRK2022-01-061-0/+1
|
* fix -Wmaybe-uninitialized warningNRK2022-01-061-1/+1
|
* fix -Wstrict-prototype warningNRK2022-01-061-1/+1
| | | | looks like i missed one in ff88908
* fix -Wshadow related warningsNRK2022-01-063-11/+10
| | | | | | | | fixes all -Wshadow related warnings (on gcc). this would allow us to use `-Wshadow` in github workflow (https://github.com/nsxiv/nsxiv/pull/195). i've thought about adding `-Wshadow` to our Makefile as well, but decided against it to keep the Makefile CFLAGS barebore/minimal.
* fix: reset statusbar after failed keyhandler (#191)N-R-K2022-01-031-8/+10
| | | | | | | | | | | | currently if the keyhandler invocation fails, for example due to it not being present, the statusbar does not reset and stays on "getting keyhandler input" message. now the return value from run_key_handler() is used to determine if the function was successful or not. and if the function failed, we call handle_key_handler() with false which resets the statusbar. we also no longer call redraw() within run_key_handler() and instead assign it's return value to dirty which does a redraw if true.
* remove unused function and typedef (#199)N-R-K2022-01-022-16/+0
| | | | | byteorder_t and size_readable is not used anywhere within the code. byteorder_t seems to be a remain from some time sxiv handled exif data itself instead of relying on a library, introduced in 691c6d7, and probably became irrelevant when libexif was added as dependency again. And size_readable from some time it displayed the file size in the window title, introduced in bad9a70.
* fix: animation slowdown when zoomed in (#200)N-R-K2022-01-031-1/+1
| | | | | | | | | | | | rendering is a pretty expensive operation, especially when scaling with anti-aliasing. by waiting for the image to render before setting timeout, the actual timeout ends up being (render time + actual delay). this pretty much fixes the slowdown entirely on all the images i've tested. it should also improve things noticeably even in cases where the delay between frames is shorter than how fast we can render. although on such images, the issue may not be fixed entirely. Closes: https://github.com/nsxiv/nsxiv/issues/70
* fix: jpeg exif orientation on Imlib2 v1.7.5 (#188)N-R-K2022-01-021-1/+9
| | | | | | since Imlib2 v1.7.5, it is capable of parsing exif data on jpeg files and auto orienting them. this caused nsxiv to rotate the image twice. Closes: https://github.com/nsxiv/nsxiv/issues/187
* Allow setting cache size based on memory percentage (#184)MahouShoujoMivutilde2022-01-012-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem: 1. For the most people imlib2's default 4MiB is unreasonably low; 2. Hardcoding cache size to ~256MiB has performance benefits and doesn't increase RAM usage too much on relatively modern systems; 3. But we can't do that, because that would be detrimental to low spec systems that (apparently) not (?) building nsxiv from source, as been discussed #171 Solution: Calculate cache size based on total memory. Default is set as 3%, which means: * ~245MiB for 8GiB * ~30MiB for 1GiB * and so on CACHE_SIZE_LIMIT (256MiB by default) sets the highest possible value. And in case we cannot determine the total memory (e.g since _SC_PHYS_PAGES isn't POSIX) use CACHE_SIZE_FALLBACK (32MiB by default) instead. Co-authored-by: NRK <nrk@disroot.org>
* fix: broken compilation when using HAVE_LIBFONTS=0 (#194)N-R-K2021-12-291-1/+1
| | | | | | | | | | | | | compilation currently fails with `make HAVE_LIBFONTS=0` due to `EXIT_SUCCESS` not being defined. I assume Xft.h includes stdlib.h which is why compilation works with HAVE_LIBFONTS=1 this switches to using 0 as cg_quit argument in keybindings. if my interpretation of the C99 standard is correct, then 0 and EXIT_SUCCESS means the same thing. > If the value of status is zero or EXIT_SUCCESS, an > implementation-defined form of the status successful termination is > returned.
* add github actions (#195)NRK2021-12-291-0/+41
| | | | this runs both default and minimal build with gcc, clang and tcc.
* Cleanup manpage (#186)mamg222021-12-241-41/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | * Move `-T` option in manpage The `-T` option breaks the alphabetical order of options in both the SYNOPSIS and OPTION sections * Reword "on bottom of" in manpage * Pluralize "count pixel" * Fix typos * Reword `M` keyboard binding description * rename info bar -> statusbar for consistency * document all the thumbnail bindings * Add website to HOMEPAGE section * Add missing maintainers * Sort maintainers by activity Co-authored-by: NRK <nrk@disroot.org>
* specify func argument and related cleanup (#183)N-R-K2021-12-195-40/+40
| | | | | | | | | | | | * specifies the function argument type in commands.h compared to leaving it unspecified. all the functions in cmd_t must have arg_t as it's argument. * changes to commands.h will now trigger a rebuild - this restores old behavior prior to 12efa0e * cg_quit now uses it's argument as exit status * DestroyNotify invokes cg_quit rather than calling exit directly. * Explicitly pass EXIT_SUCCESS to cgquit in keybinding Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
* README: Fix version badge (#185)Sanjay Pavan2021-12-121-1/+1
|
* refactor: move shared code into a functionNRK2021-12-121-21/+19
|
* img_load_webp: close the file handler and use errnoNRK2021-12-121-3/+4
|