Commit Graph

43 Commits

Author SHA1 Message Date
Daniel Stone
a497d57619 compositor-wayland: Delay seat creation
We'll get a rash of seats added when we run our first wl_display_iterate
across the parent display, but won't actually be ready to create them.
Create a new global listener on our parent display for wl_seats only,
and run that from wayland_input_create.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-04 11:01:39 -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
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
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
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
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
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
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
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
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
Kristian Høgsberg
b71302e1db Fix a few -pedantic warnings
We're not enabling -pedantic by default, but a quick test brought up a few
issues that we should fix.
2012-05-10 14:11:44 -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
Daniel Stone
103db7fb56 Convert wire input co-ordinates to fixed-point
To add greater precision when working with transformed surfaces and/or
high-resolution input devices.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:41:01 -04:00
Scott Moreau
062be7ec93 screenshooter: Grab pixel data directly before buffer swap 2012-04-20 16:13:27 -04:00
Alex Wu
bd3354b8b2 shell: Implement "driver" method of fullsceen.
Switching display mode may happen when:
1. The fullscreen surface is at top most in fullscreen layer and with
   "driver" method. Shell will switch output mode to match the surface
   size. If no matched mode found, fall back to "fill" method.
2. The top fullscreen surface is destroyed or unset. Switch back to the
   origin mode.
2012-04-17 14:38:45 -04:00
Alex Wu
2dda604093 compositor: Add a switch_mode hook and a wrapper into the output.
This allow each output backend to switch the display mode. It is
useful to some applications like fullscreen game, xbmc.
2012-04-17 14:38:29 -04:00
Pekka Paalanen
a1d57dba87 compositor: make GL_EXT_read_format_bgra optional
Some GL implementations do not provide GL_EXT_read_format_bgra
extension.

Set a glReadPixels format based on whether the extensions is supported
or not, and use that format in all backends.

Add RGBA->BGRA swapping copy to screenshooter to keep the shm buffer
data format as BGRA.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-17 15:12:17 +03:00
Kristian Høgsberg
eae5de7609 Follow wayland change to serial numbers 2012-04-11 22:42:15 -04:00
Kristian Høgsberg
31dd6b86c1 compositor: Don't pass output to notify_keyboard_focus
Doesn't make sense and was only used to distinguish between enter/leave.
2012-04-10 00:04:22 -04:00
Scott Moreau
80d27b7e06 screenshooter: Properly handle multiple outputs. 2012-04-04 14:28:53 -04:00
Kristian Høgsberg
b5ef591fac compositor: Stop using EGL_KHR_surfaceless_gles2
The remaining use case was making our context current before we had any
output surfaces.  We can do that now using a dummy surface, so let's stop
relying on surfaceless.
2012-03-28 22:53:49 -04:00
Scott Moreau
210d079817 Hook up axis events. 2012-03-22 11:03:41 -06:00
Bill Spitzak
d273e28567 weston: Don't ask for EGL depth buffer if not needed
This makes the compositor and demo clients work on the current nouveau
nvfx driver. Obviously does not fix any clients that actually want a
depth buffer, but this does allow more people to at least try wayland.
2012-03-20 22:43:56 -04:00
Ander Conselvan de Oliveira
e2d21e82fc compositor-wayland: use image loading code from shared/
Function weston_load_image() was deleted in f02a649a but the wayland
backend was not adapted to the new interface. This probably went
unoticed because the prototype for the missing function was not deleted
from compositor.h so the backend would compile without warnings.
2012-03-20 22:43:55 -04:00
Kristian Høgsberg
bcacef19b0 Add an option parser
On one hand, getopt (in particular the -o suboption syntax) sucks on the
server side, and on the client side we would like to avoid the glib
dependency.  We can roll out own option parser and solve both problems
and save a few lines of code total.
2012-03-12 01:28:50 -04:00
Kristian Høgsberg
6ddcdaeb98 compositor: Store opaque clip for previous frame in weston_surface 2012-03-01 12:47:23 -05:00
Tiago Vignatti
8e53c7f566 compositor: add dpms and backlight support
DPMS kicks in only when wscreensaver is launched, in the moment that shell
call lock() for the second time. Backlight control internals are managed by
libbacklight:

	http://cgit.freedesktop.org/~vignatti/libbacklight/

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-02-29 14:01:56 -05:00
Kristian Høgsberg
d8bf90c150 Move weston_output_set_cursor into compositor-drm.c
First step towards moving hw cursor handling into compositor-drm.c a its
general overlay handling.
2012-02-23 23:03:14 -05:00
Jesse Barnes
5308a5e09b compositor: add an assign_planes hook to the output
This allows each output back end to optimize drawing using overlay planes
and cursors (yet to be integrated).  If a surface is assigned to a
plane, the back end should clear its damage field so that the later
repaint code won't look at it.
2012-02-23 17:55:10 -05:00
Kristian Høgsberg
06d58b74af Update to enter/leave events for pointer and keyboard 2012-02-23 09:59:05 -05:00
Pekka Paalanen
b29f412eb8 protocol: remove absolute coordinates from pointer
This change depens on the Wayland core commit:
"protocol: remove absolute coordinates from pointer".

