Commit Graph

237 Commits

Author SHA1 Message Date
Marek Chalupa
c45be3d21e protocol: add better description of wl_pointer.release
Add note about what all wl_pointer.release does. Mainly that
it destroys the proxy object, so programmer must not call
wl_pointer_destroy() on the pointer any further.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-30 14:23:18 +03:00
Bryce Harrington
439b0a3863 Spelling fixes (cosmetic)
A few typos in comments and protocol docs, no code changes.

./src/wayland-util.h:281: recieved  ==> received
./src/wayland-client.c:115: occured  ==> occurred
./src/wayland-client.c:156: occured  ==> occurred
./tests/test-compositor.c:76: parallely  ==> parallelly
./tests/test-compositor.c:474: recieve  ==> receive
./protocol/wayland.xml:1767: layed  ==> laid
./protocol/wayland.xml:2112: dependant  ==> dependent
./doc/publican/sources/Client.xml:25: recieved  ==> received

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Bill Spitzak <spitzak@gmail.com>
2015-03-19 16:56:17 +02:00
Jonas Ådahl
8b2fbf8722 protocol: Change wording of subsurface placement scheduling
Change wording to be more consistent with other parts of the subsurface
protocol. Before this change, wl_subsurface.set_position explicitly
stated that the new state was to be applied on the parents
wl_surface.commit and wl_subsurface.place_above/below only said "on
the next commit of the parent surface". What "committed" means is
ambiguous considering that a wl_surface.commit actually defers the
actual commit when in synchronized mode, but the intention has always
been that placement of a subsurface should be considered part of its
content, i.e. placement state should be applied when other state
(buffer, regions). This patch makes that more clear.

Note that prior to this patch, one could correctly have interpreted
the protocol meaning that placements operations takes effect explicitly
on wl_surface.commit of the parent surface no matter whether other state
of the parent surface is applied at that point. This patch clarifies that
that is not the case.

https://bugs.freedesktop.org/show_bug.cgi?id=88857

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-03-04 15:47:48 +08:00
Hardening
99d2775ae9 wayland.xml: fixed a typo 2015-02-25 12:38:26 -08:00
Jonas Ådahl
5ce947bd90 protocol: Clarify selection data offer destruction requirement
Clarify that a client receiving a wl_data_device.selection event must
destroy the data_offer of the previous wl_data_device.selection event,
if any.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2015-01-23 18:20:35 -08:00
Jonas Ådahl
434d797d27 protocol: Fix typo in wl_data_offer
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2015-01-23 18:20:29 -08:00
kabeer khan
0953e126d7 Protocol : Added destructor to wl_data_device interface
[Pekka Paalanen: removed trailing whitespace, adjust bz link.]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=81745
Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-04 15:04:29 +02:00
Pekka Paalanen
7a0b86ab22 protocol: define error codes for role reassignment
On the interfaces where it was missing:
- wl_data_device
- wl_shell
- wl_pointer
add an error code for requests that set a wl_surface role when the
wl_surface already has a different role.

This is needed for compositors to appropriately report wl_surface
role violations.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-08 13:09:56 +03:00
Pekka Paalanen
aee813f1ff protocol: wl_shell.get_shell_surface gives a role
Now that we have defined "role", use the term.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-01 11:50:48 +03:00
Pekka Paalanen
96fdcfaec7 protocol: wl_subcompositor.get_subsurface gives a role
Reword the conditions to make use of the definition of "role".

It is still forbidden to create more than one wl_subsurface for a
wl_surface at a time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-01 11:50:48 +03:00
Pekka Paalanen
58743c29f8 protocol: wl_data_device.start_drag may give a role
Now that we have defined "role", use the term.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-01 11:50:47 +03:00
Pekka Paalanen
a27501f40e protocol: wl_pointer.set_cursor gives a role
Now that we have defined "role", use the term.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-01 11:50:47 +03:00
Pekka Paalanen
ff2df60b1a protocol: define the concept of wl_surface role
Define what a role is, and what restrictions there are.

