As we do for the input interfaces such as wl_pointer, we must send the
selection event to all the wl_data_device resources the client created for
a specified seat.
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit adds a new exported function, weston_seat_send_selection(),
which sends the current selection to a specified client. This is
useful e.g. to implement a clipboard manager as a special client.
Reviewed-by: Daniel Stone <daniels@collabora.com>
The other set_focus() functions take the relevant type instead of a seat
already, so this is consistent.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Pass 'this' weston_surface as the data argument to
weston_surface::destroy_signal listeners. The old &surface->resource was
really just an offsetted pointer to the weston_surface anyway. And,
because 'resource' happened to be the first member in struct weston_surface,
it was actually 'this' weston_surface.
The argument type was accidentally changed in commit
26ed73cee8 from wl_resource* to
wl_resource**.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
There is no valid case, where you would actually destroy a
weston_surface, while leaving the wl_surface protocol object in
existence. Therefore, inert wl_surface objects do not exist, except
because of bugs.
To catch such bugs, check that the resource is really NULL before
actually destroying the weston_surface.
We actually used to have this check, but it was removed by:
commit 9dadfb5352
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 8 13:49:36 2013 -0400
compositor: Eliminate marshalling warning for leave events
However, the invariant was put back in:
commit 0d379744d3
Author: Giulio Camuffo <giuliocamuffo@gmail.com>
Date: Fri Nov 15 22:06:15 2013 +0100
compositor: set weston_surface:resource to NULL when destroyed
So apparently the issue fixed by 9dadfb53 was fixed another way later.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Especially, the size of destination rectagle is set to (1,1).
This is because the size will be used for caluculating scale and not to
be 0 to avoid 0 dividing.
I also remark this as FIXME. This shall be fixed at ivi-layout-tansition.c.
In new invoded application, its property is initilized by (0,0)
destination rectangle. So transition fucntion always calculates its scale
as inf at first frame of fade-in with new invoked application. To fix this,
restructing transition function is ideally needed.
Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This method should not update weston_view directly. This shall be done by
controller via ivi_layout_*.
Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
When application changes the size of its content, UI shall fit the source
rectangle, view area, to the size of its content to show whole content.
Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Scale is calculated as float and to be inf. It shall be avoided by,
ivi_layout_surface_set_source/destination_rectangle. So output log and
then return this method to use prevous scale for fail safe.
Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi_layout_surface_configure is called from ivi-shell when configure
listener of weston surface is triggered. This function shall do,
- emit signal to hmi-controller to notify the configuration change
Other unnecesary logics are cleaned up.
Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The reason why the result is not output in the method is that it avoids
to have dependency on CAIRO. If user want to output it to file, user
shall link CAIRO on its controller.
ivi_layout_surface_get_size is also supported here because user needs
stride to call ivi_layout_surafce_dump.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It doesn't work anymore, and it never did anything useful.
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Currently, the shell crashes if the parent is not a shell surface. Instead,
send an error to the client.
Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
At least in some shells test needs 3 arguments for string comparison
if test $foo=yes ...
will always be true.
if test $foo = yes ...
will perform a string comparison.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
If windows are created and quickly destroyed it's possible that they'll be
on the unpaired window list at the time of surface creation. The surface
destroy listener for that surface isn't properly freed and a crash happens
some time later.
This patch removes the window from the unpaired list during unmap, so we
should never get to the destroy handler with a surface destroy listener set.
Just in case there's another path to that failure, I've also removed the
surface destroy listener in the destory handler.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Added build error message when 'make install' is run as non-root
and the --disable-setuid-install configuration option has not been
used.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This lets us verify that all callers are actually testing for a
successful hash lookup at compile time.
All current users of hash_table_lookup are converted to the new
wm_lookup_window() and the appropriate success check is added.
This fixes any call sites that used to assume a successful return
and dereference a NULL pointer.
This closes http://bugs.freedesktop.org/show_bug.cgi?id=83994
The xwayland test has been failing because weston crashes due to
a hash lookup failure and a subsequent dereference of the returned
NULL pointer.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This is the ivi_layout stand-alone test controller module that does not
require any clients to run. Therefore it is much simpler than
ivi_layout-test-plugin.c and does not need a matching part in
ivi_layout-test.c.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Testing the ivi_layout API requires two things:
- the tests must be written as a controller module to access the API
- the tests need a helper client to create some objects that can then be
managed via the API
This patch adds all the infrastructure and two different kinds of
example tests.
Internal ivi-shell (ivi_layout) API tests are listed as ivi-*.la files
in TESTS in Makefile.am. Weston-tests-env detects these, and runs Weston
with ivi-shell, and loads the given module as a controller module, not
as a normal plugin.
The test controller module ivi-*.la will launch a helper client. For
ivi-layout-test.la the helper client is ivi-layout.ivi.
The helper client uses the weston-test-runner framework to fork and exec
each TEST with a fresh connection to the compositor.
The actual test is triggered by the weston_test_runner protocol
interface, a new addition to weston-test.xml. The helper client uses
weston_test_runner to trigger a test, and the server side of the
interface is implemented by the test controller module
(ivi-layout-test.la).
The server side of weston_test_runner uses the same trick as
weston-test-runner.h to gather a list of defined tests. A test is
defined with the RUNNER_TEST macro.
If a test defined by RUNNER_TEST succeeds, an event is sent to the
helper client that it can continue (or exit). If a test fails, a fatal
protocol error is sent to the helper client.
Once the helper client has iterated over all of its tests, it signals
the batch success/failure via process exit code. That is cought in the
test controller module, and forwarded as Weston's exit code.
In summary: each ivi_layout test is a combination of a client side
helper/setup and server side actual tests.
v2: Load weston-test.so, because create_client() needs it.
v3: add a comment about IVI_TEST_SURFACE_ID_BASE.
v4: Rebased to upstream weston-tests-env changes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
This simply tests that Weston starts with ivi-shell, and ivi_application
is present.
Changes in v3:
- Rebased to upstream weston-tests-env changes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
EGL_MESA_configless_context is a display extension. The query for client
extensions was overwriting the pointer, so it was being searched from
the client extensions instead.
Fix any confusion here by moving all client extension checks into
another function. Drop a useless cast.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
An EGL implementation may support client extensions without supporting
EGL_EXT_platform_base. In such a case, we should return 0 to fall back
to the old eglGetDisplay() way.
Cc: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Some DRI drivers, including VMware vmwgfx, do not support
calling eglQueryString() with a EGL_NO_DISPLAY parameter.
Just as we do in gl_renderer_supports(), which returns 0
but does not fail in this case, do not fail in
gl_renderer_setup_egl_extensions().
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
[Pekka: split the patch]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
The first break in TYPE_WM_PROTOCOLS was almost certainly intended to be
nested within the if statement.
Even if it wasn't, it makes sense there.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
If you do an out-of-tree build, all the images will be left in the
srcdir. Fix their paths.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
The ivi-shell / hmi-controller cannot run without a properly populated
config file. Generate a config file especially for tests, which includes
paths to the build dirs.
The generated file will be used by following patches adding ivi-shell
tests.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Also use variable default assignment to eliminate an if clause
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The log files were being named like:
surface-global-test.la-log.txt
surface-global-test.la-serverlog.txt
surface-test.la-log.txt
surface-test.la-serverlog.txt
text.weston-log.txt
text.weston-serverlog.txt
For consistency, omit the test filename's extension (.la/.so).
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
basename returns the filename without path information (but with
the file extension). We can get this more efficiently via shell
variables.
Also, for the socket name, use the test's name without the file
extension.
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: rebased without "tests: Support --config to enable tests to
override config defaults".]
Weston running the Wayland backend is nested. The parent compositor uses
an unknown clock for the frame callback timestamps. This is quite likely
a different clock from what the nested Weston chose as its presentation
clock.
This means we cannot reasonably read the presentation clock and assume
it has any relation to the timestamp got from the frame callback. In
fact, this was seen to cause absurd repaint delays, trigger the insanity
check, reduce fraterate, etc. problems, because we assume we can read
the clock and compute the remaining repaint delay.
As we can't use the timestamp, ignore it, and read our own presentation
clock instead.
The X11 backend does not suffer from this, because there the parent
window system never provides us any timestamps, so we always read our
own clock.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Now that we've removed the XYToWindow handler in Xwayland, we actually
have to stack windows properly. This stacks windows on top when
activating them.
Note that for a fully robust Xwayland implementation, we'll need a
complete stack tracker implementation, unfortunately.
Reviewed-by: Daniel Stone <daniels@collabora.com>
When loading a controller module, if we do not find a
controller_module_init symbol, return failure to the caller instead of
ignoring the failure.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
This will be useful for tests, where we use --no-config, but ivi-shell
needs load the controller module from somewhere.
We are not making hmi-controller.so the default, because this patch
should allow running the tests also with another controller.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
A more descriptive name to not be confused with create_client().
v2: Rebased: fix also devices-test.c.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Introduce a new helper create_client(), which creates and initializes
the client struct, but does not create a wl_surface.
This will be useful for ivi-shell tests.
v2: Rebased, and restored the dependency to weston-test.so, since seat
handling requires it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Test misc races when adding/releasing devices
v2.: use one roundtrip after releasing devices
add touch support
v3.: remove useless checks
add few comments
repeat tests 30 times instead of 100 times
(it took too long, 30 is enough)
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Let the client bind to wl_touch. Since we have our own seat,
we know that the compositor will have wl_touch capability.
v2: rebased due to changes in previous commit
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
When running on different backends, we don't know what devices
the backend provides. Create new seat for tests that contains
everything what we need. This is also first step in adding
touch support for tests.
v2: do not add devices in wl_seat.name event. Collect first
all wl_seats and then pick the one that we need and
destroy the rest. The effect is the same, but this code
is better understandable.
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
We used hard-coded version 1 for all globals. For testing
newer methods and events we need use the current version
of global. This patch fixes this and adds missing
event handlers (for the events that were added in
versions > 1)
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This request simulates device creation/destruction from evdev (libinput)
v2: added support for touch. Touch is not supported yet,
but better be prepared
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
All the surfaces from all the X clients share the same wl_client so
wl_client_get_credentials can't be used to get the pid of the X
clients.
The shell may need to know the pid to be able to associate a surface
with e.g. a DBus service.
[Pekka: fixed trivial merge conflicts.]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Some DRI drivers, including VMware vmwgfx, do not support
calling eglQueryString() with a EGL_NO_DISPLAY parameter.
Allow toytoolkit to create EGL surfaces with them, by
falling back to the old creation method.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
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>
The dummy typedefs for "get_platform_display()" and
"create_platform_window()" were badly defined, which
prevented building Weston on older systems.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Terminal is a nice app that support fullscreening. To be able to test
minimizing of a fullscreen app, add an entry to the context menu. That
is the only way to minimize, as window frame is not there when
fullscreen.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The "set_minimized(surface, 0)" function call was never
used anywhere, and not really respecting naming
conventions.
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Add a command line option to specify a file to be read instead of
weston.ini.
IVI-shell testing will at least temporarily need to specify a config
file, because it cannot run without. That is why this is being added,
but should be convenient for everybody, too.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>