Remove the absolute coordinates from pointer motion and pointer_focus
events.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-02-16 23:19:40 -05:00
Kristian Høgsberg
9b8a82bf6d Merge remote-tracking branch 'pq/transform-fixes2' 2012-02-07 11:08:03 -05:00
Kristian Høgsberg
546a812004 compositor-wayland: Add window border 2012-02-07 11:02:59 -05:00
Kristian Høgsberg
2e28b10a3f compositor-wayland: Add display sub-option for wayland backend
This lets us launch the compositor on a separate wayland socket that
what we're listening on.
2012-02-07 09:57:25 -05:00
Kristian Høgsberg
d11d944435 compositor-wayland: Hide cursor for compositor surfaces 2012-02-07 09:56:51 -05:00
Kristian Høgsberg
cdd61d0168 compositor-wayland: Destroy wl_callback in callback function 2012-02-07 09:56:15 -05:00
Kristian Høgsberg
5f5e42ef50 compositor: Remove prepare_scanout_surface callout
For the drm backend, we just refactor setup_scanout_surface into
drm_output_prepare_scanout_surface and call it from drm_output_repaint.
2012-01-25 23:59:44 -05:00
Kristian Høgsberg
06cf6b0238 compositor: Pull prepare_render and present callouts into repaint
This dramatically simplifies the backend repaint abstractions and paves
the way for moving overlay and cursor setup into the backend.
2012-01-25 23:47:45 -05:00
Kristian Høgsberg
68c479af05 compositor: Move repaint loop into a backend function
We've trimmed down the actual repaint loop to just iterating through the
surface list and calling weston_surface_draw(), so we push that to the
backend without too much code duplication.
2012-01-25 23:32:28 -05:00
Kristian Høgsberg
8334bc1ef9 Rename wayland-compositor to weston
This rename addresses a few problems around the split between core
Wayland and the wayland-demos repository.

1) Initially, we had one big repository with protocol code, sample
compositor and sample clients.  We split that repository to make it
possible to implement the protocol without pulling in the sample/demo
code.  At this point, the compositor is more than just a "demo" and
wayland-demos doesn't send the right message.  The sample compositor
is a useful, self-contained project in it's own right, and we want to
move away from the "demos" label.

2) Another problem is that the wayland-demos compositor is often
called "the wayland compsitor", but it's really just one possible
compositor.  Existing X11 compositors are expected to add Wayland
support and then gradually phase out/modularize the X11 support, for
example.  Conversely, it's hard to talk about the wayland-demos
compositor specifically as opposed to, eg, the wayland protocol or a
wayland compositor in general.

We are also renaming the repo to weston, and the compositor
subdirectory to src/, to emphasize that the main "output" is the
compositor.
2012-01-03 11:04:04 -05:00