A change to existing behaviour is that a role cannot be changed at all
once set. However, this is unlikely to cause problems, as there is no
reason to re-use wl_surfaces in clients.

v2: give more concrete examples of roles, define losing a role, Jasper
rewrote the paragraph on how a role is set.

v3: make role permanent, there is no such thing as "losing a role".
Re-issuing the same role again must be allowed for wl_pointer.set_cursor
et al. to work.

v4: clarify the semantics of destroying a role object.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2014-10-01 11:50:47 +03:00
Ryo Munakata
06472737a9 wl_surface: clarify the base of time passed in the callback of frame
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-21 10:01:17 +03:00
Jonny Lamb
978943fa7e protocol: add repeat_info event to wl_keyboard
In the process wl_keyboard's version has been incremented. Given
clients get the wl_keyboard from wl_seat without a version, wl_seat's
version has also been incremented (wl_seat version 4 implies
wl_keyboard version 4).

earlier Acked-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
2014-07-25 15:02:32 +03:00
Silvan Jegen
1a6fd1621e protocol: remove redundant 'the' in description
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
2014-06-18 16:09:49 -07:00
Jonny Lamb
0dd019925b protocol: add wl_surface errors enum for bad scale and transform values 2014-06-03 09:59:35 +03:00
Jonas Ådahl
3ed76204a9 protocol: Fix order of wl_pointer, wl_keyboard and wl_touch messages
The "release" message of wl_pointer, wl_keyboard and wl_touch introduced
in version 3 was placed first in the respective interface XML element,
causing wayland-scanner to misbehave and set the version number of the
"release" message to all subsequent messages with no explicitly specified
"since" version.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-05-09 14:30:14 -07:00
Kristian Høgsberg
24cdbe3d69 shm: Disallow shrinking shm pools
Unused shm space will be automatically reclaimed if unused or can be
explicitly returned by using fallocate FALLOC_FL_PUNCH_HOLE.

https://bugs.freedesktop.org/show_bug.cgi?id=74632
2014-04-07 16:01:25 -07:00
Rui Matos
2142c03a8b protocol: Document how clients are supposed to get the xkb keycode
This encodes what everyone is doing and avoids other implementers
having to guess.
2014-04-01 16:47:04 -07:00
Pekka Paalanen
2c319d341b protocol: try to clarify frame callback semantics
"the callback event will arrive after the next output refresh" is wrong,
if you interpret "output refresh" as framebuffer flip or the moment when
the new pixels turn into light the first time. Weston has probably never
worked this way.

Weston triggers the frame callbacks when it submits repainting commands
to the GPU, which is before the framebuffer flip.

Strike the incorrect claim, and the rest of the paragraph which no
longer offers useful information.

As a replacement, expand on the "throttling and driving animations"
characteristic. The main purpose is to let clients animate at the
display refresh rate, while avoiding drawing frames that will never be
presented.

The new claim is that the server should give some time between
triggering frame callbacks and repainting itself, for clients to draw
and commit. This is somewhat intimate with the repaint scheduling
algorithm a compositor uses, but hopefully the right intention.

Another point of this update is to imply, that frame callbacks should
not be used to count compositor repaint cycles nor monitor refresh
cycles. It has never been guaranteed to work. Removing the mention of
frame callback without an attach hopefully discourages such use.

v2: Don't just remove a paragraph, but add useful information about the
request's intent.

v3: Specify the order of posting frame callbacks.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Cc: Axel Davy <axel.davy@ens.fr>
Cc: Jason Ekstrand <jason@jlekstrand.net>
2014-03-11 09:09:55 -07:00
Kristian Høgsberg
bb5344ee6d build: Move protocol/ Makefile.am into toplevel Makefile.am
A small step towards non-recursive build system for wayland too.
2014-02-18 14:55:09 -08:00
Kristian Høgsberg
6292fe2af6 build: Stop using xmllint to validate protocol files
Same reason as commit cd31275f28b0a04d2ec5426dc81e875197b47e52 from weston:

    The scanner needs to be good enough.  If it crashes or fails to report
    invalid input, that needs to get fixed.
