build: autogen.sh cleanup

Use "set -e" to force exit on failure and convert $* to "$@".

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Update NEWS entry

Add all important changes since kmscon-4.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
test_vt: fix compilation with new allocation API

We changed the uterm API so we need to fix this test again.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Release kmscon-5

This is a stable release for kmscon. It includes mainly bugfixes and
cleanups. The TSM library was created out of the internal VTE layers and
mostly code-cleanups took place.
Happy testing!

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
log/llog: add gcc format checks

Add gcc attributes so the printf formats are correctly checked. This
causes a lot of warnings which will be fixed in the following commits.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: unicode: do not encode invalid UTF8

We must under all conditions avoid encoding invalid UTF8. Otherwise, we
would rely on other applications to do error-recovery.
Unfortunately, this is no syntactical change but a semnatical fix as the
Unicode standard defines several codepoints which are invalid or which
must never be used in UTF8.
See the Unicode standard if you're interested in these codepoint ranges.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Fix printf() specified bugs all over the code

When enabling the printf() logic for the logging subsystem, several
warnings were produced about missing or wrong specifiers. This fixes all
those occurrences.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
shl: add shl_strtou() helper

The standard C/POSIX helpers are really ugly to use. This small helper
returns 0 on success, otherwise an error.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
kmscon: allow paths with --vt=<xy>

The getty variants out there (including agetty) require an relative path
to the /dev directory as argument. This is really odd but we want to be
backwards-compatible to them so we allow this, too.

--vt now accepts:
  * A positive number which is internally converted into /dev/ttyXY
  * A string that does not start with '/' or '.' which is interpreted
    relative to /dev as /dev/%s
  * Everything else is interpreted as path

This option still selects only the TTY on seat0. On all other seats we do
not use controlling TTYs.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: screen: fix buffer-overflow when resizing and scrolling

We call screen_scroll_up() under special conditions when resizing. We
require it to allocate the lines with the new width even though we didn't
set it yet. Therefore, we need to set the width before calling it and then
adjust the height.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: toolkit: allow widgets to control new size

This changes the prepare-resize logic to allow widgets full control of the
new size. The initial size starts at 0 and each widget can increase it.
The last widget should be a catch-all that uses all size that is available
and computes a good new size based on the requirements that the previous
widgets provided.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: terminal: snap to console-size on resize

Instead of resizing linearly, we now always resize only to the next
possible console size.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
tsm: screen: fix moving cursor when scrolling during resize

If we scroll the screen during resize to keep the screen-content constant,
we should also move the cursor position. Otherwise, the application has an
inconsistent state.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: toolkit: fix forcing redraw during unneeded resize-round

If we resize the buffers, we skip redrawing as resizing implies this.
However, if the resize-handler skips resizing because the size didn't
change, it also skips redrawing.
Hence, we add a new flag to force redrawing even if the resize-operation
is skipped. This fixes a bug where we didn't redraw during stalling resize
operations by the user.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: toolkit: fix scheduling resize on widget-creation

Instead of scheduling for redraw, we have to schedule for resize as the
new widget might want to change the size constraints.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: terminal: do not clear terminal background

We snap to terminal borders now so there is no need to clear the
background as we paint it during redraw, anyway.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: terminal: remove dead non-snap code

This code isn't needed at all. It doesn't make sense to disable snapping
so remove this dead code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
wlt: toolkit: implement proper minimal sizes

A widget may have different constraints regarding minimal sizes and the
size it occupies. Therefore, we need to pass a hint with the minimal size
together with the prepare-resize round.

The catch-all user can then decide to resize the catch-all field until it
is big enough to hold all minimal-sizes.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Make xkbcommon mandatory

We really need xkbcommon. There is so much stuff (including parsing of
keyboard shortcuts in conf.c) that depends on it. Therefore, we make it
mandatory now which allows us to use xkbcommon functions all over the
place.

Note that xkbcommon itself has no runtime dependencies so it is a small
self-contained library. The only reason I didn't do this ealier is that
xkbcommon has not seen a public release, yet. However, that should be done
in the near future.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Move grab-parsing into conf.c

We really need to clean this up and allow parsing of grabs in conf.c
again. xkbcommon is now mandatory so we can fix all the input layers to
use it.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>