David Herrmann [Mon, 15 Oct 2012 20:59:31 +0000 (22:59 +0200)]
uterm: input: fix resetting key-repeat timer during key-press
We currently do not reset the key-repeat-delay when key-presses are
changed fast enough to fall into the repeat-rate range. Therefore, we
might get spurios key-repeats, even though the key itself wasn't held for
repeat-delay milliseconds.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 15 Oct 2012 20:53:55 +0000 (22:53 +0200)]
seat: fix staying alive if compositor-registration fails
If the compositor cannot be created, we now still stay alive and allow
other sessions to work. However, the terminal session is still required as
it is considered to be crucial.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Mon, 15 Oct 2012 18:26:27 +0000 (20:26 +0200)]
COPYING: remove no longer relevent sections
All of the (xkb) keyboard handling code was written by David and me;
even the old code was not based on xlib but written against the
specification (not entirely correct, too). All of this logic was moved
to libxkbcommon, which we merely link against.
We also no longer carry our own uterm_keysyms.h file, so that section is
not relevant either.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Ran Benita [Mon, 15 Oct 2012 18:21:14 +0000 (20:21 +0200)]
external: remove unused imKStoUCS files
We needed these files before libxkbcommon had a function to convert
keysyms to unicode, and then for the 'plain' keyboard backend, which
didn't use libxkbcommon. Since this backend was removed, these files are
no longer needed.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 15 Oct 2012 16:05:06 +0000 (18:05 +0200)]
kmscon: add wayland-session support
This adds a wayland compositor which registers sessions for each top-level
window within kmscon. This means, you can run any arbitrary
wayland-application on kmscon. Each top-level window that is registered by
the applications is put into a separate session and you can switch between
the sessions with the previously introduced session-shortcuts.
The compositor is still very basic. It doesn't support input devices at
all (not even talking about DnD). The only thing it does is surface
management (and even that is not fully implemented).
However, this shows the direction that kmscon will go. You can run the
Wayland "simple-shm" and "simple-egl" demos on kmscon to see how it works.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 15 Oct 2012 16:02:12 +0000 (18:02 +0200)]
seat: allow session-switching with keyboard
This adds two new grabs to switch sessions within kmscon. They are set to
ctrl+alt+Left/Right by default.
To improve debugging, we also add some log-messages to session management.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 15 Oct 2012 15:56:44 +0000 (17:56 +0200)]
shl: dlist: add *_but_one() loops
The *_but_one() variants of dlist-loops start from within a loop instead
of at the head and iterate over all elements except the start-element. The
start element is skipped as we would need a temporary variable to include
it and in most times you want to skip the start-element, anyway.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 15 Oct 2012 15:01:13 +0000 (17:01 +0200)]
conf: allow multiple grabs and keysyms per grab-option
We allow users to specify grabs on the command-line or in config-options.
We sometimes want multiple grabs to do the same. Therefore, this changes
the grab-parser and handlers to allow this.
Furthermore, this adds support for keysyms that are assembled of multiple
syms. This isn't needed by any keymap, yet, but might be used in the
future.
Last but not least, you can also specify modifiers only now. This might be
used by subsystems to use the default keysyms but let the user specify
what modifiers should be used.
However, be careful when specifying modifiers-only for normal grabs as
this means the grab is executed everytime the modifier is reported with
_any_ key.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 15 Oct 2012 12:25:59 +0000 (14:25 +0200)]
uterm: video: fbdev: fix setting current-mode on activation
We must not recreate a video-mode if we re-activate an fbdev display after
wake-up. Otherwise, the "current" pointer changes and users might get
confused. We guarantee that the "current" pointer stays the same during
operation as we currently do not support changing display size without
reactiating the display.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 15 Oct 2012 11:22:42 +0000 (13:22 +0200)]
uterm: video: use generic timer if vblank events are not available
fbdev does not provide any vertical-blanks so this introduces a generic
framework for uterm-videos as replacement. We simply schedule a timer
event that fires after a fixed timeout. This allows other subsystems to
rely on the page-flip event to occur either at the next real page-flip or
at a fixed timeout. As this is what we want in most places, we just
implement it inside of uterm. So relying on page-flips no longer hogs the
CPU because swap() generates the right away.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Mon, 15 Oct 2012 10:26:03 +0000 (12:26 +0200)]
uterm: video: add display callbacks
Users might be interested in vertical-blank events so we now allow them to
register event-callbacks on displays. The only event that we currently
pass is a page-flip event that is always sent as reaction to a swap. If
there is no hardware support for such events, we simply throw it from
within the swap() function.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Sat, 13 Oct 2012 14:48:09 +0000 (16:48 +0200)]
uterm: video: add display_fill/blit helpers
Instead of requiring to create uterm-screens, it is now possible to blit
and fill displays directly similar to fake-blends.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 12 Oct 2012 13:56:18 +0000 (15:56 +0200)]
seat: fix activating only enabled seats during session-switch
If we deactivate a session, we must not activate the next session we find
but we need to look for an enabled session instead.
This also changes the session_deactivate() helper to allow deactivating
disabled sessions. This shouldn't be relyed on, but it is a safe fallback
if some session turns out to be disabled but still active.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 12 Oct 2012 13:46:30 +0000 (15:46 +0200)]
seat: rename WAKE_UP/SLEEP to ACTIVATE/DEACTIVATE
We use this naming-scheme for all the session-helpers so we should also
use it for the callback notifications.
Also rename all the callback-helpers to *_call_* so we have no
name-clashes.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 12 Oct 2012 13:30:13 +0000 (15:30 +0200)]
seat: add enable/disable logic to sessions
If we want to allow dummy sessions, we need some way to disable these so
they are never activated on a seat. This patch disables every session by
default and you need to explicitely enable them to be available for
activation.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 12 Oct 2012 13:26:07 +0000 (15:26 +0200)]
seat: add kmscon_session_is_active() helper
This helper allows to check whether a given session is currently the
active session on its registered seat.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Fri, 12 Oct 2012 13:24:45 +0000 (15:24 +0200)]
seat: add kmscon_seat_is_registered() helper
This helper allows API users to check whether a session object is still
registered to a seat.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 23:22:47 +0000 (01:22 +0200)]
uterm: input: fix key-repeat handling
We currently do not handle modifier-changes during key-repeats. This is
odd as pressing shift should change a repeating key.
To avoid duplicating a lot of code, this patch puts most of the
key-handling into helper functions and cleans it up. We now handle all
kinds of key-repeat specialties and everything should work fine.
Reported-by: Ran Benity <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 22:30:58 +0000 (00:30 +0200)]
uterm: input: fix stopping key-repeats on key-up
A key-repeat is about keycodes, not keysyms. We repeat the keycode and the
events that are generated by it, so we must also stop repeating if the
given keycode is released.
This fixes a bug where a key would still be repeated if we press:
<a-down> - <Shift-down> - <a-up> - <Shift-up>
Reported-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 14:45:30 +0000 (16:45 +0200)]
shl: misc: fix XKB modifier collector to check for errors
The XKB functions actually return <0 if the modifier is invalid. This
cannot happen for the hard-coded modifiers that we use, but it is still
safer to check correctly whether the returned value is >0.
Reported-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 10:39:58 +0000 (12:39 +0200)]
wlterm/kmscon: change default repeat-rate to 50
Even though I really like the high repeat-rates, it might not be the best
default option. Hence, change it to some sane default.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 10:33:34 +0000 (12:33 +0200)]
tsm: vte: fix clearing alternate screen on DECSET 1047
It isn't clear from the xterm documentation which buffer to clear when
resetting private mode 1047. However, testing showed that the
alternate-screen is cleared, not the main-screen.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 10:26:18 +0000 (12:26 +0200)]
tsm: screen: do not link alternate-screen lines to scrollback
The alternate screen is mainly used to avoid linking lines to the
scrollback buffer. This implements this feature so only main-screen lines
end up in the scrollback buffer.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 10:22:53 +0000 (12:22 +0200)]
tsm: screen: remove obsolete comment
We correctly free all new space and this is really needed due to rotations
in the active screen and scrollback buffer.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 10:20:08 +0000 (12:20 +0200)]
tsm: screen: fix cell-initialization on line resize
We didn't correctly initialize new lines on resize. In fact, we didn't
initialize new cells at all. This was all covered by a nasty-fix in the
screen-resize handler.
This fixes the line-resize handler to initialize all new cells correctly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 10:19:35 +0000 (12:19 +0200)]
tsm: screen: fix freeing alternate screen buffers on shutdown
We have to free both, main and alternate buffers on shutdown. We only used
to free the currently active buffer.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 10:17:20 +0000 (12:17 +0200)]
tsm: vte: implement alternate-screen modes
On DECSET 47, 1047-1049 we switch between normal screen mode and alternate
screen mode. xterm and friends support a titeInhibit resource that
disables this feature, so we add a flag to set this, too. However, there
is currently no way to set this on the command-line. If someone needs
that, we can easily add that.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 09:31:14 +0000 (11:31 +0200)]
tsm: screen: add flag to select alternate screen buffer
The VTE layer can now set the TSM_SCREEN_ALTERNATE flag to switch to the
alternate screen-buffer and back.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 09:16:30 +0000 (11:16 +0200)]
tsm: screen: allocate alternate screen buffer
This changes the line-allocation helpers of TSM-screen to allocate an
alternate buffer along with the main-buffer. We still keep the "lines"
pointer to the main-buffer all the time, but this will allow to implement
alternate-xterm-screens later.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 08:54:01 +0000 (10:54 +0200)]
Introduce session management
On seats other than seat0 we do not have any session-management, because
VTs are not available. Furthermore, if we want to get rid of CONFIG_VT
entirely, we also need to provide session-management for seat0.
This commit introduces sessions. Every seat (seats are now managed in
kmscon_seat.c) can have registered sessions. One of the sessions is active
and gets control over all displays. Session switching is entirely handled
inside of kmscon so there is always an active session (except if no
session is registered at all).
This also reworks the seat-management. kmscon_main.c now only manages the
seat allocation/deallocation and video-objects. The seat itself is handled
inside of kmscon_seat.c and does not know of uterm_video objects. Instead,
it is assigned a list of displays that it can use. Everything is still
hotplugging capable so user-experience should be the same as before.
The kmscon_terminal layer is reworked to be session based. So every
terminal is now a single session. By default, a single terminal-session is
created for each seat. This may be changed, though.
There is currently no input-control to change between session with
keyboard hotkeys. However, this will be added when we have more than one
session.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Thu, 11 Oct 2012 08:38:21 +0000 (10:38 +0200)]
build: run ./configure in ./autogen.sh only if NOCONFIGURE is not set
In some circumstances it might not be desirable to run ./configure
together with ./autogen.sh. You can now set NOCONFIGURE=1 to avoid this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 10 Oct 2012 20:26:01 +0000 (22:26 +0200)]
uterm: video: fbdev: send UTERM_NEW/GONE events for fbdev devices
We didn't send these events as the fake-display for fbdev video-objects
was created during video-creation and thus no listener could have been
registered so far.
However, this caused every video listener to iterate over all displays on
wake-up. This is really ugly and we want to avoid that. Therefore, we now
send the UTERM_NEW event in an idle-handler and the GONE event on
shutdown.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 10 Oct 2012 19:30:54 +0000 (21:30 +0200)]
kmscon: move config-handling to kmscon_conf.c
Configuration handling is totally independent from kmscon_main.c so we
move it into a separate file to avoid cluttering up kmscon_main.c.
This also does some basic initialization in kmscon_conf.c which is solely
related to configuration handling and logging.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 10 Oct 2012 19:24:35 +0000 (21:24 +0200)]
terminal: reopen terminal on HUP if no callback is given
If the caller didn't pass a callback to be called on HUP, we now
automatically reopen the terminal as default behavior.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Wed, 10 Oct 2012 19:23:38 +0000 (21:23 +0200)]
kmscon: move kmscon_main.h to kmscon_conf.h
Everything in this header is solely related to configuration parsing so we
should name it properly. We will also move the configuration-handling from
kmscon_main.c to kmscon_conf.c in some of the next commits to clean up
kmscon-main.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Detlef Riekenberg [Tue, 9 Oct 2012 14:50:43 +0000 (16:50 +0200)]
build: do not list xkbcommon as optional
The variable xkbcommon_enabled was no longer nedded
after removing xkbcommon from the build configuration notice.
Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 13:29:31 +0000 (15:29 +0200)]
uterm: input: fix passing the correct keycode to get_ascii()
We need to pass the +8 shifted codes instead of the real hardware codes as
XKB needs these for X11 legacy reasons.
Reported-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 11:56:30 +0000 (13:56 +0200)]
test_input: fix using XKB directly
We removed a lot of helpers from uterm-input because XKB is now a
mandatory dependency. So use it directly from test_input to avoid all the
uterm helpers.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 11:53:55 +0000 (13:53 +0200)]
Prefix kmscon sources with kmscon_*
We will be adding more applications to this repository, so to keep better
overview, we prefix kmscon sources with kmscon_*.
The only sources that have no prefix are either shared between
applications (i.e., statically linked) or they were not cleaned up, yet.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 11:23:09 +0000 (13:23 +0200)]
kmscon: add --xkb-repeat-rate/delay command-line arguments
These new arguments allow changing the xkb-repeat settings for kmscon.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 11:12:02 +0000 (13:12 +0200)]
uterm: input: implement software key-repeat
To allow users to specify key-repeat rates/delays, we now implement
software key-repeat. This is mostly copied from wlt_toolkit.c which
already does this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 11:10:02 +0000 (13:10 +0200)]
uterm: vt: reset KBMODE to K_UNICODE if it was K_OFF
If we switch to a VT that has KBMODE set to K_OFF, we do not set it back
to K_OFF when leaving, instead, we set it to K_UNICODE. This allows
recovering when kmscon died by simply restarting kmscon.
There is really no need to let a VT stay in K_OFF! This causes the user to
be stuck at this VT and use the sysrq (if enabled) keys to recover.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 10:51:27 +0000 (12:51 +0200)]
shl: misc: add shl_dup() helper
shl_dup() duplicates a memory region similar to strdup() but without
reading the data length via strlen().
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 10:26:07 +0000 (12:26 +0200)]
tsm: vte: use ASCII keysyms for ctrl+<XY> shortcuts
If a user has multiple active XKB layouts but only one of them has ASCII
keysyms on the base level, then ctrl+<XY> might actually never work,
because these keys aren't available in the current layout. This patch
tries to find a layout of the user that actually _has_ ascii keysyms on
the base level and passes this information along with the normal keysym
information.
The TSM layer can now use this ascii keysym instead of the normal unicode
keysym to handle ctrl+<XY> shortcuts. This is the same way xterm et. al.
handle this, so it seems to be a good idea to do this in TSM, too.
Reported (and mainly written) by Ran Benita.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 09:19:30 +0000 (11:19 +0200)]
uterm: input: add support for multiple keysyms
xkbcommon supports reporting multiple keysyms per key-event. There is no
keymap which uses this, yet. However, this feature is not meant to enhance
performance by reducing the number of calls into xkb, but instead multiple
keysyms are to be handled as one big keysym.
But there are no examples, yet, so we cannot actually perform any
conversions on them. But we can add the infrastructure for it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
David Herrmann [Tue, 9 Oct 2012 08:56:00 +0000 (10:56 +0200)]
uterm: input: use uxkb directly
This changes the uterm-input infrastructure to use XKB directly instead of
using a modularized infrastructure. There is no need to use something else
anymore.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
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>