Commit Graph

276 Commits

Author SHA1 Message Date
Bert Münnich 5367b75867 (Un)mark thumbnails while holding Button3 down 2018-06-09 13:18:18 +02:00
Bert Münnich 87a1ace8a1 (Un)mark single image through generic function 2018-06-09 13:12:46 +02:00
Bert Münnich a1165df878 Rename variable toggledidx to markidx 2018-06-09 11:57:42 +02:00
Bert Münnich 1e5cc7e382 Fix cg_mark_range after removing images from file list 2018-06-09 11:55:20 +02:00
Bert Münnich cc476be7cc Remove unnecessary special cases in cg_mark_range 2018-06-09 11:52:48 +02:00
Daniel Lublin 6e696ba98c Add mark range function
Sets the marked state of all images ranging from the latest marked/unmarked
image to the current image, to the state of that latest toggled image.
2018-06-09 11:44:47 +02:00
Bert Münnich 09b04d7aef Revise waiting for child processes 2018-02-18 14:51:46 +01:00
Bert Münnich 762420cdf1 Close image-info explicitly 2018-02-18 14:12:41 +01:00
Bert Münnich 4124857137 Skip imlib cache when reloading due to inotify event 2018-02-18 14:12:41 +01:00
Bert Münnich 8017b75de4 Refactoring 2018-01-09 19:37:56 +01:00
Hyleus 6d261b4e7a Fix a potential uninitialized variable 2018-01-09 19:31:36 +01:00
Bert Münnich 8a9e3ea43e Separate bar fields only by spaces 2017-12-07 21:44:59 +01:00
Bert Münnich 30e2356622 Remove obsolete files[].base 2017-12-07 14:16:32 +01:00
Bert Münnich 004fcd5c5b Left bar shows file name as given by user 2017-12-07 14:08:37 +01:00
Squibby eb96c71725 Try to match a fallback font if needed
Fixes #276

Instead of rendering the entire filename at once, Xft will let us do it
character by character. This will allow sxiv to query fontconfig for
a font that can provide any missing codepoints, if needed.

A known issue of this patch is that the "..." dots rendering will not
work properly for very long multibyte filenames. That is because we
cannot easily predict the final width of the rendered filename before
drawing it. I couldn't figure out a clean way to deal with this, so I
ended up just truncating the offending filenames.
2017-12-06 20:39:07 -03:00
Bert Münnich 64b885b6a9 Fix navigating from last to previous image over invalid files 2017-10-26 22:20:39 +02:00
Bert Münnich 2d34c4b9bf Set LC_COLLATE for -r file list sorting
Fixes issue #293.
2017-10-24 21:43:36 +02:00
Bert Münnich 148026007c One header file for type definitions and function declarations 2017-10-16 21:10:35 +02:00
Bert Münnich 8081cbebf3 Improve mouse support
None of the mouse mappings uses a keyboard modifier, making it possible to
access the most basic features by only using the mouse.

Next/previous image with left button depending on cursor position, middle
button for dragging, right button for switching to thumnail mode and wheel for
zooming.

Users can keep the old behaviour by simply not adapting the changes to the
buttons array in config.def.h to their config.h file.
2017-10-06 10:15:43 +02:00
Bert Münnich ee908ca0a1 Simplify cursor reset in image mode
No need to give cursor name. reset_cursor() is now the only place to decide
what cursor to fall back to.
2017-10-05 13:49:11 +02:00
Bert Münnich e310136e02 Mouse drag translates pointer position to image area
This makes mouse panning more direct and faster.
2017-10-04 18:22:43 +02:00
Bert Münnich a20173a42d Detect all file overwrites in autoreload_inotify
mv(1) inside the same filesystem was not detected.

Supporting this case made it necessary to always watch the directory. Turns out
the logic and state keeping between arl_setup() and arl_handle() is easier,
when using different watch descriptors for the file and the directory and not
using a oneshot descriptor for the file.

Requiring an absolute canonical path for arl_setup() simplifies dir and base
name splitting. No need for dirname(3) and basename(3) anymore.
2017-05-17 20:20:39 +02:00
Bert Münnich 3724d3fc17 Revised autoreload interface
Make the header only contain the public interface and nothing from the
implementation. All functions get a handle to their self object, like the img_
and tns_ and win_ functions. All necessary data (file path) is also passed as
an argument, so that no extern redeclarations are needed.

