aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2022-05-30config.mk: add comments for OpenBSD usersNRK
Closes: https://github.com/nsxiv/nsxiv/issues/262
2022-05-30introduce config.mkNRK
this moves all the build variables intended to be modified by the user over to `config.mk` similar to other suckless software. also move CPPFLAGS down below for cosmetic purposes.
2022-05-28fix: broken slideshow if redraw takes too long (#282)N-R-K
currently the way check_timeout() is implemented, animate has higher priority than slideshow. so if doing a redraw takes longer than the frame delay of the animated image then it's going to continuously keep animating and never reliably get to slideshow. this issue can occur if the animated image has too fast of a delay or if nsxiv is being run on a slow system where doing redraw takes too long. the issue can be emulated by artificially slowing down img_render by sticking a sleep in there. diff --git a/main.c b/main.c index 5dc52d4..0580011 100644 --- a/main.c +++ b/main.c @@ -441,6 +441,7 @@ void redraw(void) if (mode == MODE_IMAGE) { img_render(&img); + nanosleep(&(struct timespec){0, 62000000}, NULL); /* 62ms */ if (img.ss.on) { t = img.ss.delay * 100; if (img.multi.cnt > 0 && img.multi.animate) make it so that slideshow has higher priority than animate to fix the issue. Closes: https://github.com/nsxiv/nsxiv/issues/281
2022-05-19fix: broken statusbar after key-handler cancellationNRK
to reproduce: 1. have an image-info script 2. invoke the key-handler 3. cancle invocation by pressing `escape` at this point, the statusbar ends up being empty. the regression seems to be caused by 6922d5d (changing select to poll), unsure why that is. in any case, this simplifies read_info quite a bit and solves the regression as well. in short: * read straight into the statusbar buffer * if read succeeds, make sure buffer is null terminated and replace any newline with space * close the script
2022-05-19fix: don't override statusbar if info script doesn't existNRK
this happens when the keyhandler is invoked while viewing an animated image. if {image,thumb}-info scripts exists, everything works as expected. but if they don't, then update_info will override the statusbar.
2022-05-19fix: broken thumbnail statusbar after running keyhandlerNRK
2022-05-12check_timeouts: avoid unnecessary conversions (#273)N-R-K
before we were using select, which expected `struct timeval` as arg. so we needed to do ms -> timeval conversions. but now since we're using poll, which accepts milisec as arg, there's no need to do ms -> timeval -> ms. instead have check_timeouts directly return ms.
2022-05-03Declare every extern function/variable in `nsxiv.h` (#268)N-R-K
with a couple exceptions as they cause too many -Wshadow warnings. also moves the `extcmd_t` typedef on top for cosmetic purposes. also enable `-Wmissing-prototypes` in the ci
2022-05-03Add thumb-info (#265)N-R-K
Closes: https://github.com/nsxiv/nsxiv/issues/88 Closes: https://github.com/nsxiv/nsxiv/pull/253
2022-04-28replace select() with poll() (#270)N-R-K
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.
2022-04-28README: some wording change and cosmetics (#269)N-R-K
2022-04-27merge autoreload_{inotify,nop}.c into autoreload.c (#263)explosion-mental
2022-04-27code-style: reduce some unnecessary if-elses (#261)N-R-K
also change the condition inside img_frame_animate() to check for positive value rather than comparing against 0.
2022-04-17Update .desktop entry's mimetypes (#260)Michael
Co-authored-by: NRK <nrk@disroot.org>
2022-04-12don't quit if imlib_create_image() fails (#248)N-R-K
...simply print an error msg and try (slower) fallback. also adds a useful comment explaining why we're doing manual blending.
2022-04-10fix: correctly close the font (#250)N-R-K
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.
2022-03-31Improve starting in fullscreen modeKim Woelders
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.
2022-03-31Correct setting of _NET_WM_PIDKim Woelders
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.
2022-03-27fix: thumbnail memory leak when removing file (#247)N-R-K
2022-03-26Fix typo and manpage improvement (#249)Nick Morrott
* 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>
2022-03-17fix: close the file descriptor in get_win_title() (#245)N-R-K
this would eventually end up opening too many fds and erroring out with "too many open files".
2022-03-08Export known issues in readme to GitHub issues (#243)Berke Kocaoğlu
Export known issues in readme to GitHub issues and link the issue
2022-03-03Release version 29v29N-R-K
2022-03-02fix: window title not working on certain WMsNRK
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
2022-03-02always initialize window titleNRK
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.
2022-03-02code-style: slight cleanupsNRK
* put TOP_STATUSBAR under the HAVE_LIBFONTS guard * change get_win_title param to take unsigned char ptr * init UTF8_STRING like other atoms
2022-02-27Makefile: cleanup non-posix stuff (#225)N-R-K
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.
2022-02-26add config.h option for top statusbar (#231)N-R-K
Closes: https://github.com/nsxiv/nsxiv/issues/230 Co-authored-by: mamg22 <45301823+mamg22@users.noreply.github.com>
2022-02-24Add libXft-bgra to FAQ in readme (#229)Berke Kocaoğlu
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>
2022-02-23use win-title script for customizing window title (#213)N-R-K
this removes the cli flag `-T` as well as related config.h options. Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2022-02-20Add reuseable abstraction over fork/exec/dup2 (#211)N-R-K
2022-02-20Fix broken ci and enable higher level optimization (#220)N-R-K
* [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.
2022-02-17declare internal variables as staticNRK
2022-02-17code-style: prefer calloc over malloc+memsetNRK
2022-02-13update copyright yearNRK
2022-01-15Add keybind to scroll to image center (#203)Nick Hanley
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.
2022-01-10make thumbnail bindings configureable via config.h (#167)N-R-K
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
2022-01-08Document development workflow for maintainers (#202)mamg22
Co-authored-by: NRK <nrk@disroot.org> Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2022-01-06[ci] separate dep from buildNRK
removes /dev/null redirections from the dep step so in case some dep fails to install/compile we will have the log.
2022-01-06[ci] fetch tcc from a known working commitNRK
avoids our ci failing in case there's a faulty new commit on tcc.
2022-01-06add additional warning and -Werror to github workflowNRK
2022-01-06fix -Wwrite-strings related warningsNRK
2022-01-06fix tcc warningNRK
2022-01-06fix -Wmaybe-uninitialized warningNRK
2022-01-06fix -Wstrict-prototype warningNRK
looks like i missed one in ff88908
2022-01-06fix -Wshadow related warningsNRK
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.
2022-01-03fix: reset statusbar after failed keyhandler (#191)N-R-K
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.
2022-01-02remove unused function and typedef (#199)N-R-K
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.
2022-01-02fix: animation slowdown when zoomed in (#200)N-R-K
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
2022-01-01fix: jpeg exif orientation on Imlib2 v1.7.5 (#188)N-R-K
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