Commit Graph

235 Commits

Author SHA1 Message Date
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
Bert Münnich
ddd028eb3e Unified file count variable for image & thumbnail mode 2014-09-30 21:54:17 +02:00
Bert Münnich
b2dbd2fed3 Changed image mark in thumbnail view to small rectangle 2014-09-27 22:05:21 +02:00
Bert Münnich
5fce009b73 Refactored main loop; properly fixes startup issue 2014-09-26 22:47:28 +02:00
Bert Münnich
c1e084357c Fixed startup in thumbnail mode with floating window 2014-09-26 20:45:15 +02:00
Bert Münnich
eaa269b6cb Revised thumbnail loading...
- Only load the thumbnails that are currently visible in the window
- Unload thumbnails that are leaving the visible area
- Much less memory needed, but scrolling is now slower
- This also unintentionally fixes issue #86
2014-09-26 10:31:03 +02:00
Bert Münnich
52e56c8924 Fixed segfault caused by image removal in thumbnail mode 2014-09-11 22:22:51 +02:00
Bert Münnich
2fbc21a205 Simplified img_frame_animate 2014-09-01 20:41:33 +02:00
Bert Münnich
f478385d59 Corrected i_alternate, fixes issue #171 2014-08-29 20:16:24 +02:00
Markus Elfring
0f6cb93a09 Bug #165: Deletion of unnecessary null pointer checks
The function "free" performs input parameter validation.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html

It is therefore not needed to check a passed pointer before this function call.
A corresponding update suggestion was generated by the software "Coccinelle"
from the following semantic patch approach.
http://coccinelle.lip6.fr/

@Remove_unnecessary_pointer_checks1@
expression x;
@@
-if (x != \(0 \| NULL\))
    free(x);

@Remove_unnecessary_pointer_checks2@
expression x;
@@
-if (x != \(0 \| NULL\)) {
    free(x);
    x = \(0 \| NULL\);
-}

@Remove_unnecessary_pointer_checks3@
expression a, b;
@@
-if (a != \(0 \| NULL\) && b != \(0 \| NULL\))
+if (a)
    free(b);

@Remove_unnecessary_pointer_checks4@
expression a, b;
@@
-if (a != \(0 \| NULL\) && b != \(0 \| NULL\)) {
+if (a) {
    free(b);
    b = \(0 \| NULL\);
 }

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2014-08-22 19:24:08 +02:00
Bert Münnich
fe3a1e326f Further simplified thumbnail marks 2014-08-18 12:45:32 +02:00
Bert Münnich
50652f63d9 Full redraw when removing files during thumbnail reloading; fixes issue #164 2014-08-17 16:31:16 +02:00
Bert Münnich
e49d38d6f9 Fixed wrong thumbnail-to-file mappings caused by file deletions 2014-08-16 22:21:51 +02:00
Bert Münnich
e267dc7793 Pass marked files to external key handler in thumbnail mode; fixes issue #135 2014-08-16 21:49:46 +02:00
Bert Münnich
284be74927 Count number of marked files 2014-08-16 21:49:46 +02:00
Bert Münnich
5b01c15176 Unified file index variable for image & thumbnail mode 2014-08-16 21:49:45 +02:00
Bert Münnich
61f61cae5f Generalized thumbnail loading, allows easier reloading of thumbnails later on 2014-08-16 21:48:52 +02:00
Bert Münnich
bb6721549b Overhauled window drawing, yet again; fixes issue #155
- Buffer for window content is bigger than the window, minimizes artifacts
  when window is resized
- Back to using XSetWindowBackgroundPixmap() instead of XCopyArea(),
  no need to handle exposure events; X server can show gray background directly
  after resize event before sxiv redraws the window contents
2014-07-28 20:36:32 +02:00
Bert Münnich
9c92de8584 Added support for multiple commands per key/button mapping; elegant fix for issue #150 2014-07-23 23:41:23 +02:00
Bert Münnich
06164c29b7 Revised command structure and key and mouse button mappings 2014-07-23 21:50:31 +02:00
Bert Münnich
5d0679b855 Show key handler status in bar while it is running 2014-06-15 14:15:48 +02:00
Miroslav Koskar
4cbc7346ff Timeout initial redraw 2014-05-24 10:07:14 +02:00
Bert Münnich
6d7acac3d1 Use real path of all files internally, requires _XOPEN_SOURCE>=500, fixes issue #137 2014-03-17 20:01:53 +01:00
Bert Münnich
653a6ee83b Warn once when external key combo is used and key-handler not installed 2014-02-18 21:10:44 +01:00
Bert Münnich
e2fa49ecfe Unified X atom initialization 2014-02-02 14:36:10 +01:00
Bert Münnich
f6510b0a04 Merged pull request #129 2014-01-31 13:21:23 +01:00
András Mohari
54d7b7f20f Use a prefix key to execute the key handler
The default prefix key is C-x, and can be changed in config.def.h. The
first key pressed after the prefix key will be passed the external key
handler, unless the key is Escape, which is used to cancel the prefix.
2014-01-31 14:17:52 +01:00
Bert Münnich
ed69b483ed Double click on thumbnail to open image 2014-01-11 22:52:37 +01:00
Bert Münnich
304fd382db Adhere to XDG Base Directory Specification; fixes issue #124 2014-01-11 22:47:41 +01:00
Bert Münnich
48954a163a Allow config.h to use multimedia keys (XF86_XK_*); fixes issue #123 2014-01-09 20:38:46 +01:00
Bert Münnich
e82397db15 Fixed handling of overloaded key mappings
Issue described here:
https://bbs.archlinux.org/viewtopic.php?pid=1117294#p1117294
2014-01-08 22:58:34 +01:00
Bert Münnich
9632dd88b9 Fixup for 9574150 2014-01-08 21:14:01 +01:00
Bert Münnich
9574150f2d Check file modification time after key handler 2014-01-08 20:31:50 +01:00
Bert Münnich
cd34aa2a6b Fixed slideshow delay corruption after GIF animation 2014-01-08 20:31:07 +01:00
Bert Münnich
6a0fa2507c Slideshow mode is back, in a simplified version 2014-01-04 19:07:15 +01:00
Bert Münnich
f2e0c492bd Moved external shell commands into exec/key-handler script
Gets called on all unset key mappings. Arguments are: key combo and
current file. Thanks to Francesco Orsenigo (xarvh) for the idea.
2014-01-02 23:19:31 +01:00
Bert Münnich
b2eae528ed Proper support for Ctrl/Shift/Alt modifiers in key & mouse mappings 2014-01-02 14:13:08 +01:00
Bastien Dejean
4780ec5463 Close info file descriptor after reading 2013-11-17 12:54:55 +01:00
Bert Münnich
cc479ca5ac Fixed segfault when removing first image from file list, fixes issue #112 2013-11-16 20:19:55 +01:00
Bert Münnich
50f9ad14de Refactored remote changes 2013-11-14 17:06:20 +01:00
Bert Münnich
2737fc8b81 Merge remote-tracking branch 'ariand/gamma' 2013-11-14 14:47:36 +01:00
Bert Münnich
38bc23405d Highlight edges of marked images in thumbnail mode 2013-11-14 14:37:08 +01:00