2014-02-18 14:52:02 -08:00
Pekka Paalanen
f8b37449b2 protocol: when buffer transform and scale change
Clarify when the pending and current buffer transform and scale values
change, and what exactly happens on commit.

This matches what Weston currently does.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-02-09 21:08:47 -08:00
Jasper St. Pierre
bab7f46d83 protocol: Fix build
"data" is the name of the void* argument in the implementation.
While we probably shouldn't use such an easily-collidable name,
just rename the callback's argument to callback_data for now.
2014-01-31 13:35:07 -08:00
Jasper St. Pierre
338dbd7619 protocol: Fix documentation for the parameter of wl_callback
The parameter here is an opaque integer, rather than the event serial.
The "frame" callback uses this to pass the current time of day in
milliseconds.
2014-01-31 13:10:12 -08:00
Jasper St. Pierre
91974dad1c protocol: Fix the name of the registry argument
A simple copy-paste typo.
2014-01-31 13:10:12 -08:00
Jonas Ådahl
47bbc6bb9c protocol: Clarify semantics of wl_subsurface.set_position
Make it clear that multiple requests before commit are allowed and how it
is handled.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-01-19 22:43:13 -08:00
Jonas Ådahl
b5fb898e92 protocol: Clarify semantics of sub-surface placement requests
Clarify some semantics of wl_subsurface.place_below and
wl_subsurface.place_below that were not specified.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-01-19 22:42:44 -08:00
Jasper St. Pierre
148478323f Update .gitignore for protocol/ 2013-11-19 13:26:04 -08:00
Pekka Paalanen
81c57614d1 protocol: add sub-surfaces to the core
The sub-surface protocol was originally committed into Weston on May
10th, 2013, in commit 2396aec6842c709a714f3825dbad9fd88478f2e6. The
design for the protocol had started in the beginning of December 2012. I
think it is high time to move this into the core now.

This patch copies the sub-surface protocol as it was in Weston on Nov
15th, 2013, into Wayland. Weston gets a patch to remove the protocol from
there.

Sub-surface is a wl_surface role. You create a wl_surface as usual, and
assign it the sub-surface role and a parent wl_surface. Sub-surfaces are
an integral part of the parent surface, and stay glued to the parent.
For window management, a window is the union of the top-level
wl_surface and all its sub-surfaces. Sub-surfaces are not clipped to the
parent, and the union of the surface tree can be larger than the
(top-level) wl_surface at its root.

The representative use case for sub-surfaces is a video player window.
When the video content is given its own wl_surface, there is no need to
modify the video frame contents after decoding or copy them into a whole
window sized buffer before submitting it to the compositor. This allows
efficient, zero-copy video presentation paths, where video decoding
hardware produces a (YUV) buffer, which eventually ends up in a
(YUV-capable) hardware overlay and is scanned out directly.

This can also be used for zero-copy presentation of windowed OpenGL
content, where the OpenGL rendering engine does not need to draw or
avoid window decorations.

Sub-surfaces allow mixing different buffer types into the same window,
e.g. software-rendered decorations in wl_shm buffers, and live content
in EGL-based buffers.

However, the sub-surface extension does not offer clipping or scaling
facilities, or accurate presentation timing. Those are topics for
additional extensions.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-11-15 20:49:36 -08:00
Peter Hutterer
05f95c85c8 protocol: validate the protocol against a dtd
The scanner is not very forgiving if the protocol doesn't match it's
expectations and crashes without much of a notice. Thus, validate the protocol
against a DTD.