Make arl_setup_dir() private, it's not called outside the module.

Make arl_handle() return true if the file has changed, so that the reloading of
the file can be done by the caller.
2017-05-17 20:07:32 +02:00
Max Voit edb117e3bd Add autoreload support by inotify (and dummy backend nop) 2017-05-17 15:52:40 +02:00
Bert Münnich 1fb3ec576c Properly quit when window gets closed; fixes issue #27 2017-05-17 15:51:47 +02:00
Jakub Wilk c313edc0ad Fix typo 2017-02-15 20:20:41 +01:00
Bert Münnich 5c607ad495 Pass given file names to key-handler instead of real paths
Misbehaving command lines in the key-handler that rewrite the given files and
thus replace symbolic links instead of their targets shall call realpath(1).

Fixes issue #205 and reverts commit 92e3b578.
2017-01-07 14:44:33 +01:00
Bert Münnich ff2ce99bf7 Merge djhejna/floatdelay 2016-12-01 21:18:41 +01:00
Bert Münnich 9a85dd41d8 Ignore button and key events while key-handler is running
Related to issue #253, which originally asked for a non-blocking key-handler.
2016-11-30 20:48:32 +01:00
Don Hejna 27bbaab976 Support for DELAY as a floating point number including less than 1
second while maintaining backward compatibiitiy with integer
arguments.
2016-11-27 20:36:23 -08:00
Paride Legovini 86dc6860f9 Allow opening directories non-recursively 2016-09-28 19:27:48 +02:00
Bert Münnich c280129cef Use Xft for font loading and text drawing 2016-08-06 15:27:58 +02:00
Bert Münnich aabc2bddbd Provide image width and height to image-info script; fixes issue #159 2016-08-06 12:22:47 +02:00
Bert Münnich d3a70a285d Revised error handling
- Functions warn() and die() replaced by GNU-like error(3) function
- Register cleanup() with atexit(3)
- Functions called by cleanup() are marked with CLEANUP and are not allowed to
  call exit(3)
2015-10-28 23:03:37 +01:00
Bert Münnich 851e4288c1 Prefix safe allocation functions with 'e' instead of 's_' 2015-10-28 22:29:01 +01:00
Bert Münnich b096cbd536 Removed unnecessary buffer size constants 2015-10-28 22:23:28 +01:00
Bert Münnich 9a7e97cd89 Use XSI realpath(3) 2015-10-28 21:52:41 +01:00
Bert Münnich 66c3c55759 Use POSIX.1-2008 getline(3) 2015-10-28 21:50:17 +01:00
Bert Münnich e574a6d0dd Removed feature test macro definitions from source files 2015-10-28 21:37:45 +01:00
Bert Münnich e0e96977b3 Removed overcautious parameter checks 2015-10-28 21:01:24 +01:00
Bert Münnich a3838c1984 Always run image-info script after key-handler in image mode; fixes issue #213 2015-08-19 21:29:39 +02:00
Bert Münnich 92e3b57816 Pass real paths to key handler instead of the paths provided by the user
Programs called by the key handler might replace symlinks instead of their
targets.
2015-01-18 11:28:21 +01:00
Bert Münnich 47af0dd7b5 Cache out of view thumbnails in the background 2015-01-04 21:24:43 +01:00
Bert Münnich 9b9294bae6 Use bit-field for boolean flags in fileinfo struct 2015-01-04 21:24:43 +01:00
Bert Münnich 6216bf6c2d Ignore SIGPIPE, caused by key handler exiting before all files got printed, fixes issue #188 2014-12-01 14:03:49 +01:00
Bert Münnich 216ad81b59 Pass file paths to key handler via stdin; fixes issue #187 2014-11-27 22:37:20 +01:00
Bert Münnich 51854c6148 Fixed leakage of pipe descriptors in case of failing fork 2014-11-27 22:25:27 +01:00
Bert Münnich 93e2a757d4 Do not print could-not-open-warnings for files found by directory traversal 2014-10-24 11:14:01 +02:00
Bert Münnich c33f2ad355 Corrected & refactored handling of window bar content...
Old snprintf calls could have overflowed the buffers.
2014-10-01 22:35:22 +02:00
Bert Münnich 8db3191f04 Fixed segfault on image removal with uninitialized thumbnails; fixes issue #177 2014-10-01 20:25:36 +02:00