Commit Graph

228 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
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
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 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
Scott Moreau 7a1b32a198 Implement text cursor position protocol.
Here we create a new client/compositor interface in weston to allow
clients to report their x/y cursor position to the compositor. These
values are then used to center the zoom area on this point. This
is useful for everyone, especially people who are visually impaired.
2012-05-31 13:10:22 -04:00
Kristian Høgsberg 66a099b775 compositor: Only fini region if it's not the undef region 2012-05-29 16:49:45 -04:00
Chad Versace bf38190744 compositor: Fix buggy snprintf that sets module path
If the MODULEDIR string contains '%', then
    snprintf(path, sizeof(path), MODULEDIR "/%s", name);
does not do what you want.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-25 23:05:44 -04:00
Tiago Vignatti 629ce23bd0 xwayland: change library name
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-25 22:54:40 -04:00
Kristian Høgsberg 5fb70bf301 Add screen recorder tool
This commit adds a new, built-in screen recorder tool.  The tool UI is
still very simple, start with mod-r and stop it again with mod-r.
The recording is written to capture.wcap, in a simple run-length encoded
adhoc format.  The wcap-decode tool can be used to extract a single frame
from the capture, for now, but the plan is to hook this up to libvpx and
generate webm output.
2012-05-24 12:29:46 -04:00
Scott Moreau 9fb9824c17 compositor: Address blending for XRGB surfaces with alpha < 1.0. 2012-05-22 13:06:51 -04:00
Scott Moreau 850ca42b9b Restructure output zoom.
A quick clean-up of zoom to prepare for the other patches in this series.
2012-05-22 12:58:47 -04:00
Kristian Høgsberg a416fa15d5 xwm: Switch alpha, brightness and saturation to GLfloat 2012-05-21 17:03:06 -04:00
Rob Bradford 8667e77b77 compositor: Silence compiler warning by initializing resource to NULL
Although resource will be valid when it is used since the entered and left
masks are subsets of the different mask it would be nice not to have a
spurious compiler warning.
2012-05-18 09:49:31 -04:00
Kristian Høgsberg d6ad122d9a compositor: Disable blending for WL_SHM_FORMAT_XRGB8888 surface
Will it blend?  No.
2012-05-17 11:11:15 -04:00
Kristian Høgsberg b93b6cfa47 compositor: Remove resource from list when we destroy seat devices 2012-05-16 22:32:40 -04:00
Kristian Høgsberg 0b0c2bb3e9 compositor: Add opaque rect shader feature
This lets us mark a rectangle in a texture and force the alpha to one
inside.  This is useful for textures coming from X windows, where the X
window part is xRGB, that is 32 bit RGB with an undefined alpha channel
and the decorations are rendered with a well-defined alpha channel.
2012-05-16 16:00:41 -04:00
Daniel Stone 37816df646 Convert wl_input_device to wl_seat (and friends)
wl_input_device has been both renamed and split.  wl_seat is now a
virtual object representing a group of logically related input devices
with related focus.

It now only generates one event: to let clients know that it has new
capabilities.  It takes requests which hand back objects for the
wl_pointer, wl_keyboard and wl_touch interfaces it exposes which all
provide the old input interface, just under different names.

This commit tracks these changes in weston and the clients, as well as
similar renames (e.g. weston_input_device -> weston_seat).  Some other
changes were necessary, e.g. renaming the name for the visible mouse
sprite from 'pointer' to 'cursor' so as to not conflict.

For simplicity, every seat is always exposed with all three interfaces,
although this will change as time goes on.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-16 15:29:06 -04:00
Scott Moreau dc549932b7 Convert wl_fixed_t to int in weston_output_update_zoom().
This way, we don't have to use wl_fixed_to_int() for each
call to weston_output_update_zoom(). It accepts wl_fixed_t
types and converts internally.
2012-05-16 11:04:04 -04:00
Ander Conselvan de Oliveira f6f9069138 compositor: Fix cursor positioning right after input_device.attach
The type of fields x and y in wl_input_device was changed to wl_fixed_t
but input_device_attach() was still using it as if it were integer.
This bug caused the pointer sprite to be configured in the wrong place
on the screen (usually outside the visible area) but it would soon be
corrected in notify_motion() making it hard to notice and usually only
causing a quick flicker.
2012-05-15 10:59:24 -04:00
Kristian Høgsberg c7ca355ec5 compositor: Only call weston_surface_update_transform from repaint 2012-05-14 16:18:54 -04:00
Kristian Høgsberg bef52d1423 Update to new libxkbcommon API
We no longer depend on xproto, we use xkbcommon keycodes now. Yay!
2012-05-11 11:24:35 -04:00
Kristian Høgsberg 34829dec71 compositor: Simplify clip_pointer_motion() and make it handle dead areas
We were testing if the pointer were outside any output and doing a lot of
work to compute the bounding box of all output and then clip against that.
Just clip against previous (valid) output and don't bother with the
bounding box.
2012-05-09 22:21:27 -04:00
Jonas Ådahl f647c5a5d5 compositor: When clipping pointer motions, don't loose precision
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-05-09 22:21:27 -04:00
Kristian Høgsberg e11bbe4cc8 compositor: Use wl_fixed_t for incoming input events
This changes notify_motion, notify_pointer_focus and notify_touch to take
wl_fixed_t types for input coordinates.
2012-05-09 12:19:04 -04:00
Kristian Høgsberg 1f37601850 compositor: Move pointer motion clipping to its own function 2012-05-09 11:43:11 -04:00
Daniel Stone d42f457b66 Load an XKB keymap and state in the compositor
Not used yet, but will be in future commits.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 16:04:24 -04:00
Daniel Stone 855028fec9 Add xkb_names member plus config + X11 support
Add an xkb_names member to the base compositor info which contains the
RMLVO to use when building an XKB keymap.  Add support for filling this
from the config file or from the underlying X11 server, with the usual
defaults.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 16:02:48 -04:00