Commit Graph

29 Commits

Author SHA1 Message Date
Kristian Høgsberg
c7d2c4c147 Add more missing config.h #includes
Now that we use AC_SYS_LARGEFILE, we need to pull in config.h at least
whereever we use mmap().  Fixes at least the test-suite and simple-shm
on 32 bit systems.
2013-08-26 14:59:14 -07:00
Kristian Høgsberg
c85a9178c7 simple-touch: Handle OOM when allocating struct touch 2013-08-15 11:40:30 -07:00
Stefan Schmidt
85c40f2d85 clients: Fix typo in simple-touch and simple-shm.
listenter -> listener. Better fix it now before it spreads further.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
2013-08-06 17:02:59 -07:00
Kristian Høgsberg
5addaa1820 simple-touch: Attach buffer before posting damage 2013-07-25 09:49:43 -07:00
Pekka Paalanen
0eab05d2a7 clients: add global_remove handler stubs
All the clients here were missing the global_remove handler. Because
window.c did not have it, weston-desktop-shell and weston-keyboard
segfaulted on compositor exit, as they received some
wl_registry.global_remove events.

Add more or less stub global_remove handlers, so that clients do not
crash on such events. Toytoolkit and all applications would need a lot
more code to properly handle the global object removal.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-01-24 16:42:38 -05:00
Kristian Høgsberg
5717b6dbf1 Stop relying on ARRAY_LENGTH being defined in wayland-util.h
Time to break a bad habit.
2012-10-19 17:12:38 -04:00
Kristian Høgsberg
a17f7a13fd clients: Check return value of wl_display_dispatch()
The simple clients all just call wl_display_dispatch() in a while loop
without checking the return value.  Now, if the server dies or other
error occurs, we get a -1 return value instead and need to break the loop.
2012-10-16 13:17:16 -04:00
Pekka Paalanen
392c5f275d simple-touch: do not include GL headers
since it doesn't use any of them. Fixes a build failure on systems,
where (E)GL headers are in non-standard path.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:48:55 -04:00
Pekka Paalanen
8e159180cc compositor, clients: make damage double-buffered
This change depends on the Wayland commit
"protocol: double-buffered state for wl_surface".

Implement double-buffering of damage in the compositor as required by
the new protocol.

Ensure all Weston demo clients call wl_surface_commit() after
wl_surface_damage().

Mesa does not need a fix for this, as the patch adding
wl_surface_commit() call to Mesa already takes care of damage, too;
Mesa commit: "wayland: use wl_surface_commit()"

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:31 -04:00
Pekka Paalanen
c9e00c06e9 clients: use wl_surface_commit
Use wl_surface_commit() to commit the buffer attach, as Weston now
requires.

NOTE: GL-applications are broken until you upgrade to a version of Mesa
which does wl_surface_commit() on eglSwapBuffers(). If you have
Cairo-gl, this means all toytoolkit apps, too.

simple-shm and simple-touch OTOH will work now.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-10 21:38:17 -04:00
Kristian Høgsberg
fa80e11c84 Update to new fd and wl_registry APIs
This commit updates the clients and the wayland compositor backend to
use the new wl_registry mechanism and the thread safe fd API.
2012-10-10 21:34:38 -04:00
Scott Moreau
01a9f1b992 clients: Set title for all shell surface demos. 2012-10-09 23:13:01 -04:00
Pekka Paalanen
76fc57e75c simple-touch: use proper damage in touch_paint()
Should reduce update overhead.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-07-31 22:27:23 -04:00
Pekka Paalanen
0768419393 simple-touch: fix off-by-one in position checks
Fix the off by one error in checking whether we can draw the marker
without exceeding buffer dimensions.

Fixes a segfault.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-07-31 22:27:23 -04:00
Pekka Paalanen
55b7cb24e0 simple-touch: more colors and thicker marks
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-07-31 22:27:23 -04:00
Pekka Paalanen
7e94a98e07 simple-touch: respond to ping protocol
Without this, it won't get any input anymore.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-07-31 22:27:23 -04:00
Pekka Paalanen
1da1b8f3f1 Rewrite shm buffer file allocation v2
We had duplicated code in many places, using hardcoded paths for
temporary files into more than one path. Some cases did not bother with
O_CLOEXEC, and all hardcoded paths that might not exist.

Add an OS helper function for creating a unique anonymous file with
close-on-exec semantics. The helper uses $XDG_RUNTIME_DIR as the
directory for a file.

This patch unifies the buffer file creation in both Weston and the
clients.

As simple clients are better not linking to libshared, as it would
require e.g. Cairo, they pull the OS compatibility code directly.

Android does not have mkostemp(), so a configure test is added for it,
and a fallback used if it is not available.

Changes in v2:
	remove all the alternate possible directory definitions and use
	XDG_RUNTIME_DIR only, and fail is it is not set.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-06 13:26:30 -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
80680c7b75 window.c: Just use float instead of GLfloat, remove GLES2.h include 2012-05-10 14:11:44 -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
Kristian Høgsberg
eae5de7609 Follow wayland change to serial numbers 2012-04-11 22:42:15 -04:00
Kristian Høgsberg
16626282fd clients: Use new shm interface 2012-04-03 11:22:06 -04:00
Kristian Høgsberg
875ab9e735 Add signedness warning flag and fix fallout 2012-03-30 11:52:39 -04:00
Kristian Høgsberg
9629fe3206 Simplify shm buffer handling
There was a lot of code here to do a lot of work we didn't need to do.
If we damage a surface with a shm buffer attached, all we need to do
is to re-upload the damaged region to the texture.  As for drm buffers,
we don't assume anything changes on attach and only update the
regions the client tells us to update in the damage request.
2012-03-26 19:27:35 -04:00
Scott Moreau
210d079817 Hook up axis events. 2012-03-22 11:03:41 -06:00
Kristian Høgsberg
dd631c1c36 simple-touch: Update to enter/leave changes 2012-02-23 16:20:38 -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
8e81df4503 Use new format codes 2012-01-11 14:24:46 -05:00
Kristian Høgsberg
558949b67b clients: Add simple-touch client for testing touch events. 2011-12-22 13:45:50 -05:00