Commit Graph

131 Commits (24e70a99e38ba71ac26e8476c5f2d4352c6ff548)

Author SHA1 Message Date
NRK 25a5a54010 add .mark.foreground to Xresources
since we're already allowing both window and bar colors to be
customizable, it doesn't make sense to not allow so for mark color.
3 years ago
Sam Whitehead 0d8dcfd521
Fix font memory leak. (#57)
* Fix font memory leak.

This memory leak has always been present in sxiv.

The font opened on window.c:58 was never closed, so I closed it, fixing a 2kB memory leak.

* document changes

Co-authored-by: NRK <nrk@disroot.org>
3 years ago
N-R-K 0b20783164 change .font to .bar.font for consistency (#48) 3 years ago
Berke Kocaoğlu 7cce7ea857 Rename, Update Docs and Prepare for Release (#9)
Co-authored-by: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com>
Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
Co-authored-by: NRK <nrk@disroot.org>
Co-authored-by: Arthur Williams <taaparthur@gmail.com>
Co-authored-by: eylles <ed.ylles1997@gmail.com>
3 years ago
qsmodo 156a53780c set title based on prefix and suffix (#23)
Co-authored-by: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com>
Co-authored-by: NRK <nrk@disroot.org>
Co-authored-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
3 years ago
Guilherme Freire f7557c55b5 Custom bar colors (#10)
* set bar and text colors independently

* change xresources to Program.class.resource

* rename color variables to win/bar_bg/fg

* change default bar colors to match window colors
3 years ago
eylles d8ec6f91a9 Set the _NET_WM_PID and WM_CLIENT_MACHINE X properties (#13)
Set the _NET_WM_PID and WM_CLIENT_MACHINE X properties

Co-authored-by: Leon Kowarschick <lkowarschick@gmail.com>
Co-authored-by: Kian Kasad <kian@kasad.com>
Co-authored-by: NRK <nrk@disroot.org>
3 years ago
Berke Kocaoğlu c7ca547b55 Fix in tabbed with alpha patch (#3)
* Fix in tabbed with alpha patch

Co-authored-by: Jared Forrest <jared_forrest@mailbox.org>
3 years ago
Arthur Williams ba0d87fadf Added ICCCM WM_HINTS
When the window is mapped, some ICCCM WM_HINTS are set.
The input field is set to true and state is set to NormalState.

To quote the spec, "The input field is used to communicate to the window
manager the input focus model used by the client" and "[c]lients with
the Passive and Locally Active models should set the input flag to
True". sxiv falls under the Passive Input model, since it expects keyboard
input, but only listens for key events on its single, top-level window instead
of subordinate windows (Locally Active) or the root window (Globally Active).

From the end users prospective, all EWMH/ICCCM compliant WMs (especially
the minimalistic ones) will allow the user to focus sxiv, which will
allow sxiv to receive key events. If the input field is not set, WMs are
allowed to assume that sxiv doesn't require focus.
3 years ago
Bert Münnich d9e60cb4c0 Fix memory leak in win_res()
Fixes issue #372.
5 years ago
Bert Münnich 07300da7df Do not keep track of fullscreen state
There is no more need for this after the removal of the special color handling
for fullscreen mode in commit 2886876.
5 years ago
Bert Münnich 28868767e6 Use normal win colors in fullscreen mode
Fixes issues #361 and #367
5 years ago
Bert Münnich 7bde7e618a Change colors and font only via X resources 5 years ago
vxid 4407a3de54 Add Xresources font support 5 years ago
Foldex 278f0ce94e Match fallback font FC_SIZE to original font 5 years ago
Bert Münnich 919ada1123 Align compile-time color options with X resource colors
Two colors are more than enough!
6 years ago
Bert Münnich 9d244da512 Simplify X resource retrieval
Also makes the color names in config.def.h constant again.
6 years ago
Bert Münnich f7fc6637f3 Support X resource entries with Sxiv class name 6 years ago
Bert Münnich e4fb084f26 Fix code style of merged code 6 years ago
noamcore 4853e17b83 Add Xresources capability 6 years ago
Bert Münnich 0bf3265430 Set window title only once at startup
Putting image info in the title predates the info bar; it no longer seems
necessary.

Fixes issue #318.
6 years ago
Bert Münnich b78aaee9d7 Initialize window bar buffers to empty string
Fixes issue #308.
6 years ago
Bert Münnich e63843d369 Simplify drawing of bar text
Non-fitting text is truncated by simply cutting it off.

win_textwidth() has been replaced by a simple macro wrapper around
win_draw_text() with a maximum width of zero, which results in a dry-run that
still calculates the number of pixels used by the text, much like snprintf(3)
with a buffer length of zero.
7 years ago
Bert Münnich 3c7d6f3528 Replace utf8codepoint with Chris Wellons' utf8_decode
Code under a different license should be kept in a separate file. This
implemention is a single header file with ~65 lines, so it better fits this
requirement.
7 years ago
Bert Münnich 69b2d3cafd win_textwidth is no longer needed outside window.c 7 years ago
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.
7 years ago
Bert Münnich 148026007c One header file for type definitions and function declarations 7 years ago
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.
7 years ago
Bert Münnich d81442f55d Own win method for mouse cursor location 7 years ago
Bert Münnich b8fd923e74 Simplify cursor handling 7 years ago
Bert Münnich e310136e02 Mouse drag translates pointer position to image area
This makes mouse panning more direct and faster.
7 years ago
Bert Münnich c772d3c3f3 Use -e for X window embedding 8 years ago
shuall 0b758e08f2 added support for XEMBED into other windows (ie tabbed) with -w 8 years ago
Bert Münnich c280129cef Use Xft for font loading and text drawing 8 years ago
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)
9 years ago
Bert Münnich 851e4288c1 Prefix safe allocation functions with 'e' instead of 's_' 9 years ago
Bert Münnich e574a6d0dd Removed feature test macro definitions from source files 9 years ago
Bert Münnich e0e96977b3 Removed overcautious parameter checks 9 years ago
Bert Münnich c33f2ad355 Corrected & refactored handling of window bar content...
Old snprintf calls could have overflowed the buffers.
10 years ago
Bert Münnich d0ba2c585d Simplified thumbnail selection and marks 10 years ago
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
10 years ago
Bert Münnich 5d0679b855 Show key handler status in bar while it is running 10 years ago
Bert Münnich 0b83386bff Do not center window on screen, workaround for issue #9 10 years ago
Bert Münnich e685859a30 Use a checkerboard background for alpha layer; fixes issue #138 10 years ago
Bert Münnich 72f1b1ca6f Removed command line option -F 11 years ago
Bert Münnich 524d9de877 Removed fit-win-to-img command 11 years ago
Bert Münnich 2e758f78c1 Check if window manager supports fullscreen; related to issue #128 11 years ago
Bert Münnich e2fa49ecfe Unified X atom initialization 11 years ago
Bert Münnich 135c4f9263 Added window icons; fixes issue #125 11 years ago
Bert Münnich 593da23cf3 Use bgcol as window background pixel; fixed issue #89 11 years ago