Commit graph

959 commits

Author SHA1 Message Date
Kristian Høgsberg
f72c0c2a24 Add COPYING 2012-04-25 10:12:21 -04:00
Kristian Høgsberg
e7dd32710f tests: Test invoking closures built with wl_closure_vmarshal() 2012-04-22 14:17:27 -04:00
Kristian Høgsberg
243672cd3c connection: Make sure we can invoke closures built with wl_closure_vmarshal() 2012-04-22 14:17:20 -04:00
Kristian Høgsberg
1901d66ffc connection: Move closure object out of wl_connection 2012-04-22 13:49:35 -04:00
Kristian Høgsberg
0d6dea17b4 connection: Dont put fds in the connection until we send the closure 2012-04-21 23:50:13 -04:00
Kristian Høgsberg
9d37682db3 Update TODO
Casey did surface.enter/leave.
2012-04-20 13:43:08 -04:00
Casey Dahlin
a5df3de101 Add wl_surface.enter and wl_surface.leave events
These events let us track when a surface enters or leaves the scanout region of
an output. This way if a surface moves to another output and that output is on
a different card, we can suggest the toolkit reallocate its buffers
appropriately.

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
2012-04-20 10:45:38 -04:00
Pekka Paalanen
f52a901f88 tests: add .gitignore
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-20 16:28:15 +03:00
Pekka Paalanen
7134a439c1 os: wrap socket(SOCK_CLOEXEC) calls
Some system C libraries do not offer SOCK_CLOEXEC flag.

Add a new header for OS compatibility wrappers. Wrap socket() calls into
wl_os_socket_cloexec() which makes sure the O_CLOEXEC flag gets set on
the file descriptor.

On systems having SOCK_CLOEXEC this uses the old socket() call, and
falls back if it fails due to the flag (kernel not supporting it).

wayland-os.h is private and not exported.

Add close-on-exec tests for both normal and forced fallback paths.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-20 16:26:37 +03:00
Pekka Paalanen
da6b1a8e47 tests: support testing fd inheritance over exec
Add facility for testing how (many) file descriptors survive an exec.
This allows implementing O_CLOEXEC tests.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-20 15:06:27 +03:00
Pekka Paalanen
7c0aa1a4a3 tests: plug fd leaks in free_source_with_data
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-20 14:58:31 +03:00
Pekka Paalanen
e0561ac68d tests: detect fd leaks
Detect file descriptor leaks in tests.

Add a sanity test to verify that we catch the leaks.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-20 14:58:31 +03:00
Scott Moreau
2896b6a220 protocol: Add ping event and corresponding pong request 2012-04-19 12:48:55 -04:00
Kristian Høgsberg
d44074900d tests: Add more sanity test to make sure we catch different failure modes 2012-04-19 12:37:40 -04:00
Kristian Høgsberg
41570a5ed9 tests: Make sure unused malloc() doesn't get optimized away 2012-04-19 12:07:20 -04:00
Pekka Paalanen
55489883c4 tests: add sanity-test
Test the testing framework itself, so that it catches the errors we
expect it to.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 14:46:52 +03:00
Pekka Paalanen
bb74adbc4d tests: add support for tests expected to fail
Add a new macro FAIL_TEST that can be used to define tests that are
supposed to fail. To distinguish the supposed outcome of a test, add a
field to 'struct test'.

However, simply adding a field to 'struct test' will make all tests past
the first one in an executable to be garbage. Apparently, the variables
of type 'struct test' have different alignment when put into a special
section than otherwise, and the compiler will get the skip from one
'struct test' to the next wrong.

Explicitly specify the alingment of 'struct test' to be 16 bytes, which
is what it seems to be in the special section on x86_64.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 14:26:51 +03:00
Pekka Paalanen
56426d8a4a tests: stylish test-runner.c
Fix a typo, add a comment, change the print format, and add a variable
that will ease implementing tests that are expected to fail.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 14:06:08 +03:00
Pekka Paalanen
b1d4eb24c6 tests: fail build if NDEBUG is defined
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 12:14:19 +03:00
Pekka Paalanen
84464a3e9b tests: put common test source files in a variable
Makes all test targets have the same common make dependencies.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 12:12:13 +03:00
Pekka Paalanen
b7c7963f16 Fix printf format warnings
connection.c:530: warning: format '%lu' expects type 'long unsigned
int', but argument 2 has type 'unsigned int'

