| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
it's possible for the close() calls to override the errno resulting in
incorrect error message being printed.
call error() immediately to avoid such possibilities.
also refactor a couple conditions to avoid doing multiple checks.
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/321
Reviewed-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
currently, in case of error, r_mkdir will leave the path at a truncated
state.
a7d39b0ab8 is the commit that introduced this change, and in it the
error printing is moved from r_mkdir to the caller, which makes me think
it was probably intentional.
make it so that the function itself prints the error/warning
message and returns the path back to the caller unharmed.
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/322
Reviewed-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
Reviewed-by: TAAPArthur <taaparthur@noreply.codeberg.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- apt-get is slow, takes up ~1m40s just to install deps, fix it by not
using it. instead use alpine linux for codeberg ci, which brings build
time down to 25s.
- And since alpine uses musl, it's probably a good idea to use it on our
ci since it might catch us using any glibc extensions. The github ci
can keep using ubuntu.
- remove duplication of CFLAGS by having it on a separate file instead.
- remove pull_request from github ci since we no longer accept PRs
there.
Closes: https://codeberg.org/nsxiv/nsxiv/issues/307
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/311
Reviewed-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
Reviewed-by: TAAPArthur <taaparthur@noreply.codeberg.org>
|
|
|
|
|
| |
Co-authored-by: NRK <nrk@disroot.org>
Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
|
|
|
|
|
|
|
|
|
| |
The former worked on GitHub, but does not work on Codeberg.
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/309
Reviewed-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
Co-authored-by: Sanjay Pavan <withercubes@protonmail.com>
Co-committed-by: Sanjay Pavan <withercubes@protonmail.com>
|
|
|
|
| |
Reviewed-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
|
| |
|
|
|
|
|
|
|
|
|
| |
instead of dancing around with some `init` parameter, directly give
`win_set_title()` what it needs. `get_win_title()` now also does *just*
what the name says.
this simplifies things quite a bit and the functions now do what their
name implies more closely instead of doing some `init` dance internally.
|
|
|
|
|
|
|
|
|
| |
rather than calling the script unconditionally per redraw, we now have
a `title_dirty` flag and keep track of when any of the relavent
information changes.
Co-authored-by: Arthur Williams <taaparthur@gmail.com>
Partially fixes: https://github.com/nsxiv/nsxiv/issues/258
|
|
|
|
|
|
|
|
| |
just use a static buffer since the size is constant and doesn't change.
as opposed to using malloc, this also sets the buffer's initial memory
region to 0 by default.
also remove BAR_{L,R}_LEN from nsxiv.h, not needed after commit b4268fbf38d1f8433c73999466e116e68c7f81e7
|
|
|
|
| |
unlikely for utf8.h to change, other than syncing with upstream, but
doesn't hurt tracking it either ways.
|
|
|
|
| |
ref: 971f5d669490696c11f5c4ede1fee558e05ae4fc
|
|
|
|
|
| |
See https://github.com/nsxiv/nsxiv/issues/262#issuecomment-1111216349
for related discussion.
|
|
|
|
| |
Closes: https://github.com/nsxiv/nsxiv/issues/262
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Closes: https://github.com/nsxiv/nsxiv/issues/88
Closes: https://github.com/nsxiv/nsxiv/pull/253
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
also change the condition inside img_frame_animate() to check for
positive value rather than comparing against 0.
|
|
|
| |
Co-authored-by: NRK <nrk@disroot.org>
|
|
|
|
|
| |
...simply print an error msg and try (slower) fallback.
also adds a useful comment explaining why we're doing manual blending.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
| |
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 and link the issue
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* put TOP_STATUSBAR under the HAVE_LIBFONTS guard
* change get_win_title param to take unsigned char ptr
* init UTF8_STRING like other atoms
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Closes: https://github.com/nsxiv/nsxiv/issues/230
Co-authored-by: mamg22 <45301823+mamg22@users.noreply.github.com>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
this removes the cli flag `-T` as well as related config.h options.
Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
|
| |
|
|
|
|
|
|
|
|
|
| |
* [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.
|
| |
|
| |
|
| |
|
|
|
| |
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.
|