Move the protocol subdir forward so we validate first before trying anything
else, and install the DTD so we can validate weston's protocols as well.
2013-10-25 10:58:06 -07:00
José Bollo
84247b7513 protocol: Fix typo in documentation 2013-10-11 10:04:43 -07:00
Jason Ekstrand
ba90497b87 Export the Wayland protocol XML file
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-09-21 21:48:56 -07:00
Kristian Høgsberg
ea1fb51aae protocol: Add release requests for wl_pointer, wl_keyboard, and wl_touch
We missed destroy requests in the 1.0 protocol and since the scanner
generates local-only *_destroy requests in that case we can't add
destroy requests without breaking protocol.  A client needs to verify
that the server provides a version 3 seat to use the protocol destructor
so the name needs to be something else than wl_*_destroy.

v2 (Rob Bradford): Rebased, bumped the protocol versions and added since
attributes to the requests.
2013-08-30 15:46:41 -07:00
Bryce W. Harrington
f169614738 protocol: Improve a bit of grammar for wl_surface::attach description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-12 21:25:48 -07:00
Bryce W. Harrington
dbc41f0344 protocol: Fix pluralization of user in popup_done description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:42:38 -07:00
Bryce W. Harrington
b5e7f9caef protocol: Improve grammar for set class description
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:42:26 -07:00
Bryce W. Harrington
3d6470b1ef protocol: Add missing d to 'x an y'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:41:57 -07:00
Bryce W. Harrington
fecef1ca66 protocol: Fix typo by removing a redundant 'a'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-08 21:41:44 -07:00
Tomeu Vizoso
03dc786c90 protocol: Copy missing pixel formats from wl_drm to wl_shm 2013-07-29 09:28:12 -07:00
Rob Bradford
2e07587443 protocol: add no_keymap format to keymap formats
This format is used to specify that the key button events received are not in
relation to any key map and that the codes should be interpreted directly.

v2: Use zero for the no keymap enum value and enhance the documentation
for the enum entry.
2013-06-28 19:51:12 -04:00
Rob Bradford
885d057536 protocol: Add missing since attribute for name event on wl_seat
This event was added in version 2 of the protocol.
2013-06-14 14:56:50 -04:00
Kristian Høgsberg
a3870a297c protocol: Move new name event below existing requests and events and version it
Missed v2 of Robs patch that already did this based on feedback from
Ander and Daniel.
2013-06-05 01:08:58 -04:00
Rob Bradford
dce104dcc2 protocol: Add a name event to give seat name
This provides the ability for a client to differentiate events from
different seats in a multiple seat environment.
2013-06-05 00:05:25 -04:00
Alexander Larsson
b693088904 protocol: Modes are specified in HW pixels
Modes are mainly meant to be used in coordination with fullscreen in
DRIVER mode, by e.g. games. For such games what they generally want
is to match some hardware mode and resize their window for that. We
don't really need to complicate this with the scaling. So, we
keep the resolutions in HW pixels, and drop the SCALED flag (as it
is now useless).

This lets you just create e.g an 800x600 buffer of scale 1 and
fullscreen that, ignoring the output scaling factor (although you can
of course also respect it and create a 400x300 surface at scale 2).
Conceptually the mode change is treated like a scaling which overrides
the normal output scale.

The only complexity is the FILL mode where it can happen that the user
specifies a buffer of the same size as the screen, but the output has scale
2 and the buffer scale 1. Just scanning out this buffer will work, but
effectively this is a downscaling operation, as the "real" size of the surface
in pels is twice the size of the output. We solve this by allowing FILL to
downscale (but still not upscale).
2013-05-28 15:40:02 -04:00
Alexander Larsson
e782dbecbc protocol: Use signed int for scale values
We usually use signed ints for things like this, to avoid
issues C sign coersion.
2013-05-28 15:27:36 -04:00
Alexander Larsson
d68c7d8aed protocol: Support scaled outputs and surfaces
This adds the wl_surface.set_buffer_scale request, and a wl_output.scale
event. These together lets us support automatic upscaling of "old"
clients on very high resolution monitors, while allowing "new" clients
to take advantage of this to render at the higher resolution when the
surface is displayed on the scaled output.

