Commit Graph

114 Commits (f7fc6637f35e43adffb2e1a20ec511dfb9ca7bd1)

Author SHA1 Message Date
Bert Münnich f7fc6637f3 Support X resource entries with Sxiv class name 5 years ago
Bert Münnich e4fb084f26 Fix code style of merged code 5 years ago
noamcore 4853e17b83 Add Xresources capability 5 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
Bert Münnich aac28cce7a Fixed non-ASCII characters in window bar, issue #88 11 years ago
Bert Münnich 30802cec0f Spawn info script & update bar contents only when needed 11 years ago
Bert Münnich f3298400e6 Spawn and read from info script without blocking 11 years ago
Bert Münnich c6bfac1566 Merge branch 'sizehints', fixed issue #78 12 years ago
Bert Münnich 1e2ddc44d8 No checks on window size, use whatever the user has specified 12 years ago
Bert Münnich a527025314 Correctly set window height after i_fit_to_img() 12 years ago
Bert Münnich cef8d51153 Refined US{Position,Size} & WinGravity handling 12 years ago
Bert Münnich bf41012493 Merge remote-tracking branch '4z3/set-user-specified-sizehints' into sizehints
Conflicts:
	window.c
12 years ago
Bert Münnich f7301cf4f9 Correctly updated window pixmap after i_fit_to_img() 12 years ago
Bert Münnich 08ae25da22 Refactored function definitions to use dangling brace 12 years ago
Bert Münnich 6d3bbc6d5e Updated/corrected license header 12 years ago
tv 3f25b907bd When using -g hint the WM that we've got user specified geometry
Without this some window managers (e.g. fvwm) will ignore the initial
window position and place it according to it's own rules.
12 years ago
muennich d6a475e4b1 Simplified status bar, filled by user script 12 years ago
Bert Münnich 69a6df2762 Merge branch 'winname' 12 years ago
Bert Münnich 22a8b66571 Fixed BadDrawable errors caused by invalid window pixmap 12 years ago
Bert Münnich 4a5d5d26aa Overhauled window drawing
- Draw onto pixmap as before, but use the same size for the pixmap as
  for the window, allocate new pixmap after configure requests
- Use XCopyArea() instead of XSetWindowBackgroundPixmap(), which now
  requires handling of Expose events
12 years ago
Bert Münnich 6f9b4f5b2e New option: -N, set X window resource name 12 years ago