David Herrmann [Mon, 8 Oct 2012 16:11:17 +0000 (18:11 +0200)]
uterm: input: remove plain backend
We made xkbcommon mandatory some time ago and there is no reason to keep
this plain backend around anymore. It isn't tested at all and provides no
real advantage over xkb.
Even for debugging it is easier to use XKB.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 8 Oct 2012 15:52:00 +0000 (17:52 +0200)]
uterm: input: add flag to input-events marking them as handled
If multiple handlers are called on the same input-event, we must notify
handlers whether the event was already handled by a previous callback. We
push this decision to the handlers by allowing them to modify the
"handled" flag for an input event.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 8 Oct 2012 15:36:36 +0000 (17:36 +0200)]
build: inverse get_pitch/stride logic
We should use get_stride() if this check fails as this is the new
function. We use this check only for backwards-compatibility reasons but
should not require it to pass for new builds.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Detlef Riekenberg [Sun, 7 Oct 2012 20:09:29 +0000 (22:09 +0200)]
build: handle AM_PROG_AR not present in autoconf 1.11
AM_PROG_AR is a new feature since autoconf 1.12.
autogen.sh failed on Ubuntu 11.10 without this patch with:
configure.ac:30: error: possibly undefined macro: AM_PROG_AR
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
AM_PROG_AR is required only for autoconf-1.12 so we can just skip it if
using an autoconf version that does not include it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Detlef Riekenberg [Sun, 7 Oct 2012 21:55:42 +0000 (23:55 +0200)]
genunifont: avoid format-security compiler warning
Current warning without the patch:
src/genunifont.c: In function 'print_data_row':
src/genunifont.c:85:3: warning: format not a string literal and no format arguments [-Wformat-security]
src/genunifont.c:88:3: warning: format not a string literal and no format arguments [-Wformat-security]
We use fputs() to avoid any format-string parsing and instead directly
write the string into the file.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 8 Oct 2012 15:26:48 +0000 (17:26 +0200)]
shl: hook: link elements in reverse order
When adding new elements, we should add them at the tail, not at the
front. And when removing elements, we should remove them from the tail,
too.
We also convert the whole stuff to the shl_dlist API so we do not have to
manage the linked-list ourself.
Note that this silently breaks the idea of having multiple listeners with
the same function+data in the hook. This is because removing the listener
may now change order of two identical entries, as we don't know which of
them to remove. That means, when adding two identical entries, you cannot
rely on them to retain their position in regard to each other.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 8 Oct 2012 15:15:42 +0000 (17:15 +0200)]
shl: dlist: add macros for iterating lists in reverse order
These macros do the same as the already available macros but in reversed
order. This is useful when list-order is important.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 8 Oct 2012 14:57:02 +0000 (16:57 +0200)]
uterm: vt: handle VT switches without kernel input
We now set KBMODE to K_OFF so we are totally independent of kernel input.
Instead, we handle VT switches with uterm-input now. This also allows us
to have full control of which keyboard input is parsed by us and which is
parsed by the kernel.
We still need to set a flag for uterm-input events that they were handled
to avoid having the TSM layer handle these events again.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 8 Oct 2012 14:40:26 +0000 (16:40 +0200)]
uterm: vt: register input-cb for all VTs
This modifies the generic VT layer to register input-cbs for all VT types
and dispatch the event to the correct handler.
This will allow us to handle VT-switches for real VTs ourself instead of
relying on VT input.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 8 Oct 2012 14:22:51 +0000 (16:22 +0200)]
uterm: vt: remove fake-VT SIGUSR1/2 (de)activation
This whole concept was broken from the beginning. With hotkey based
activation we have a much better debugging tool. This is still very
fragile, but better than nothing. And we are doing pretty well in error
recovery during hijacked VT switches so that's not as problematic as one
might think.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 8 Oct 2012 14:10:53 +0000 (16:10 +0200)]
uterm: vt: add a lot more verbose error messages
This adds a lot more verbose error messages to the whole real-VT handling
so we can debug this fragile system way better than before.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 15:54:58 +0000 (17:54 +0200)]
terminal: pass seat-name to PTY
This passes the current seat-name from kmscon_app through ui and terminal
into kmscon_pty.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 15:22:26 +0000 (17:22 +0200)]
pty: set XDG_SEAT for childs
Recent systemd was updated to parse XDG_SEAT in PAM so we can assign
logins to the correct seat.
This patch allows pty users to specify what seat they run on so the PTY
can correctly set the seat variable. If no seat is specified, then
XDG_SEAT is not set so we still allow non-seated logins.
Note that if kmscon_pty is run with XDG_SEAT set, this will also be set
for the client PTY so unset it if you don't want the environment to be
copied to the client (like any environment variable).
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Dave Reisner [Sat, 6 Oct 2012 22:28:18 +0000 (18:28 -0400)]
build: sanitize environment for AC_CHECK_LIB
Compiling with -Wl,--as-needed can cause the check for
gbm_bo_get_stride() to wrongly fail. Sanitize the environment further,
assuring that unneeded compiler flags are not involved in the conftest.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 13:31:53 +0000 (15:31 +0200)]
wlt: add command-line options for xkb-repeat settings
You can now use --xkb-repeat-rate/delay to configure the Xkb key-repeat
settings instead of using the default 25/250.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 13:21:46 +0000 (15:21 +0200)]
wlt: terminal: implement copy/paste support
This implements copy/paste support for the terminal widgets via the
recently introduced helpers.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 13:08:03 +0000 (15:08 +0200)]
wlt: toolkit: add helpers to create/manage selections
Two new helpers which are needed to implement copy-support. They create
data-sources and set the current selection-source. This allows widgets to
copy data for others to paste.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 13:05:15 +0000 (15:05 +0200)]
tsm: screen: implement selection extraction
This adds a new helper that returns the UTF8 encoded data of the selected
parts in the tsm-screen object.
There is still much to do and it isn't a nice solution. However, it's a
proof-of-concept and works for now so we can just keep it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 11:12:03 +0000 (13:12 +0200)]
wlt: toolkit: add input_offer support
Input offers are used to implement pasting data from other applications.
This adds the infrastructure to operate on data-managers and allows
applications to retrieve the currently active selection-data via a
file-descriptor.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 11:11:30 +0000 (13:11 +0200)]
wlt: toolkit: add wlt_window_get_display() helper
This is useful to get access to input devices from the display when only a
widget or window is available.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sun, 7 Oct 2012 11:09:27 +0000 (13:09 +0200)]
eloop: fix leaving dead FDs pollable
We used to remove dead FDs from the epoll-loop, but we should do this only
if they are no longer readable. An FD might be dead/HUP but still
readable.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 12:04:54 +0000 (14:04 +0200)]
wlt: terminal: clear selection on short click
If the mouse is not moved during a mouse-click, then we clear the current
selection. This can be increased to allow a short range of few pixels of
mouse-movement if required.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 11:55:29 +0000 (13:55 +0200)]
tsm: screen: fix including final character in selection
We need to draw the final character of a selection with inversed
background, too. This is a bit tricky as the selection may be inversed
itself. Therefore, we just keep a flag that tells us whether the previous
character was selected and just draw the new character also selected.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 11:47:15 +0000 (13:47 +0200)]
wlt: toolkit: fix wlt_rect_contains() calculations
We need to check whether the point is left/atop of the rectangle, too.
Otherwise, the function just doesn't make sense.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 11:41:52 +0000 (13:41 +0200)]
wlt: terminal: implement mouse-selection
This hooks up the mouse-selection with the tsm-screen selection support.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 11:28:13 +0000 (13:28 +0200)]
tsm: screen: implement selection support
This implements UI selection for the console buffer. This selection is not
to be confused with PTY application selection provided by the
mouse-protocol via VT200 protocol.
Instead, this selection allows UIs to tell the TSM layer to select a
special part of the screen. Moreover, it allows selections to go into the
scrollback-buffer and to be bigger than a single screen. The UI can even
implement scrolling during selection to allow arbitrarily big selections.
There might still be some special cases where we need to fix selection.
However, it already works pretty well.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 11:24:58 +0000 (13:24 +0200)]
tsm: screen: introduce scrollback-buffer line IDs
If we have pointers somewhere into the scrollback-buffer, there is not
easy way to see which of two lines comes first. Therefore, we introduce
scrollback buffer IDs. These are unique and every line gets one assigned
when it is linked into the sb-buffer. These IDs guarantee that front lines
have lower IDs than bottom lines.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 11:22:43 +0000 (13:22 +0200)]
tsm: screen: remove unused get_from_scrollback()
This function is not used and I do not intend to use it anywhere soon.
Therefore, remove it so it doesn't generate sparse warnings.
The only reason why I kept is was that we might want to retrieve these
when increasing window size. However, this will not be implemented in the
near future as we need to keep a buffer-fill state for it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 11:21:12 +0000 (13:21 +0200)]
wlt: theme: fix bug in pointer-location computation
We need to subtract the allocation because we get absolute pointer data as
input. This doesn't matter for the theme as long as it is the root widget,
but this might change when we introduce shadows.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 5 Oct 2012 11:20:24 +0000 (13:20 +0200)]
build: print (GEN) during genshader/unifont creation
Use the automake silent-rules feature to suppress unused messages.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 2 Oct 2012 11:46:47 +0000 (13:46 +0200)]
wlt: add --grab-zoom-in/out command-line options
These options allow to modify the hard-coded shortcuts for font zooming.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 2 Oct 2012 11:30:02 +0000 (13:30 +0200)]
wlt: terminal: zoom font on ctrl+plus/minus
We now create the next bigger/smaller font on ctrl+plus/minus keyboard
input. This is currently done by integer-steps but may be changed to
smaller steps. You can currently use the DPI values to control the
step-size, even though this is an ugly hack.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 2 Oct 2012 11:24:18 +0000 (13:24 +0200)]
wlt: toolkit: allow zero values as new size
If zero is passed as new size, we now simply use the current size. This
allows widgets to schedule a resize round without having to specify the
current size explicitely.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 2 Oct 2012 11:02:44 +0000 (13:02 +0200)]
terminal: perform hard-reset on exit
Before starting a pty on a terminal, we now perform a hard-reset to avoid
any left-overs from the previous pty.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Zbigniew Jędrzejewski-Szmek [Tue, 2 Oct 2012 09:45:41 +0000 (11:45 +0200)]
build: fix linking for kmscon_font_*
We need to link text-font to kmscon-core as we use it heavily in the
terminal layers.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Zbigniew Jędrzejewski-Szmek [Tue, 2 Oct 2012 09:44:55 +0000 (11:44 +0200)]
build: actually make use of pkg-config info about xbkcommon
We now use xkbcommon in lots of places so add the build-flags to all
libraries and applications that use it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 15:45:46 +0000 (17:45 +0200)]
wlt: toolkit: make fullscreen overwrite maximized mode
If *_toggle_maximized() is called while in fullscreen, we still change our
internal state, but we do not modify the application behavior in regard to
wl_shell_surface state. Instead, we stay fullscreen until it is
deactivated again.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 15:38:07 +0000 (17:38 +0200)]
wlt: theme: do not draw decorations in fullscreen mode
When fullscreen mode is active, we should not draw any decorations.
Instead just skip every callback in the theme layer.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 15:21:27 +0000 (17:21 +0200)]
wlt: terminal: do not snap to grid-size on fullscreen-mode
If we are in fullscreen mode, we should allocate all space that is
available (like in maximized mode) instead of snapping to the next
grid-size.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 15:09:14 +0000 (17:09 +0200)]
wlt: toggle fullscreen on F11
This adds a --grab-fullscreen parameter which configures the key that
toggles fullscreen. This is handled in the theme widget as we consider it
the main window-handler.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 15:00:58 +0000 (17:00 +0200)]
wlt: toolkit: notify keyboard-cbs whether a key was handled
All keyboard-cbs have to return whether they handled a key now.
Furthermore, they get as parameter a flag that notifies them whether a
previous handled already handled the key.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 14:55:49 +0000 (16:55 +0200)]
wlt: toolkit: add fullscreen helpers
Add helper to make a window fullscreen. Also forward the flags to all
resize and redraw handlers so widgets can changed behavior while being
fullscreen.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 14:42:08 +0000 (16:42 +0200)]
wlt: terminal: reset scrollback-position on user-input
On user-input we now reset the scrollback-position so it is set to the
actualy screen again. This is normal behavior of most other terminals and
I see no reason not to do this.
If anybody requests it, we can make it easily optional via a command-line
setting.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 13:02:54 +0000 (15:02 +0200)]
wlt: terminal: draw background-margin when maximized
When maximized, we might have a small margin as we do not snap to
grid-sizes. Therefore, we need to correctly draw the background color for
these margins.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 12:26:04 +0000 (14:26 +0200)]
wlt: terminal: use whole size when maximized
We shouldn't snap to console-grid sizes when maximized. This produces
weird artifacts that are not expected by the users.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 12:14:28 +0000 (14:14 +0200)]
wlt: toolkit: pass flags to resize and redraw callbacks
If a window is maximized, fullscreen or should be drawn without
decorations, then the widgets must be notified about it. Hence, this adds
a flags argument to resize and redraw callbacks.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 12:07:23 +0000 (14:07 +0200)]
test_input: fix compilation with changed input API
We dropped unused modifiers so we have to fix test_input not to print them
out.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 11:56:46 +0000 (13:56 +0200)]
kmscon: make --switchvt work again
The new uterm-vt helpers allow us to activate or deactivate all VTs during
startup and shutdown. Use them to make --switchvt work again.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 11:56:06 +0000 (13:56 +0200)]
uterm: vt: add helpers to (de)activate all VTs at once
Two new helpers to activate or deactivate all VTs at once. They return the
total count of VT switches that are pending or an error code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 11:54:08 +0000 (13:54 +0200)]
uterm: vt: fix skipping real_activate() when being inactive
This is probably a copy&paste error from real_deactivate(). We should skip
real_activate() if we are _active_, not if we are _inactive_.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 11:29:49 +0000 (13:29 +0200)]
uterm: vt: do not automatically activate fake-VTs
We used to activate fake-VTs directly after they were allocated. This is
not needed anymore as we can control them directly now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 11:26:51 +0000 (13:26 +0200)]
uterm: vt: add fake_activate() and fake_deactivate() hooks
This makes uterm_vt_(de)activate() forward the request to fake-VTs, too.
The fake-VTs directly forward it to the callbacks.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 11:24:41 +0000 (13:24 +0200)]
uterm: vt: return error in real_deactivate() if VT is dead
We used to return 0 if we don't know the VT id in real_deactivate().
However, the VT id is nowadays always known so we must return an error
instead.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 11:23:38 +0000 (13:23 +0200)]
uterm: vt: make real_activate() behave like real_deactivate()
real_activate() has alsmost the same semantics as real_deactivate() so we
should also return -EINPROGRESS when we scheduled the VT switch. This
isn't used by kmscon currently, but may be used by other uterm users.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 10:46:09 +0000 (12:46 +0200)]
tsm: screen: fix out-of-bounds access when drawing sb
When drawing scroll-back buffer, we cannot guarantee that the lines are as
long as the current screen. Therefore, check that we aren't accessing out
of bounds and draw empty glyphs instead.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 10:41:06 +0000 (12:41 +0200)]
wlt: add --term, --login, --palette and --sb-size
These terminal options are simply copied from kmscon and behave the same
way.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 10:24:03 +0000 (12:24 +0200)]
wlt: add scrollback-buffer grabs
This copies the grabs from kmscon over to wlterm. It is now possible to
scroll up and down in the scrollback-buffer if you manually increase the
buffer size.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 10:23:15 +0000 (12:23 +0200)]
build: add shl_misc to all its users
Even though it's just a header, we want to be safe so add it to all users.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 10:22:34 +0000 (12:22 +0200)]
uterm: input: plain: remove unused array
We do not parse num-lock anymore, so remove the unused array. GCC didn't
warn about it, which is weird, but it's definitely not needed, anymore.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 10:21:10 +0000 (12:21 +0200)]
shl: misc: add SHL_HAS_BITS() helper
This helper checks whether a bitmask has all the given bits set.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 1 Oct 2012 09:23:21 +0000 (11:23 +0200)]
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>
David Herrmann [Mon, 1 Oct 2012 08:10:50 +0000 (10:10 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 22:16:57 +0000 (00:16 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 21:51:34 +0000 (23:51 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 21:50:12 +0000 (23:50 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 21:49:24 +0000 (23:49 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 21:39:33 +0000 (23:39 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 21:38:30 +0000 (23:38 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 21:01:24 +0000 (23:01 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 20:50:38 +0000 (22:50 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 19:59:45 +0000 (21:59 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 17:00:45 +0000 (19:00 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 16:57:40 +0000 (18:57 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 16:01:35 +0000 (18:01 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 15:59:36 +0000 (17:59 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 13:41:08 +0000 (15:41 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 13:15:41 +0000 (15:15 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 13:15:06 +0000 (15:15 +0200)]
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>
David Herrmann [Sun, 30 Sep 2012 13:05:13 +0000 (15:05 +0200)]
Update NEWS entry
Add all important changes since kmscon-4.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Matthew Monaco [Sat, 29 Sep 2012 08:23:08 +0000 (02:23 -0600)]
build: autogen.sh cleanup
Use "set -e" to force exit on failure and convert $* to "$@".
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 29 Sep 2012 09:49:54 +0000 (11:49 +0200)]
kmscon: add --vt=<num> option to select VT for seat0
VTs are only available on seat0 so this option does not affect other
seats. On seat0 it selects the VT that we run on. We do _not_ fall back to
another seat if it fails but disable this seat instead.
Reported-by: Matthew Monaco
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 29 Sep 2012 09:47:42 +0000 (11:47 +0200)]
conf: add INT datatype
This is very similar to the UINT datatype but allows signed values. This
will be required for the coming --vt option as default value.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Scott Moreau [Sat, 29 Sep 2012 07:10:01 +0000 (01:10 -0600)]
wlt: toolkit: add maximize toggle functionality
Use wl_shell_surface_set_maximized() to notify the compositor that we
support being maximized now. The server actually decides whether it
resizes our window.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 29 Sep 2012 08:13:45 +0000 (10:13 +0200)]
build: fix compilation if _Static_assert() is not available
I just noticed that older compiles do not support _Static_assert() so we
now check in configure.ac for it. We do not use it heavily, anyway.
Dynamic asserts are avoided entirely.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 17:15:28 +0000 (19:15 +0200)]
eloop: don't warn when removing bad fds from epoll-set
People might want to close file-descriptors before destroying the ev_fd
object if they actually have no direct control of it. For instance if used
through a library.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 17:08:41 +0000 (19:08 +0200)]
wlt: terminal: forward HUP event to the caller
This forwards the PTY-HUP event to the caller so we can close the terminal
window when the client application exits.
Reported-by: Alexander Preisinger
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 16:57:50 +0000 (18:57 +0200)]
tsm: vte: be less verbose about unhandled escapes
This converts a warning into a debug message to avoid spending too much
time in the logger when parsing unknown content. This speeds up "cat
/dev/urandom" by like 1000x.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 12:29:33 +0000 (14:29 +0200)]
eloop: make timerfd non-blocking
We actually allow draining a timer so we cannot be sure that a timer has
valid data that we can read. We already handle the non-blocking case
everywhere, we just missed setting this flag.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 10:56:18 +0000 (12:56 +0200)]
wlt: toolkit: repeat key events
This adds a timer that automatically repeats key-events while pressed. In
the XKB-1 protocol embedded in wayland, key-repeates are not sent for
performance reason so we have to emulate them.
It is currently unclear where to take key-repeat rates from. This will be
solved in the future, though.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 10:54:37 +0000 (12:54 +0200)]
eloop: allow NULL for timer updates
If NULL is passed for timer udpates, we simply assume that the timer
should be disarmed and use a zeroed itimerspec.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 10:36:10 +0000 (12:36 +0200)]
wlt: add some --font-* options
Copy the options from kmscon which are font-* engine, size, dpi and name.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 10:26:30 +0000 (12:26 +0200)]
tsm: screen: fix cleaning buffers on resize
There is some nasty bug where we do not correctly clean buffers when
resizing. So we now clear the whole offscreen region on resize to go sure
everything is clean.
Note that cells can pretty much move everywhere during their
offscreen-life so this is a quite sophisticated task to keep track which
cells are clean and which not. Therefore, simply clean all of them when
taking them on-screen.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 10:13:18 +0000 (12:13 +0200)]
tsm: unicode: fix accessing symbol-array out of bounds
The array type used to be from glib which did that check automatically. We
now have to check explicitely that we do not access it out-of-bounds.
This fixes a nasty resizing-bug of TSM.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 10:11:52 +0000 (12:11 +0200)]
tsm: unicode: fix not recreating the default-table all the time
We actually created a new table all the time which led to huge memory
leaks. We now actually use the default table if it is available.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 09:34:15 +0000 (11:34 +0200)]
wlt: toolkit: fix use after free of dp_fd
We need to keep dp_fd alive for all calls to wl_display_*(). Otherwise,
the callback will use it and access invalid memory.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 27 Sep 2012 08:45:20 +0000 (10:45 +0200)]
wlt: toolkit: fix sending two surface.attach() reqs in one frame
The need_frame and idle_frame logic was slightly wrong. We ended up not
correctly requesting the frame-cb after a _real_ frame-cb. Hence, the
idle-cb did simply send the next attach() request.
This fixes this small race and adds a comment how all this is supposed to
work.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 26 Sep 2012 22:45:32 +0000 (00:45 +0200)]
wlt: main: increase default window size to 600x400
Current default size is pretty small and there are still some resizing
bugs so increase it to have a working terminal.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 26 Sep 2012 22:45:05 +0000 (00:45 +0200)]
wlt: terminal: handle keyboard events
Pass keyboard events straight through to the TSM handler.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 26 Sep 2012 22:43:23 +0000 (00:43 +0200)]
wlt: toolkit: add keyboard events
This implements the wl_keyboard client-side of the wayland protocol and
takes care of pushing keyboard events to the correct window.
A new callback is added to all widgets which is called when keyboard input
is sent to the specific window.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 26 Sep 2012 21:48:35 +0000 (23:48 +0200)]
wlt: terminal: draw terminal to buffers during redraw-cb
Use the font subsystem to blit the console glyphs to the wlterm window
during redraw-callbacks.
This is mostly copied from src/terminal.c and the blitting functions from
uterm-fbdev.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>