It is similar to set_buffer_transform in that the buffer is stored in
a transformed pixels (in this case scaled). This means that if an output
is scaled we can directly use the pre-scaled buffer with additional data,
rather than having to scale it.

Additionally this adds a "scaled" flag to the wl_output.mode flags
so that clients know which resolutions are native and which are scaled.

Also, in places where the documentation was previously not clear as to
what coordinate system was used this was fleshed out.

It also adds a scaling_factor event to wl_output that specifies the
scaling of an output.

This is meant to be used for outputs with a very high DPI to tell the
client that this particular output has subpixel precision. Coordinates
in other parts of the protocol, like input events, relative window
positioning and output positioning are still in the compositor space
rather than the scaled space. However, input has subpixel precision
so you can still get input at full resolution.

This setup means global properties like mouse acceleration/speed,
pointer size, monitor geometry, etc can be specified in a "mostly
similar" resolution even on a multimonitor setup where some monitors
are low dpi and some are e.g. retina-class outputs.
2013-05-22 16:15:33 -04:00
Alexander Larsson
911c068428 protocol: Allow output changes to be treated atomically
This add a wl_output.done event which is send after every group
of events caused by some property change. This allows clients to treat
changes touching multiple events in an atomic fashion.
2013-05-22 16:15:29 -04:00
Peter Hutterer
cfec3aecb9 protocol: revert hotspot_x/y in set_cursor back to int
copy/paste error introduced in 9c0357af6e

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-18 16:28:52 -04:00
Rob Bradford
e7d0a0b0ed protocol: Make it clear that returned "one-shot" objects are destroyed
The objects returned by the frame and sync request are destroyed by the
compositor after the "done" event on the wl_callback interface is fired.
2013-04-18 16:28:52 -04:00
Peter Hutterer
4f7f09b4c8 protocol: input documentation fixes
Fix summary for wl_touch::motion, extend summary for wl_touch::down to match
up/motion a bit better.

