Commit Graph

255 Commits

Author SHA1 Message Date
Scott Moreau befa65318a compositor: Update grab variable in notify_key() after binding handler.
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.
2012-06-11 18:24:16 -04:00
Kristian Høgsberg 23cf9eb04f Refine the build id string
We use git describe to get the SHA1 so that we append -dirty for dirty
worktrees and include the HEAD commit subject and date.
2012-06-11 12:15:46 -04:00
Pekka Paalanen 4e4167d3a0 compositor: log more EGL and GL info
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:48:34 -04:00
Pekka Paalanen 1b3c1ea880 compositor: log module loading
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:48:02 -04:00
Pekka Paalanen 7f4d1a3534 compositor: move uname log earlier
Basic information that does not depend on any modules.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:47:55 -04:00
Pekka Paalanen bce4c2b1ca compositor: prettify program info in log
No need to print current date-time anymore, since log.c does the date
automatically.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:47:26 -04:00
Martin Minarik f12c2879c6 compositor: Print uname information to log
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
2012-06-11 09:42:08 -04:00
Rafal Mielniczuk 6e0a7d82b7 compositor: change position of weston_log_file_open call
In case XDG_RUNTIME_DIR was not set, weston_log
will crash the compositor instead of spitting
error msg, as weston log was not yet opened
2012-06-11 09:37:02 -04:00
Scott Moreau d64cf21246 Add frame_counter to weston_animation. 2012-06-11 09:33:06 -04:00
Scott Moreau 9d1b1125fd Move animation_list to weston_output. 2012-06-11 09:32:47 -04:00
Kristian Høgsberg fc9c5e04fd log: Add some diagnostics to the log
Just a few useful things to get this started: egl vendor and extensions,
gles2 extensions, drm and kms info and just a bit of x11 backend info.
2012-06-08 16:45:33 -04:00
Kristian Høgsberg a411c8b66c log: Print sha1 of HEAD and the date and time as the first thing in the log 2012-06-08 16:16:52 -04:00
Martin Minarik 6d11836721 Replace fprintf() by weston_log() 2012-06-08 13:11:36 -04:00
Martin Minarik 19e6f2693d Add logging functionality
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.
2012-06-08 13:11:29 -04:00
Pekka Paalanen 3ab7269a9b compositor: return failure even if SEGV handler works v2
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>
2012-06-08 12:52:18 -04:00
Kristian Høgsberg b2af93ef8c compositor: Drop weston_surface_to_global()
Just always call weston_surface_to_global_float() instead.
2012-06-07 20:10:23 -04:00
Kristian Høgsberg 9a050afc06 compositor: Emit destroy signal when we manually destroy a weston_surface 2012-06-07 18:17:42 -04:00
Scott Moreau 3f79d661a1 zoom: Convert wl_fixed_t directly into floats, to avoid truncation.
This fixes center point inaccuracy for rotated surfaces. Thanks to
Pekka Paalanen for spotting it.
2012-06-07 17:15:32 -04:00
Pekka Paalanen bdc7cd06d1 compositor: fix a crash on missing keyboard device
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-07 16:44:13 -04:00
Pekka Paalanen 78a0b57e57 compositor: print a clear message when XDG_RUNTIME_DIR is not set
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>
2012-06-06 13:27:04 -04:00
Pekka Paalanen 1da1b8f3f1 Rewrite shm buffer file allocation v2
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>
2012-06-06 13:26:30 -04:00
Kristian Høgsberg 9892a62b45 compositor: Remove left-over 'bright' shader uniform 2012-06-05 10:49:22 -04:00
Kristian Høgsberg 361039820b compositor: Drop brightness and saturation features in the shader 2012-06-05 10:15:56 -04:00
Kristian Høgsberg 4e99ac4f20 compositor: Set pointer->current before calling focus handler
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.
2012-06-04 16:12:38 -04:00
Scott Moreau ae71220fc9 Convert text cursor position protocol to use fixed types. 2012-06-04 11:07:50 -04:00
Daniel Stone bbf63bf92c Fix inverted LEDs
Turns out it's probably better to post the new state rather than the
old.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-04 11:03:02 -04:00
Daniel Stone e9e92d2ad7 Fix sessions with no active input devices
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>
2012-06-04 11:02:53 -04:00
Kristian Høgsberg a7ceafff9c compositor: Add a clipboard manager
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.
2012-06-03 22:54:36 -04:00
Daniel Stone b7452fe313 Add support for wl_keyboard::keymap events
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>
2012-06-01 11:14:51 -04:00
Daniel Stone e2ef43aa0e Parse XKB config options in weston_compositor_init
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-01 11:14:46 -04:00
Daniel Stone c1be8e59de Pass config_file through to weston_compositor_init
This allows us to do config parsing there.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-01 11:14:38 -04:00
Daniel Stone baf4359285 Pass argc and argv through to weston_compositor_init
Allowing it to do option parsing as well.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-01 11:14:28 -04:00
Daniel Stone 8db796947f Fix binding modifier lookup
Whoops, lost half of the shuffling around of masks and indexes.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-01 10:37:17 -04:00
Daniel Stone bb1df6a7c1 Add keymap argument to weston_seat_init_keyboard
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>
2012-05-31 15:50:42 -04:00
Daniel Stone d65b909778 Move keymaps to weston_seat
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>
2012-05-31 15:49:54 -04:00
Daniel Stone e379da9532 Separate out weston_xkb_info struct
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:49:09 -04:00
Daniel Stone 9a9ee2c779 Split XKB keymap compilation out into separate function
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:48:24 -04:00
Daniel Stone 74419a2237 Split weston_seat_init up into pointer/keyboard/touch
So we don't unnecessarily advertise interfaces the seat doesn't support.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:47:41 -04:00
Daniel Stone 2fce4028d6 Convert wl_pointer::axis to wl_fixed_t
To go with the matching protocol change.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:25 -04:00
Daniel Stone 0c1e46eb18 Use wl_fixed_t for axis bindings
In preparation for axis values being wl_fixed_t in the protocol as well.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:20 -04:00
Daniel Stone 325fc2d53a Split bindings into separate key/button/axis bindings
Rather than attempting to have the one handler prototype everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:16 -04:00
Daniel Stone 878f0b77a8 Convert notify_axis to wl_fixed_t
In preparation for the rest of the axis code changing.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:08 -04:00
Daniel Stone 4dab5dba3f Use compositor->seat_list instead of a singular seat
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:44:03 -04:00
Daniel Stone c9785eacca Use enum wl_keyboard_key_state instead of integer
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>
2012-05-31 15:43:03 -04:00
Daniel Stone 4dbadb1556 Use enum wl_pointer_button_state instead of integer
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>
2012-05-31 15:42:47 -04:00
Daniel Stone 8c8164faeb Add core LED handling
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>
2012-05-31 15:38:50 -04:00
Daniel Stone e3f15edc2f Do binding modifier lookup on XKB state, not physical keys
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>
2012-05-31 15:38:10 -04:00
Daniel Stone 994679a20e Move xkb_state object to weston_seat
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>
2012-05-31 15:28:32 -04:00
Daniel Stone 496ca17a77 Convert Weston modifier #defines to an enum
To avoid any possible collision between the disparate XKB and Weston
modifier namespaces.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:28:23 -04:00
Daniel Stone 351eb61fbc Support wl_keyboard::modifiers event
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>
2012-05-31 15:27:47 -04:00