/connection.c:560: warning: format '%lu' expects type 'long unsigned
int', but argument 2 has type 'unsigned int'

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-17 15:02:15 -04:00
Kristian Høgsberg
677c5180e6 data-device: Take away pointer focus when we start a dnd drag 2012-04-13 12:51:40 -04:00
Kristian Høgsberg
a9f951b003 data-device: Record the serial number for the current selection
And reject setting a selection that's older than our current selection.
2012-04-13 12:48:38 -04:00
Kristian Høgsberg
74aec06625 data-device: Clear drag focus when we end the drag-and-drop
Otherwise we'll see a spurious leave event when we start the next dnd.
2012-04-13 10:39:24 -04:00
Kristian Høgsberg
b68b5e9e0c tests: Make leak check work again by setting default visibility for malloc/free
We compile the test cases with -fvisibility=hidden which makes
our malloc/free wrappers fail to override system malloc/free.
2012-04-13 10:13:49 -04:00
Kristian Høgsberg
d8b66a00f4 tests: Fix warning in memory leak assert 2012-04-13 10:13:21 -04:00
Kristian Høgsberg
ac06144cc9 tests: Fix signedness warnings 2012-04-13 10:11:11 -04:00
Kristian Høgsberg
fa5f7b1191 server: Add client destroy signal 2012-04-13 09:53:15 -04:00
Neil Roberts
18a770c80d Add a public header for the version number
This adds a public header so that applications can get the Wayland
version number at compile time. This can be used to make applications
that support compiling against multiple versions of Wayland.

There is a separate installed header called cogl-version.h which gets
included by both wayland-client.h and wayland-server.h

The canonical place for the version number is the configure.ac script
which splits it into three separate m4 defines for the major, minor
and micro version. These are copied into the generated
wayland-version.h header using AC_SUBST. There is also a string form
of the complete version number.

The version number is now also automatically copied into the two .pc
files.

Because the major, minor and micro parts are required it is no longer
possible to leave the version number as 'master' when building from
git. Most projects seem to immediately bump the git repo to a fake
version number (usually odd) after making a release so that there is
always a relative number that can be used for comparison. This patch
sets the git version to 0.99.0 under the assumption that the next
release will be 1.0.0.
2012-04-12 17:54:44 -04:00
Kristian Høgsberg
8e5866a54d Update TODO 2012-04-12 17:43:12 -04:00
Kristian Høgsberg
6802eaa68a Introduce wl_signal
This is mostly renaming and consolidating the listener_list pattern
into something more concise and reusable.
2012-04-12 15:52:44 -04:00
Kristian Høgsberg
5535f155d8 Switch protocol to using serial numbers for ordering events and requests
The wayland protocol, as X, uses timestamps to match up certain
requests with input events.  The problem is that sometimes we need to
send out an event that doesn't have a corresponding timestamped input
event.  For example, the pointer focus surface goes away and new
surface needs to receive a pointer enter event.  These events are
normally timestamped with the evdev event timestamp, but in this case,
we don't have a evdev timestamp.  So we have to go to gettimeofday (or
clock_gettime()) and then we don't know if it's coming from the same
time source etc.

However for all these cases we don't need a real time timestamp, we
just need a serial number that encodes the order of events inside the
server.  So we introduce a serial number mechanism that we can use to
order events.  We still need real-time timestamps for actual input
device events (motion, buttons, keys, touch), to be able to reason
about double-click speed and movement speed so events that correspond to user input carry both a serial number and a timestamp.

