Jason Ekstrand [Tue, 18 Jun 2013 17:42:40 +0000 (12:42 -0500)]
Free non-legacy resources inside wl_resource_destroy
This commit makes wl_resource_destroy automatically free all non-legacy
resource structures. Since wl_resource is now an opaque structure it
doesn't make sense for the clients to be freeing it. This checks to make
sure that it was added through wl_client_add_object or wl_client_new_object
and not wl_client_add_resource before it frees it. This way if it is a
legacy resources embedded in a structure somewhere we don't have an invalid
free.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Ander Conselvan de Oliveira [Tue, 11 Jun 2013 15:21:32 +0000 (18:21 +0300)]
doc: Add a small contributing guide
Document what we expect in terms of commit messages and coding style.
New contributors are usually unaware of this, so it is good to have a
document to point them too.
Kristian Høgsberg [Sun, 17 Mar 2013 18:21:48 +0000 (14:21 -0400)]
client: Add wl_display_prepare_read() API to relax thread model assumptions
The current thread model assumes that the application or toolkit will have
one thread that either polls the display fd and dispatches events or just
dispatches in a loop. Only this main thread will read from the fd while
all other threads will block on a pthread condition and expect the main
thread to deliver events to them.
This turns out to be too restrictive. We can't assume that there
always will be a thread like that. Qt QML threaded rendering will
block the main thread on a condition that's signaled by a rendering
thread after it finishes rendering. This leads to a deadlock when the
rendering threads blocks in eglSwapBuffers(), and the main thread is
waiting on the condition. Another problematic use case is with games
that has a rendering thread for a splash screen while the main thread
is busy loading game data or compiling shaders. The main thread isn't
responsive and ends up blocking eglSwapBuffers() in the rendering thread.
We also can't assume that there will be only one thread polling on the
file descriptor. A valid use case is a thread receiving data from a
custom wayland interface as well as a device fd or network socket.
The thread may want to wait on either events from the wayland
interface or data from the fd, in which case it needs to poll on both
the wayland display fd and the device/network fd.
The solution seems pretty straightforward: just let all threads read
from the fd. However, the main-thread restriction was introduced to
avoid a race. Simplified, main loops will do something like this:
wl_display_dispatch_pending(display);
/* Race here if other thread reads from fd and places events
* in main eent queue. We go to sleep in poll while sitting on
* events that may stall the application if not dispatched. */
poll(fds, nfds, -1);
/* Race here if other thread reads and doesn't queue any
* events for main queue. wl_display_dispatch() below will block
* trying to read from the fd, while other fds in the mainloop
* are ignored. */
wl_display_dispatch(display);
The restriction that only the main thread can read from the fd avoids
these races, but has the problems described above.
This patch introduces new API to solve both problems. We add
int wl_display_prepare_read(struct wl_display *display);
and
int wl_display_read_events(struct wl_display *display);
wl_display_prepare_read() registers the calling thread as a potential
reader of events. Once data is available on the fd, all reader
threads must call wl_display_read_events(), at which point one of the
threads will read from the fd and distribute the events to event
queues. When that is done, all threads return from
wl_display_read_events().
From the point of view of a single thread, this ensures that between
calling wl_display_prepare_read() and wl_display_read_events(), no
other thread will read from the fd and queue events in its event
queue. This avoids the race conditions described above, and we avoid
relying on any one thread to be available to read events.
Jason Ekstrand [Fri, 14 Jun 2013 15:07:52 +0000 (10:07 -0500)]
server: Add aditional wl_resource accessors
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Rob Bradford [Wed, 12 Jun 2013 17:17:45 +0000 (18:17 +0100)]
protocol: Add missing since attribute for name event on wl_seat
This event was added in version 2 of the protocol.
Rob Bradford [Wed, 12 Jun 2013 17:17:44 +0000 (18:17 +0100)]
build: Fix warning message on syscall failures
Kristian Høgsberg [Fri, 7 Jun 2013 05:00:30 +0000 (01:00 -0400)]
server: Add wl_resource_get_id()
Jason Ekstrand [Wed, 5 Jun 2013 14:52:39 +0000 (09:52 -0500)]
Update tests for wl_map changes and add a map_flags test
Jason Ekstrand [Wed, 5 Jun 2013 21:39:51 +0000 (16:39 -0500)]
Remove incorrect sanity-check from wl_map_insert_at
I got a little over-eager with my sanity checks and didn't realize that the
client uses wl_map_insert_at to mark objects as zombies when they come from
the server-side.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Wed, 5 Jun 2013 21:39:50 +0000 (16:39 -0500)]
Change WL_ZOMBIE_OBJECT from 0x2 to an actual pointer
In order to use the second-lowest bit of each pointer in wl_map for the
WL_MAP_ENTRY_LEGACY flag, every pointer has to be a multiple of 4. This
was a good assumption, except with WL_ZOMBIE_OBJECT. This commit creates
an actual static variable to which WL_ZOMBIE_OBJECT now points. Since
things are only every compared to WL_ZOMBIE_OBJECT with "==" or "!=", the
only thing that matters is that it is unique.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Kristian Høgsberg [Wed, 5 Jun 2013 05:07:28 +0000 (01:07 -0400)]
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.
Jason Ekstrand [Sat, 1 Jun 2013 22:40:54 +0000 (17:40 -0500)]
Add accessor functions for wl_resource and deprecate wl_client_add_resource
This is the first step towards making wl_resource an opaque pointer type.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Sat, 1 Jun 2013 22:40:53 +0000 (17:40 -0500)]
Add support for flags in the wl_map API and add a WL_MAP_ENTRY_LEGACY flag
The implementation in this commit allows for one bit worth of flags. If
more flags are desired at a future date, then the wl_map implementation
will have to change but the wl_map API will not.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Sat, 1 Jun 2013 22:40:52 +0000 (17:40 -0500)]
Add a "side" field and some sanity checks to wl_map.
The original wl_map implementation did no checking to ensures that ids fell
on the correct side of the WL_SERVER_ID_START line. This meant that a
client could send the server a server ID and it would happily try to use
it. Also, there was no distinction between server-side and client-side in
wl_map_remove. Because wl_map_remove added the entry to the free list
regardless of which side it came from, the following set of actions would
break the map:
1. Client creates a bunch of objects
2. Client deletes one or more of those objects
3. Client does something that causes the server to create an object
Because of the problem in wl_map_remove, the server would take an old
client-side id, apply the WL_SERVER_ID_START offset, and try to use it as a
server-side id regardless of whether or not it was valid.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Rob Bradford [Fri, 31 May 2013 17:08:23 +0000 (18:08 +0100)]
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.
Rob Bradford [Tue, 4 Jun 2013 12:27:49 +0000 (13:27 +0100)]
build: Add declaration checks to check for required syscall flags
The required flags are relatively new and some older enterprise distributions
do not feature them.
https://bugs.freedesktop.org/show_bug.cgi?id=63360
Alexander Larsson [Tue, 28 May 2013 14:20:52 +0000 (16:20 +0200)]
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).
Alexander Larsson [Fri, 24 May 2013 11:08:41 +0000 (13:08 +0200)]
protocol: Use signed int for scale values
We usually use signed ints for things like this, to avoid
issues C sign coersion.
Alexander Larsson [Thu, 16 May 2013 13:49:36 +0000 (15:49 +0200)]
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.
Alexander Larsson [Thu, 16 May 2013 13:49:35 +0000 (15:49 +0200)]
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.
Peng Wu [Tue, 21 May 2013 06:45:30 +0000 (14:45 +0800)]
protocol: Fix documentation typo
Kristian Høgsberg [Wed, 8 May 2013 13:45:59 +0000 (09:45 -0400)]
server: Drop struct wl_surface
This struct was only defined in the server API for the purpose of the
input structs and helper functions. Now that those are gone we can dro it.
Kristian Høgsberg [Thu, 18 Apr 2013 19:07:23 +0000 (15:07 -0400)]
Remove input structs
Looking at the functionality in the server library, it's clear (in
hindsight) that there are two different "things" in there: 1) The IPC
API, that is, everything that concerns wl_display, wl_client,
wl_resource and 2) and half-hearted attempt at sharing input code and
focus logic that leaves a lot of problematic structs in the API
surface, only to share less than 1000 lines of code.
We can just move those input structs and helper functions into weston
and cut libwayland-server down to just the core server side IPC API.
In the short term, compositors can copy those structs and functions
into their source, but longer term, they're probably better off
reimplementing those objects and logic their native framework
(QObject, GObject etc).
Kristian Høgsberg [Mon, 29 Apr 2013 20:42:40 +0000 (16:42 -0400)]
configure.ac: Bump to 1.1.90 to open master for 1.2 work
Peter Hutterer [Wed, 17 Apr 2013 20:33:01 +0000 (06:33 +1000)]
protocol: revert hotspot_x/y in set_cursor back to int
copy/paste error introduced in
9c0357af6ee42c318ce37b458ae7bdb7d51316cb
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Rob Bradford [Wed, 17 Apr 2013 17:28:42 +0000 (18:28 +0100)]
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.
Kristian Høgsberg [Tue, 16 Apr 2013 00:55:33 +0000 (20:55 -0400)]
configure.ac: Bump version to 1.1.0
Kristian Høgsberg [Tue, 16 Apr 2013 00:50:52 +0000 (20:50 -0400)]
docs: Create html-pdf directories too
Fixes make dist here.
Peter Hutterer [Thu, 4 Apr 2013 01:29:01 +0000 (11:29 +1000)]
doc: use a dynamic list of man pages
This requires that doxygen is run before the man target so find can actually
find the man pages.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Apr 2013 01:29:00 +0000 (11:29 +1000)]
doc: Improve "Library" and "Compositors" chapter
Originally written Tiago Vignatti <tiago.vignatti@intel.com>
Some modifications to adjust for previously merged conflicting patches and link
to the sections (instead of <emphasis>).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Apr 2013 01:28:59 +0000 (11:28 +1000)]
doc: create a fake make target to de-duplicate the xml merging process
The only difference between the server and client xml files is the
directories and files being named *server* and *client*, respectively. Add a
new make target to get that process done to avoid duplication
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Apr 2013 01:28:58 +0000 (11:28 +1000)]
doc: generate server documentation from XML too
Same as WaylandClientAPI.xml we now also generate WaylandServerAPI.xml for
publication. Most of this hunk is just adding a client/ or server/ into the
xml path to keep the two separate.
The change in wayland.doxygen now causes a standard doxygen call to not
generate anything - what is generated is specified through the options
passed by make.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tiago Vignatti [Thu, 4 Apr 2013 01:28:57 +0000 (11:28 +1000)]
doc: Capitalize all Wayland occurrences
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
[re-run of search/replace after rebasing]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Apr 2013 01:06:02 +0000 (11:06 +1000)]
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>
Rob Bradford [Thu, 4 Apr 2013 16:26:57 +0000 (17:26 +0100)]
wayland-client: Avoid null dereference when handling deletion
If an unknown id is deleted then the lookup in the map will return NULL and
so we should avoid dereferencing that.
As this is unexpected behaviour log a message about the problem too.
Kristian Høgsberg [Wed, 3 Apr 2013 20:26:14 +0000 (16:26 -0400)]
docs: Use MIT for documentation license
Kristian Høgsberg [Wed, 3 Apr 2013 20:22:44 +0000 (16:22 -0400)]
configure.ac: Fix publican version check
This sure is ugly - we feed output of publican -v into bc to compare
against minimum required version, 2.8. That's bad enough, but when
publican suddenly report 3.0.0, bc starts complaining...
Use sed to filter out 3.0 from the 'version=3.0.0' output from publican
instead. Seem a little more robust, but it's just a matter of time before
something else breaks this flaky setup.
Hey, publican, how about shipping .pc files?
Peter Hutterer [Wed, 3 Apr 2013 19:43:34 +0000 (15:43 -0400)]
doc: rename "Wayland" to "publican"
This directory was called Wayland during my early tries with publican where
the source layout was different and it needed to be set to the same name as
the publican output directory. This reason doesn't exist anymore, so re-name
it to publican to make it more obvious what's hiding in here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Apr 2013 01:08:59 +0000 (11:08 +1000)]
doc: generate man pages from doxygen
Create client-side and server-side man pages from doxygen. The doxygen
config options are virtually the same as for the XML output, but we do pass
in the specific options via stdin.
WL_EXPORT is predefined to the empty string, it makes the man page look
confusing and provides no value here anyway. This applies for both xml and
man output.
JAVADOC_AUTOBRIEF is disabled for man pages, the formatting in the resulting
man page is IMO hard to read.
Most of the server man pages are virtually empty, there's just not enough
documentation in the source files.
Interesting issue: the usage of @code in the protocol to reference the
parameter breaks the expansion of WL_EXPORT, thus leaving us with WL_EXPORT
in all the man pages.
Presumably this is an issue with doxygen interpreting this as a @code
command, but I already wasted enough time narrowing this down.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Apr 2013 19:27:43 +0000 (15:27 -0400)]
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>
Peter Hutterer [Mon, 1 Apr 2013 23:58:17 +0000 (09:58 +1000)]
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>
Peter Hutterer [Mon, 1 Apr 2013 23:58:16 +0000 (09:58 +1000)]
protocol: use "summary", not "description" for xkb_v1 format
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Apr 2013 00:09:12 +0000 (10:09 +1000)]
doc: don't start a variable list if we have no sub-elements
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Apr 2013 00:09:11 +0000 (10:09 +1000)]
doc: improve formatting of client-side documentation
A bunch of changes to the xsl transformation stylesheet to make Chapter 4
(Client API) look nicer and more readable.
Main changes:
- function synopsis listed
- lists for parameters and return values
- long function descriptions
- misc other hooks for "see also", "note", etc
The long description is a sore point. doxygen xml output is difficult to
parse with the output being in the form of
<detailed description>
<para>
<parameterlist> .... </parameterlist>
<simplesect kind="return">... </simplesect>
First paragraph of long description
</para>
<para>
Second paragraph of long <sometag>description</sometag>
</para>
</detaileddescription>
So we need to ignore parameterlist and simplesect, but extract the text from
everything else. Any improvements on that welcome.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Apr 2013 00:09:10 +0000 (10:09 +1000)]
doc: change wording in section introduction
If we don't have descriptions of classes, the "And" is awkward.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Apr 2013 00:09:09 +0000 (10:09 +1000)]
doc: add wayland.doxygen as target dependency
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Apr 2013 19:02:29 +0000 (15:02 -0400)]
Rename en_US to sources
The reason this directory exists is because we need to copy it into
$builddir so we can combine it with generated sources (we can't pass
multiple source paths into publican).
So instead of having en_US, renamed to en-US stop the confusion and rename
the sources to "sources". That gets copied to en-US which will then contain
the actual output.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Apr 2013 00:09:07 +0000 (10:09 +1000)]
doc: explain the publican build process
This makefile is a bit hard to read due to some publican requirements and
the need to generate some files through XSLT. Explain the lot, so that those
looking at this roughly know what will hit them.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Apr 2013 00:09:06 +0000 (10:09 +1000)]
doc: clarify how ClientAPI.xml is built
I found the comment a bit confusing and it's quite hard to read. re-explain
with a simple step-by-step list
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tiago Vignatti [Tue, 2 Apr 2013 00:09:05 +0000 (10:09 +1000)]
doc: Format Chapter 4 paragraphs correctly
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Peter Hutterer [Tue, 2 Apr 2013 00:09:03 +0000 (10:09 +1000)]
doc: minor title wording fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tiago Vignatti [Tue, 2 Apr 2013 00:09:00 +0000 (10:09 +1000)]
doc: Change chapter title to a more descriptive one
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tiago Vignatti [Tue, 2 Apr 2013 00:08:59 +0000 (10:08 +1000)]
doc: Rename Overview.xml to Introduction.xml
Rename Overview.xml to Introduction.xml, reflecting the previous commit.
Organize also Wayland.xml order of the includes.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tiago Vignatti [Tue, 2 Apr 2013 00:08:58 +0000 (10:08 +1000)]
doc: Improve the first chapter text and definitions
In the beginning of the chapter, it was defined what is the so called "X"
thing and was removed the "Wayland" and "Weston" definitions cause we're
defining later at 1.2 anyway.
"Introduction", "Motivation" and "Compositing manager as the display server"
names sound better a bit than "Overview", "Replacing X11" and "Make the
compositing manager the display server" respectively. That was changed also.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tiago Vignatti [Tue, 2 Apr 2013 00:08:57 +0000 (10:08 +1000)]
doc: Set book edition number to the "1"
"1" sounds better when we mention about the "first" edition or say the
"publishing" edition.
If needed, we might want to increase the edition numbers automatically later,
for instance based on the micro version of the protocol or something like
that.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tiago Vignatti [Tue, 2 Apr 2013 00:08:56 +0000 (10:08 +1000)]
doc: Add a Foreword and a Preface
In particular, the preface defines the scope of this document we're building
-- is the definition there enough with respect to what we want with this?
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Apr 2013 00:08:55 +0000 (10:08 +1000)]
doc: don't add a para for an empty summary
Removes enough empty lines to cut the PDF down by 4 pages.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Giulio Camuffo [Wed, 3 Apr 2013 15:29:16 +0000 (17:29 +0200)]
utils: const-ify some function arguments
Rob Bradford [Wed, 3 Apr 2013 14:20:49 +0000 (15:20 +0100)]
wayland-server: Listen for pointer current surface destruction
Add a destroy listener so that when the current surface associated with the
pointer is destroyed we can reset the pointer to the current surface. In order
to achieve this add a wl_pointer_set_current() which handles assigning the
surface and creating the listener.
This resolves a use-after-free error triggered with nested popup surfaces
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=696946
Kristian Høgsberg [Wed, 3 Apr 2013 01:31:02 +0000 (21:31 -0400)]
docs: Document non-blocking behaviour of wl_display_flush()
Giulio Camuffo [Thu, 28 Mar 2013 13:55:51 +0000 (14:55 +0100)]
server: use void* instead of function pointer for wl_object.implementation
This is needed to make C++ programs that include wayland-server.h build:
C++ does not allow conversions from data pointers to function pointers.
Giulio Camuffo [Tue, 2 Apr 2013 20:29:46 +0000 (22:29 +0200)]
server: use the right function pointer type in wl_signal_get
use the wl_notify_func type, and not void *, or else wl_signal_get
will not be usable by a c++ plugin because it will not cast
void * to a function pointer.
Matthias Clasen [Sat, 30 Mar 2013 18:09:25 +0000 (14:09 -0400)]
docs: Add information about serials and timestamps
Add some information about serials, timestamps and their uses
to the Input section in the protocol overview.
Matthias Clasen [Sat, 30 Mar 2013 18:09:24 +0000 (14:09 -0400)]
docs: Document granularity of timestamps
This information is necessary to make any use of these fields.
Kristian Høgsberg [Tue, 2 Apr 2013 00:06:36 +0000 (20:06 -0400)]
docs: Remove mention of touch focus
There is no focused surface for a touch screen.
Matthias Clasen [Sat, 30 Mar 2013 05:11:47 +0000 (01:11 -0400)]
docs: Add details about grabs
Mention implicit grabs, (lack of) explicit grabs, and popup
windows.
Matthias Clasen [Sat, 30 Mar 2013 05:11:46 +0000 (01:11 -0400)]
docs: Add details about surfaces
Mention some of the characteristic differences to X:
no global positions, no access to foreign windows.
Matthias Clasen [Sat, 30 Mar 2013 05:11:45 +0000 (01:11 -0400)]
docs: Improve wl_region protocol docs
Just cosmetic changes, a few missing periods, and ID was
not capitalized.
Matthias Clasen [Sat, 30 Mar 2013 05:11:44 +0000 (01:11 -0400)]
docs: Improve the wl_output protocol docs
Some descriptions were missing.
Matthias Clasen [Sat, 30 Mar 2013 05:11:43 +0000 (01:11 -0400)]
docs: Improve wl_touch protocol docs
Some descriptions were missing here.
Matthias Clasen [Sat, 30 Mar 2013 05:11:42 +0000 (01:11 -0400)]
docs: Improve wl_keyboard protocol docs
Some descriptions were missing here.
Matthias Clasen [Sat, 30 Mar 2013 05:11:41 +0000 (01:11 -0400)]
docs: Improve wl_pointer protocol docs
Some descriptions were missing here.
Matthias Clasen [Sat, 30 Mar 2013 05:11:40 +0000 (01:11 -0400)]
docs: Improve the wl_seat protocol docs
Expand the main description and tell if requests don't have
an effect.
Matthias Clasen [Sat, 30 Mar 2013 05:11:39 +0000 (01:11 -0400)]
docs: Improve wl_surface protocol docs
Use NULL consistently. And add some more information in a few
places.
Matthias Clasen [Sat, 30 Mar 2013 05:11:38 +0000 (01:11 -0400)]
docs: Improve wl_shell/wl_shell_surface docs
Add missing summaries, expand descriptions.
Matthias Clasen [Sat, 30 Mar 2013 05:11:37 +0000 (01:11 -0400)]
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.
Matthias Clasen [Sat, 30 Mar 2013 05:11:36 +0000 (01:11 -0400)]
docs: Improve wl_shm and wl_shm_pool protocol docs
Reword some paragraphs, and spell out 'file descriptor'.
Matthias Clasen [Sat, 30 Mar 2013 05:11:35 +0000 (01:11 -0400)]
docs: Improve wl_callback protocol docs
Add some information about wl_callback and its done event.
Matthias Clasen [Sat, 30 Mar 2013 05:11:34 +0000 (01:11 -0400)]
docs: Improve the wl_registry protocol docs
Reword a few things, and add some details.
Matthias Clasen [Sat, 30 Mar 2013 05:11:33 +0000 (01:11 -0400)]
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.
Matthias Clasen [Sat, 30 Mar 2013 05:11:32 +0000 (01:11 -0400)]
docs: Consistency fixes
Say 'object ID' throughout.
Matthias Clasen [Sat, 30 Mar 2013 05:11:31 +0000 (01:11 -0400)]
doc: Improve various sections of the documentation
Matthias Clasen [Sat, 30 Mar 2013 05:11:30 +0000 (01:11 -0400)]
docs: Improve the 'Connect time' section
Turn the bullet-point list into complete sentences.
Matthias Clasen [Sat, 30 Mar 2013 05:11:29 +0000 (01:11 -0400)]
docs: Improve the 'Types of Compositors' section
Turn the bullet-point lists into full paragraphs.
Matthias Clasen [Sat, 30 Mar 2013 05:11:28 +0000 (01:11 -0400)]
docs: Slight rewording
The Wayland Protocol -> Wayland Protocol Overview, to align
better with the subsequent Wayland Protocol Specification.
Matthias Clasen [Sat, 30 Mar 2013 05:11:27 +0000 (01:11 -0400)]
docs: Reorder some sections
Move the 'Types of Compositors' section right after the Overview,
and move the 'Client API' part after the protocol spec.
Rob Bradford [Thu, 28 Mar 2013 18:48:09 +0000 (18:48 +0000)]
wayland-server: Avoid deferencing a NULL pointer in error case
Reorder the error handling in the case that closure is NULL due to ENOMEM to
ensure that we can safely call wl_closure_lookup_objects on the second test.
Prior to this reordering the closure would be deferenced in the ENOMEM case
due to the invocation of the second half of the logical OR check.
Matthias Clasen [Thu, 28 Mar 2013 13:10:32 +0000 (09:10 -0400)]
docs: Fix the documentation build
The publican man page says that the options are actually called
--formats and --langs, and with this, the doc build succeeds.
Matthias Clasen [Thu, 28 Mar 2013 13:10:31 +0000 (09:10 -0400)]
docs: Add a revision history
Publican complains if it can't find this file.
Pekka Paalanen [Thu, 7 Mar 2013 11:10:01 +0000 (13:10 +0200)]
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>
Jason Ekstrand [Sat, 9 Mar 2013 04:26:13 +0000 (22:26 -0600)]
Add wl_resource_init and use it in libwayland implementations of data sharing and SHM
This commit adds a wl_resource_init function for initializing wl_resource
structures similar to wl_client_add_object.
From this commit forward, wl_resource structures should not be initialized
manually, but should use wl_resource_init. In the event of a change to the
wl_resource structure, this allows us to protect against regressions by filling
in added fields with reasonable defaults. In this way, while changing
wl_object or wl_resource still constitutes an ABI break, compositors following
this rule will only need to be recompiled in order to properly link against the
new version.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Sat, 9 Mar 2013 04:26:12 +0000 (22:26 -0600)]
Change wl_closure_invoke to take an opcode instead of an actual function pointer
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jonas Ådahl [Fri, 8 Mar 2013 17:44:16 +0000 (18:44 +0100)]
client: Invoke new_id closure arguments as pointers instead of integers
This commit adds a flags parameter to wl_closure_invoke(). The so far
added flags are ment to specify if the invokation is client side or
server side. When on the server side, closure arguments of type 'new_id'
should be invoked as a integer id while on the client side they should
be invoked as a pointer to a proxy object.
This fixes a bug happening when the address of a client side 'new_id'
proxy object did not fit in a 32 bit integer.
krh: Squashed test suite compile fix from Jason Ekstrand.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Thu, 7 Mar 2013 22:32:39 +0000 (23:32 +0100)]
client: Check reference count only for destroyed proxies
The llvm static analyzer tool reported "Use of memory after it is freed"
in dispatch_event() because the proxy is used after being freed if the
reference count reaches zero without the destroyed flag being set. This
would never happen in practice because the owner of the proxy object
always holds a reference until calling wl_proxy_destroy() which would
also set the destroyed flag.
Since this is the case, it is safe to do the reference count check only
if the destroyed flag is set, as it can never reach zero if not.
This commit doesn't change the behavior of the function, but makes the
static analyzer more happy.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=61385
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Kristian Høgsberg [Sun, 17 Mar 2013 17:53:29 +0000 (13:53 -0400)]
configure.ac: Use wayland_version macro in bug url
Kristian Høgsberg [Tue, 26 Feb 2013 18:40:34 +0000 (13:40 -0500)]
Stylistic nitpicking
No space between '!' and its argument, prefer i++ over ++i.
Jason Ekstrand [Tue, 26 Feb 2013 16:30:51 +0000 (11:30 -0500)]
Clean up and refactor wl_closure and associated functions
The primary purpose of this patch is to clean up wl_closure and separate
closure storage, libffi, and the wire format. To that end, a number of changes
have been made:
- The maximum number of closure arguments has been changed from a magic number
to a #define WL_CLOSURE_MAX_ARGS
- A wl_argument union has been added for storing a generalized closure
argument and wl_closure has been converted to use wl_argument instead of the
combination of libffi, the wire format, and a dummy extra buffer. As of
now, the "extra" field in wl_closure should be treated as bulk storage and
never direclty referenced outside of wl_connection_demarshal.
- Everything having to do with libffi has been moved into wl_closure_invoke
and the convert_arguments_to_ffi helper function.
- Everything having to do with the wire format has been restricted to
wl_connection_demarshal and the new static serialize_closure function. The
wl_closure_send and wl_closure_queue functions are now light wrappers around
serialize_closure.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Pekka Paalanen [Tue, 26 Feb 2013 13:19:44 +0000 (15:19 +0200)]
client: add wl_proxy_get_class()
This is a useful shorthand for client application debugging macros,
since you can ask the object class from the object itself.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Kristian Høgsberg [Mon, 25 Feb 2013 21:01:38 +0000 (16:01 -0500)]
scanner: Fix 'destroy)' typo in check for destroy request presence
This is there to enforce that we don't have interfaces with a destroy
request that isn't a destructor. The check never worked because of the
typo, but we also don't have any interfaces like that.
Ran Benita [Mon, 25 Feb 2013 15:12:51 +0000 (17:12 +0200)]
scanner: remove list_length in favor of wl_list_length