Fix a typo in wl_touch, and claim that it's zero or more update events, not
one or more.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-04 16:40:12 -04:00
Peter Hutterer
e5202f76b0 protocol: fix two protocol description 'typos'
Remove "mice, for example", it's described in the wl_pointer interface in
detail. And remove space before the full stop.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-03 15:44:50 -04:00
Peter Hutterer
9c0357af6e protocol: document wl_pointer, wl_keyboard, wl_touch
Most of this should be clear, but let's spell a few things out.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-03 15:44:50 -04:00
Peter Hutterer
4a599e029d protocol: use "summary", not "description" for xkb_v1 format
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-03 15:44:50 -04:00
Matthias Clasen
c110fbcb75 docs: Document granularity of timestamps
This information is necessary to make any use of these fields.
2013-04-01 21:43:17 -04:00
Kristian Høgsberg
c7639228b4 docs: Remove mention of touch focus
There is no focused surface for a touch screen.
2013-04-01 20:06:36 -04:00
Matthias Clasen
ab6d96c8c4 docs: Improve wl_region protocol docs
Just cosmetic changes, a few missing periods, and ID was
not capitalized.
2013-04-01 19:59:38 -04:00
Matthias Clasen
4c94024af5 docs: Improve the wl_output protocol docs
Some descriptions were missing.
2013-04-01 19:59:12 -04:00
Matthias Clasen
27eacf423a docs: Improve wl_touch protocol docs
Some descriptions were missing here.
2013-04-01 19:58:06 -04:00
Matthias Clasen
608d81bfd5 docs: Improve wl_keyboard protocol docs
Some descriptions were missing here.
2013-04-01 19:57:28 -04:00
Matthias Clasen
3f4008acb3 docs: Improve wl_pointer protocol docs
Some descriptions were missing here.
2013-04-01 19:56:41 -04:00
Matthias Clasen
53b57a63ee docs: Improve the wl_seat protocol docs
Expand the main description and tell if requests don't have
an effect.
2013-04-01 17:43:31 -04:00
Matthias Clasen
c63a59b802 docs: Improve wl_surface protocol docs
Use NULL consistently. And add some more information in a few
places.
2013-04-01 17:40:14 -04:00
Matthias Clasen
e38f433313 docs: Improve wl_shell/wl_shell_surface docs
Add missing summaries, expand descriptions.
2013-04-01 17:40:14 -04:00
Matthias Clasen
15ec6219e9 docs: Improve the wl_data_* procol docs
Add a few missing summaries and descriptions, spell out file
descriptor, use hyphens in drag-and-drop, don't use hyphens in
'mime type', and reword a few things.
2013-04-01 17:40:14 -04:00
Matthias Clasen
b02e58c718 docs: Improve wl_shm and wl_shm_pool protocol docs
Reword some paragraphs, and spell out 'file descriptor'.
2013-04-01 17:40:14 -04:00
Matthias Clasen
c84155d475 docs: Improve wl_callback protocol docs
Add some information about wl_callback and its done event.
2013-04-01 17:40:14 -04:00
Matthias Clasen
8aa7a690a5 docs: Improve the wl_registry protocol docs
Reword a few things, and add some details.
2013-04-01 17:40:14 -04:00
Matthias Clasen
a5cc5b32bb docs: Improve wl_display protocol docs
This adds a bit of information about in-order event delivery,
removes extraneous formatting, and adds a missing period.
2013-04-01 17:40:14 -04:00
Pekka Paalanen
7165bf2191 protocol: remove implicit attach semantics
To match the Weston commit e7144fd175d1d68b91aa0cec7ab63381b79385a9:
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Mar 4 12:11:41 2013 -0500

    compositor: Only send release event in response to wl_surface.attach

Remove the implicit attach semantics from wl_surface.commit and .attach.

Before, if you did this on a wl_surface: attach, commit, commit, you
would receive wl_buffer.release for both commits. After this change, you
will only receive wl_buffer.release for the first commit. To get a
second release, the same buffer must be attached again.

There is no need for the implicit attach on the second commit. If the
compositor needs the wl_buffer for repainting, it will not release it to
begin with. If the compositor does not need to keep the wl_buffer around
for repainting, it will not need it for a new commit either.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-03-19 16:49:20 -04:00
Ander Conselvan de Oliveira
e8fbce73c7 protocol: Add a wl_surface request for setting buffer transformation
This request allows a client to render its contents according to the
output transform, enabling the compositor to use optimizations such as
overlays, hardware cursors, scan out of a client buffer for
fullscreen surface, etc, even if the output is rotated.
2012-11-27 11:13:38 -05:00
Tiago Vignatti
5df752ab16 doc: Fix typos
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-11-23 22:51:51 -05:00
Kristian Høgsberg
173e160632 Fix distcheck by adding back protocol/Makefile.am
5909dddc78 removed protocol/Makefile.am
which meant protocol/wayland.xml no longer got included in the tarball.
Add back protocol/Makefile.am and configure.ac bits and add protocol to
subdirs in Makefile.am to fix this.
2012-11-19 17:11:58 -05:00
Kristian Høgsberg
3a671b4d3d protocol: Fix copy and paste summary 2012-11-19 15:44:14 -05:00
Kristian Høgsberg
94fd3d1dd4 protocol: Add summary description for wl_data_device_manager 2012-11-19 15:02:45 -05:00
Tiago Vignatti
5909dddc78 doc: Remove unused css and xslt for the protocol
This was added previously (commit 015c42e1) when we didn't have docbook
formatted documentation. Now it became quite useless.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-11-12 16:08:32 -02:00
Kristian Høgsberg
65eef9d817 wayland: Add protocol documentation for various interfaces 2012-10-21 22:08:08 -04:00
Pekka Paalanen
6c3e9b8f54 protocol: try to clarify wl_buffer doc
Fix few typos in wl_buffer description.

