Commit graph

1827 commits

Author SHA1 Message Date
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
Kristian Høgsberg e220327223 xwm: Initialize X selection on X server startup
This way an already existing wayland selection will be available on
launch.
2012-06-03 17:59:04 -04:00
Kristian Høgsberg 4dec011807 xwm: Move selection proxy setup to selection.c 2012-06-03 17:59:04 -04:00
Kristian Høgsberg c65d56a280 xwm: Follow wl_data_source changes
Creating the wl_data_offer is now entirely inside libwayland-server.
2012-06-03 17:58:45 -04:00
Kristian Høgsberg fee91be586 terminal: Use serial, not timestamp for setting the selection 2012-06-02 21:21:41 -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 576cd15d8d compositor-x11: Generate our own keymap
Instead of mangling the names we've stored in the compositor, generate
our own keymap and pass that to weston_seat_init_keyboard.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-01 10:41:38 -04:00
Daniel Stone cd981ddf1d compositor-wayland: Fix seat vs. seat confusion
We were accidentally trying to initialise the wl_seat we just got from
our host server as a weston_seat, rather than the weston_seat we set up
earlier ...

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-01 10:38:00 -04:00
Daniel Stone cfd0e726cc Brown-paper bag fix for LED
The O_RDWR change got lost in a rebase, and as Peter suggested as well,
make sure to set EVDEV_KEYBOARD if the device has EV_LED.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-01 10:37:44 -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
Pekka Paalanen 15643f627d build: introduce GCC_CXXFLAGS
The patch "compositor-android: fix build flags" started using GCC_CFLAGS
for C++ files, too. That lead to the following warnings when building a
C++ file:

cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
cc1plus: warning: command line option "-Wmissing-prototypes" is valid
for Ada/C/ObjC but not for C++

Introduce GCC_CXXFLAGS, similar to GCC_CFLAGS, but for C++, avoiding the
problematic compiler flags.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-01 10:32:39 -04:00
Pekka Paalanen d95222e56f compositor-android: fix build flags
When adding a C++ file to the build, I forgot to set CXXFLAGS for it,
triggering the error:

android-framebuffer.h:26:21: fatal error: EGL/egl.h: No such file or
directory

I never hit this, because I have EGL headers installed also in my
system, rather than only in $prefix.

Fix this by setting the CXXFLAGS for the android backend.

Reported-by: Scott Moreau <oreaus@gmail.com>
Reported-by: Tiago Vignatti <tiago.vignatti@intel.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-01 10:32:31 -04:00
Kristian Høgsberg 805667388b xwayland: Handle selection source going away without crashing 2012-06-01 00:08:12 -04:00
Kristian Høgsberg a4b3d0ede7 window.c: Handle losing selection data source 2012-05-31 23:30:32 -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 97f685449e clients: Move XKB info from display to input struct
As it does (will) vary per-seat.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:46:30 -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 b21046836f shell: Reset focus for all seats on activation
Rather than using a single hardcoded seat to activate new windows within
a compositor, reset the focus for all seats.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:02 -04:00
Daniel Stone 162f78af68 tablet-shell: Use seat_list rather than primary seat
Activate surfaces for all seats when showing the grid, not just the
primary seat.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:44:14 -04:00
Daniel Stone 4034c7ac21 tablet-shell: Remove 'seat' member
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:44: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 11d7139989 test-client.c: Replace hard-coded magic value
Took me a second to work out that the 272 was actually BTN_LEFT, as keys
and buttons share a namespace in evdev.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:25 -04:00
Daniel Stone 7bbd5b3335 evdev: Add LED update hook
Simply pushes the updated LEDs through to all keyboard attached to the
seat.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:17 -04:00
Daniel Stone 33965c242d evdev: Add device capabilities
Does what it says on the box: lists whether or not the device supports
key, absolute, relative or touch classes.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:15 -04:00
Daniel Stone 1d637772c8 Rename evdev_input_device::type to pending_events
Since that's what it actually is, rather than a description of the
device as such.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:41:11 -04:00
Daniel Stone a62e804c7e evdev: Convert device type to an enum
Rather than using #defines.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:40: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
Daniel Stone 7ace3902f9 Update XKB state in update_modifier_state
As well as just updating Weston's internal modifier_state, also update
our xkb_state object, in preparation for serialising modifier values to
clients.  This also makes update_modifier_state return 1 if the
modifier/group state has changed, or 0 if not.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 13:59:28 -04:00
Daniel Stone 17b13bd89f Update pointer and keyboard focus on new listeners
If we get a new wl_pointer or wl_keyboard listener from the client
currently owning the focus resource, issue another
wl_{pointer,keyboard}_set_focus so the focus_resource can be updated and
the client can receive an enter event.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 13:58:49 -04:00
Pekka Paalanen 3ae50bb45c Add Android backend
The Android backend provides basic EGL/GLES2 graphics, where everything
is always composited. Overlays are not used. Input is stubbed, therefore
there is no input yet.

This adds the first C++ source file into Weston compositor. The Android
gralloc and fb HAL glue code to the Android EGL library is in C++, and
there is no way to access it from plain C. We have a simple wrapper to
the required C++ class API. Android forces the C++ file name extension
to .cpp.

The android backend is compiled by default. However, all Android
specific calls are protected with #ifdef ANDROID, so it will build also
without Android headers. The binary produced without the Android build
system is useless, but allows build-testing generic Weston changes.
Therefore the android backend is not installed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:54:01 -04:00
Pekka Paalanen daed3bc1aa tests, wcap: update ignores
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:53:57 -04:00
Pekka Paalanen 647f2bfd2a window: add wrapper for EPOLL_CLOEXEC
Android does not have EPOLL_CLOEXEC, so add a fallback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:53:51 -04:00
Pekka Paalanen 200019c0c6 compositor: check for execinfo.h
Some systems may not have execinfo.h. Add a configure test for it, and
if it is not found, make the backtrace() call a no-operation.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:52:24 -04:00
Pekka Paalanen 51aaf646db compositor: work around missing SOCK_CLOEXEC
Android does not have SOCK_CLOEXEC, so implement a wrapper that falls
back.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:52:20 -04:00