When all shared/ headers are included in the same way, we can drop unnecessary
include seach paths from the compiler.
This include style was chosen because it is prevalent in the code base. Doing
anything different would have been a bigger patch.
This also means that we need to keep the project root directory in the include
search path, which means that one could accidentally include private headers
with
#include "libweston/dbus.h"
or even
#include <libweston/dbus.h>
IMO such problem is smaller than the churn caused by any of the alternatives,
and we should be able to catch those in review. We might even be able to catch
those with grep in CI if necessary.
The "bad" include style was found with:
$ for h in shared/*.h; do git grep -F $(basename $h); done | grep -vF '"shared/'
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
All these have the printf format string wrong. "%*s" sets the field width but
does not limit the string to len bytes. You need to set precision instead to
limit to len bytes: "%.*s".
Found by grepping, after wondering why my WIP prints printed garbage at the
end.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
eglTerminate should be called before the display was disconnected.
Signed-off-by: Yong Gan <yong.gan@nxp.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Do a minimalistic teardown at program exist.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Should be "client" instead of "nclient".
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
There was an issue recently in screen-share.c where config.h was not
being included, resulting in the wrong definition for off_t being used on
32 bit systems. I checked and I don't think this problem is happening
elsewhere, but to help avoid this sort of problem in the future, I went
through and made sure that config.h is included first whenever system
headers are included.
The config.h header should be included before any system headers, failing
to do this can result in the wrong type sizes being defined on certain
systems, e.g. off_t from sys/types.h
Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
A wayland compositor doesn't provide a mechanism for buffer sharing between
clients. Under X, one client can render to a Pixmap and another can use it
as a source in a subsequent drawing operations. Wayland doesn't have a
mechanims to share Pixmaps or textures between clients like that, but it's
possible for one client to act as a nested compositor to another client.
This less work than it sounds, since the nested compositor won't have to
provide input devices or even any kind of shell extension. The nested
compositor and its client can be very tightly coupled and have very specific
expectations of what the other process should provide.
In this example, nested.c is a toytoolkit application that uses cairo-gl
for rendering and forks and execs nested-client.c. As it execs the client,
it passes it one end of a socketpair that will be the clients connection
to the nested compositor. The nested compositor doesn't even create a
listening socket.
The client is a minimal GLES2 application, which just renders a spinning
triangle in its frame callback.