Mention backing storage in wl_buffer.destroy.

Try to clarify the wl_buffer.release semantics by not explaining what
*might* happen. It is important to not suggest, that if release does not
come before frame callback, it will not come before attaching a new
buffer to the surface. We want to allow the following scenario:

The compositor is able to texture from wl_buffers directly, but it also
keeps a copy of the surface contents. The copy is updated when the
compositor is idle, to avoid the performance hit on
wl_surface.attach/commit. When the copy completes some time later, the
server sends the release event. If the client has not yet allocated a
second buffer (e.g. it updates rarely), it can reuse the old buffer.

Reported-by: John Kåre Alsaker <john.kare.alsaker@gmail.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 11:06:51 -04:00
Pekka Paalanen
cb2296778d protocol: say update instead of repaint
wl_surface.commit itself does not force any repainting unless there is
damage, so change the wording to not imply repainting.

Reported-by: John Kåre Alsaker <john.kare.alsaker@gmail.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:52:40 -04:00
Jonas Ådahl
de1b471318 protocol: Clarify pointer axis event
Pointer axis events are in the same coordinate space as motion events.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-16 10:44:13 -04:00
Jonas Ådahl
36e29df2cb protocol: Clarify pointer axis event
Pointer axis events are in the same coordinate space as motion events.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-15 14:10:24 -04:00
Pekka Paalanen
eb5fae3226 protocol: clarify multiple wl_surface.attach
Explicitly say what happens with the wl_buffer.release event, if you
attach several wl_buffers without a commit in between.

Reported-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-11 09:58:28 -04:00
Pekka Paalanen
ae8d4b59a4 protocol: fix clarification of input region on drags and pointers
The previous clarification did not follow the current implementation in
Weston, where when a surface stops being a cursor or an icon, it becomes
a plain unmapped surface again.

Rewrite the related paragraphs, and fix some typos while at it.

For start drag, make it explicit of which surface argument we are
talking about.

v2:

Make the input region undefined when the use ends. Most likely no-one
will re-use these surfaces for anything else than the same use case, so
leave some slack for the implementations to avoid useless work on
resetting the regions.

Reported-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-11 09:45:22 -04:00
Pekka Paalanen
e09ac6450b protocol: elaborate on wl_buffer
Spell out exactly when a client may re-use a wl_buffer or its backing
storage. Mention the optimization for GL-compositor with wl_shm-clients.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 22:01:17 -04:00
Pekka Paalanen
a4fd9e6583 protocol: wl_surface.frame needs wl_surface.commit
Clarify, when frame request takes effect.
Explain when to send/receive the callback.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 22:01:17 -04:00
Pekka Paalanen
b61c0f47d5 protocol: clarify input region on drags and pointers
Drag icon and cursor surfaces must never receive input, so their input
region is always empty.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 22:01:17 -04:00
Pekka Paalanen
39624020fc protocol: double-buffered state for wl_surface
This change breaks the protocol.

The current protocol is racy in that updates to surface content and
surface state (e.g. damage, input and opaque regions) are not guaranteed
to happen at the same time. Due to protocol buffering and handling
practices, the issues are very hard to trigger.

Committing damage to a surface at arbitrary times makes it hard to
track when the wl_buffer is being read by the server, and when it is
safe to overwrite (the case of wl_shm with a single buffer reused
constantly).

This protocol change introduces the concept of double-buffered state.
Such state is accumulated and cached in the server, unused, until the
final commit request. The surface will receive its new content and apply
its new state atomically.