The serial number also give us a mechanism to key together events that
are "logically the same" such as a unicode event and a keycode event,
or a motion event and a relative event from a raw device.
2012-04-11 22:27:26 -04:00
Jørgen Lind
a13aab4e15 remove superfluous functions 2012-04-11 08:17:20 -04:00
Benjamin Franzke
e6a9e1b302 wayland-util.h: Include stddef.h for size_t 2012-04-06 15:54:38 +02:00
Kristian Høgsberg
aa777e5b10 shm: Allocate shm buffers through new wl_shm_pool interface
There's a big cost to setting up and tearing down a mmap and faulting in
the pages to back it.  For cases where we're continuously reallocating
shm wl_buffers (resizing a surface, typically) it is a big performance
improvement to be able to reuse a mmap area.  This change makes the shm
buffer allocation a two step process: first allocate a wl_shm_pool, then
allocate a buffer from the pool.  The wl_shm_pool encapsulate the shared
memory pool, and lets clients allocate wl_buffers backed by chunks of that
memory.  Buffers are allocated at an offset into the pool, so it's possible
to create multiple buffers from one pool, for example for icons or cursor
images.
2012-04-03 12:34:22 -04:00
Alex Wu
68cf7a1a42 wayland-utils: add wl_list_for_each_reverse_safe macro.
Add the safe version for wl_list_for_each_reverse
2012-04-02 22:12:56 -04:00
Kristian Høgsberg
3cddb3c692 Fix remaining signedness errors
We can change the data type for 'size' but we have to cast len to size_t
for the comparisons with sizeof results.
2012-03-30 11:27:02 -04:00
Kristian Høgsberg
0ca75a4f32 wayland-util: Fix wl_array signedness warnings 2012-03-30 10:43:36 -04:00
Kristian Høgsberg
3fb304bb3e connection.c: Fix signedness warnings 2012-03-30 10:43:32 -04:00
Kristian Høgsberg
ba32db9532 Move DIV_ROUNDUP out of public header, remove unused ALIGN 2012-03-30 10:28:39 -04:00
Kristian Høgsberg
485dd7b6e2 shm: Fix stride signedness in protocol
Make stride argument of wl_shm.create_buffer a signed integer.
2012-03-30 10:24:29 -04:00
Pekka Paalanen
4560b6b6b4 server: fix button signedness in wl_grab_interface
wl_input_device::grab_button is unsigned but the button parameter to
wl_grab_interface::button is signed. This lead to a warning in
data-device.c.

The button number is unsigned in the protocol, so make it unsigned in
the wl_grab_interface API, too. Fixes the compiler warning "comparison
between signed and unsigned integer expressions".

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 10:14:51 -04:00
Pekka Paalanen
03c40a8c99 scanner: fix a signedness warning
Trivial fix to a
warning: comparison between signed and unsigned integer expressions

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 10:12:35 -04:00
Pekka Paalanen
c2a405be5a shm: fix cosmetic gcc warnings
Fix warning: 'static' is not at beginning of declaration

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 10:09:38 -04:00
Pekka Paalanen
00ea1701f2 server: fix signedness in wl_client_connection_data
The variables opcode and size were unsigned, which lead to warnings
about comparisons of signed vs. unsigned.

Change these variable to signed. Their usage never relies on being
unsigned.

This also fixes (an assumed) printf format string problem, where these
were printed with %d, not %u.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 09:32:26 -04:00
Pekka Paalanen
0e81a0b157 configure: add -Wextra -Wno-unused-parameter
This adds more gcc warnings that should be useful, and suppresses the
unused parameter warnings that are not wanted.

Most importantly, this change enables warnings about comparison between
signed and unsigned.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 09:32:24 -04:00
Kristian Høgsberg
5b72fc7528 docs: Touch ouput dir Wayland to update timestamp
Prevents rebuild every time.
2012-03-29 14:11:16 -04:00
Kristian Høgsberg
4fe458346c Remove unused bits from wayland-server.h 2012-03-29 14:03:40 -04:00
Kristian Høgsberg
6c57ab016d Update TODO 2012-03-28 23:13:59 -04:00
Peter Hutterer
f68e156b8f doc: consistently indent the xml files by 2 spaces
2 spaces is enough for xml, otherwise we end up with too little room for the
actual text.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-28 23:05:45 -04:00