We need to update the temp grab pointer after weston_compositor_run_key_binding()
before calling the key handler because it may have installed a new grab.
It is useful to have relevant information about the host system.
Example:
[..] OS: Linux, 3.0.0-13-generic, #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC 2011, i686
This is logging functionality for weston compositor.
It handles:
messages coming from libwayland-server from wl_log()
messages from weston itself, from weston_log()
Introduce --log option, to specify log file path on the command line.
When the path is incorrect, or on weston_log_file_destroy(), fall
back to stderr.
Weston has a SIGSEGV handler that attempts to shut everything down
cleanly. If it actually succeeds in that, the process exit status will
indicate success, when the process just segfaulted.
Fix that by setting the return value to failure in the SEGV handler.
v2: use a local instead of a global variable
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Without this patch, Weston would not start with the message:
creating a keymap file for 44012 bytes failed: No such file or directory
If you do not know, that we use XDG_RUNTIME_DIR for that, the message is
very confusing. Therefore implement a clear error message right at the
start if XDG_RUNTIME_DIR is not set.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
We had duplicated code in many places, using hardcoded paths for
temporary files into more than one path. Some cases did not bother with
O_CLOEXEC, and all hardcoded paths that might not exist.
Add an OS helper function for creating a unique anonymous file with
close-on-exec semantics. The helper uses $XDG_RUNTIME_DIR as the
directory for a file.
This patch unifies the buffer file creation in both Weston and the
clients.
As simple clients are better not linking to libshared, as it would
require e.g. Cairo, they pull the OS compatibility code directly.
Android does not have mkostemp(), so a configure test is added for it,
and a fallback used if it is not available.
Changes in v2:
remove all the alternate possible directory definitions and use
XDG_RUNTIME_DIR only, and fail is it is not set.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
The grab interface handlers all expect pointer->current to identify
the surface under the pointer regardless of grabs etc. Thus, we need
to set it before calling the focus handler.
Fix a few unconditional dereferences of seat->keyboard and seat->pointer
in paths that could be hit outside of input event processing.
Reported-by: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
We use the selection signal to get a callback when somebody sets a
selection (including the X server proxy) and then copy the contents
of the first mime type. If the selection is cleared (when the client
dies), we set a new selection with that contents.
These keymap events communicate the keymap from the compositor to the
clients via fd passing, rather than having the clients separately
compile a map.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This allows backends to generate their own keymaps and pass them in for
use rather than always forcing a single global keymap, which is
particularly useful for nested compositors.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
In practice this doesn't mean much right now, since they all just take
an extra reference on the global keymap.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_keyboard_key_state enum, and explicit comparisons.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_pointer_button_state enum, and explicit comparisons.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Similar to how we deal with modifiers, also add LED handling to the core
input code, with a callout into the backends to update them when they
change.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
When we update the modifier_state used for Weston bindings, derive this
from the XKB modifier state, rather than a hardcoded mapping of physical
keys to modifier state.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
As we need to keep a separate state for every seat (i.e. keyboard
interface) rather than a compositor-global state.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This event lets the compositor inform clients of the canonical keyboard
modifier/group state. Make sure we send it at appropriate moments from
the compositor, and listen for it in clients as well.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>