A wl_surface.commit request is added to the protocol. This is thought to
be more clear, than having wl_surface.attach committing implicitly, and
then having another request to commit without attaching, as would be
required for a GL app that wants to change e.g. input region without
redrawing.

When these changes are implemented, clients do not have to worry about
ordering damage vs. input region vs. attach vs. ... anymore. Clients set
the state in any order they want, and kick it all in with a commit.

The interactions between wl_surface.attach, (wl_surface.commit,)
wl_buffer.release, and wl_buffer.destroy have been undocumented. Only
careful inspection of the compositor code has told when a wl_buffer is
free for re-use, especially for wl_shm and wrt. wl_surface.damage.
Try to clarify how it all should work, and what happens if the wl_buffer
gets destroyed.

An additional minor fix: allow NULL argument to
wl_surface.set_opaque_region. The wording in the documentation already
implied that a nil region is allowed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 22:01:17 -04:00
Kristian Høgsberg
9fe75537ad Split the global registry into its own wl_registry object
The only way to make the global object listener interface thread safe is to
make it its own interface and make different listeners different wl_proxies.
The core of the problem is the callback we do when a global show up or
disappears, which we can't do with a lock held.  On the other hand we can't
iterate the global list or the listener list without a lock held as new
globals or listeners may come and go during the iteration.

Making a copy of the list under the lock and then iterating after dropping
the lock wont work either.  In case of the listener list, once we drop the
lock another thread may unregister a listener and destroy the callbackk
data, which means that when we eventually call that listener we'll pass it
free memory and break everything.

We did already solve the thread-safe callback problem, however.  It's what
we do for all protocol events.  So we can just make the global registry
functionality its own new interface and give each thread its own proxy.
That way, the thread will do its own callbacks (with no locks held) and
destroy the proxy when it's no longer interested in wl_registry events.
2012-10-10 20:59:00 -04:00
Kristian Høgsberg
85a6a47087 scanner: Send interface name and version for types new_id args
This makes the scanner generate the code and meta data to send the
interface name and version when we pass a typeless new_id.  This way, the
generic factory mechanism provided by wl_display.bind can be provided by
any interface.
2012-10-10 20:59:00 -04:00
Tiago Vignatti
b41dc10063 wayland: Fix typos
My vim spell checker is able to find typos of xml files after adding "syn spell
toplevel" to ~/.vim/after/syntax/xml.vim

aah, and Wayland is capital letter :)

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-09 22:45:48 -04:00
Tiago Vignatti
35d8da8ef6 protocol: Fix typo
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-09-25 10:15:17 -04:00
Diego Viola
4b681a7fd4 Fix typo (ratio, not ration)
Signed-off-by: Diego Viola <diego.viola@gmail.com>
2012-09-13 11:31:44 -04:00
Scott Moreau
599a455fb4 protocol: Fix typo. 2012-08-16 10:49:48 -04:00
Andre Heider
7f3d22776b protocol: Remove "repeat" from "key_state"
This is unused and apparently was never implemented.
2012-07-31 22:35:45 -04:00
Kristian Høgsberg
eadb68ec32 protocol: Add transform argument to wl_output.geometry event 2012-07-22 15:50:37 -04:00
Martin Olsson
fc0c2e04c5 doc: fix some typos in documentation 2012-07-09 18:03:56 -04:00
Ander Conselvan de Oliveira
84bac043e1 protocol: Add missing allow-null to data_device.enter data_offer field
Fixes bug 51889.
2012-07-09 18:00:31 -04:00
Kristian Høgsberg
8a023688c0 protocol: Add a couple of missing allow-null annotations
wl_data_device.set_selection() allows NULL to withdraw the previously set
selection and wl_surface.attach() allows a NULL buffer to hide the surface.
2012-07-02 14:34:48 -04:00
Christopher James Halse Rogers
11db60fe72 protocol: Explicitly mark requests which allow null arguments
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-07-02 13:53:06 -04:00