Commit Graph

318 Commits

Author SHA1 Message Date
Michael Tretter b282fe3a73 ivi-shell: remove unused definition ivi_layout_screen
The ivi_layout_screen is internal to the IVI shell and not used by any
controllers. Controllers use weston_output directly.

Remove it from the exported header to avoid confusion.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2022-08-08 14:27:41 +00:00
Pekka Paalanen cbbf0e59a5 ivi-shell: replace MEM_ALLOC() with mostly xcalloc()
Drop the even more home-grown alloc wrapper and use the xalloc.h
wrappers directly.

xcalloc() is added and used, because calloc() will detect integer
overflows in the size multiplication, while doing a simple
multiplication in the caller is subject to overflows which may result in
allocating not what was expected, subjecting to out-of-bounds access.

All MEM_ALLOC() calls that had a meaningful multiplication in them were
converted to xcalloc(), the rest to xzalloc().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-07-20 12:12:22 +03:00
Daniel Stone 9336263d9b Move libweston-desktop into libweston
It's not really useful to have libweston without libweston-desktop. It's
also very little code.

Merging both into the same DSO will allow us to cut out a bunch of
indirection and pain.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-06-28 10:35:52 +00:00
Daniel Stone 0c69688aa2 libweston: Add weston_surface_map() wrapper
Change all instances of surface->is_mapped = true, to a specialised
function.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-06-16 12:17:15 +03:00
Michael Olbrich 924e79f4f2 ivi-shell: emit created notification earlier for desktop surfaces
Without this, the earliest signal the ivi controller receives for a new surface
is configure_desktop_changed signal. And this is not emitted until the surface
has the first buffer attached.
By emitting the signal during surface creation, the controller is able to set
the initial width and height for the first configure.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2022-04-14 13:10:04 +00:00
Pekka Paalanen 32aedb9fd6 ivi-shell: destroy desktop
Fixes ASan reported leaks:

Direct leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x7fcdc7382518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x7fcdc2d902f3 in zalloc ../../git/weston/include/libweston/zalloc.h:38
    #2 0x7fcdc2d91cc2 in weston_desktop_xwayland_init ../../git/weston/libweston-desktop/xwayland.c:410
    #3 0x7fcdc2d89aef in weston_desktop_create ../../git/weston/libweston-desktop/libweston-desktop.c:87
    #4 0x7fcdc2db7300 in wet_shell_init ../../git/weston/ivi-shell/ivi-shell.c:642
    #5 0x7fcdc7261de5 in wet_load_shell ../../git/weston/compositor/main.c:956
    #6 0x7fcdc7272baa in wet_main ../../git/weston/compositor/main.c:3410
    #7 0x55e12a669e29 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432
    #8 0x55e12a66d85d in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528
    #9 0x55e12a65dc48 in fixture_setup ../../git/weston/tests/ivi-layout-test-client.c:48
    #10 0x55e12a65dcca in fixture_setup_run_ ../../git/weston/tests/ivi-layout-test-client.c:50
    #11 0x55e12a66de12 in main ../../git/weston/tests/weston-test-runner.c:661
    #12 0x7fcdc6ed709a in __libc_start_main ../csu/libc-start.c:308
    #13 0x55e12a65d769 in _start (/home/pq/build/weston-meson/tests/test-ivi-layout-client+0xd769)

Indirect leak of 152 byte(s) in 1 object(s) allocated from:
    #0 0x7fcdc7382518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x7fcdc2d89811 in zalloc ../../git/weston/include/libweston/zalloc.h:38
    #2 0x7fcdc2d8992d in weston_desktop_create ../../git/weston/libweston-desktop/libweston-desktop.c:65
    #3 0x7fcdc2db7300 in wet_shell_init ../../git/weston/ivi-shell/ivi-shell.c:642
    #4 0x7fcdc7261de5 in wet_load_shell ../../git/weston/compositor/main.c:956
    #5 0x7fcdc7272baa in wet_main ../../git/weston/compositor/main.c:3410
    #6 0x55e12a669e29 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432
    #7 0x55e12a66d85d in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528
    #8 0x55e12a65dc48 in fixture_setup ../../git/weston/tests/ivi-layout-test-client.c:48
    #9 0x55e12a65dcca in fixture_setup_run_ ../../git/weston/tests/ivi-layout-test-client.c:50
    #10 0x55e12a66de12 in main ../../git/weston/tests/weston-test-runner.c:661
    #11 0x7fcdc6ed709a in __libc_start_main ../csu/libc-start.c:308
    #12 0x55e12a65d769 in _start (/home/pq/build/weston-meson/tests/test-ivi-layout-client+0xd769)

Indirect leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x7fcdc7382518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x7fcdc2d8a5ae in zalloc ../../git/weston/include/libweston/zalloc.h:38
    #2 0x7fcdc2d8a89e in weston_desktop_client_create ../../git/weston/libweston-desktop/client.c:108
    #3 0x7fcdc2d91d2a in weston_desktop_xwayland_init ../../git/weston/libweston-desktop/xwayland.c:415
    #4 0x7fcdc2d89aef in weston_desktop_create ../../git/weston/libweston-desktop/libweston-desktop.c:87
    #5 0x7fcdc2db7300 in wet_shell_init ../../git/weston/ivi-shell/ivi-shell.c:642
    #6 0x7fcdc7261de5 in wet_load_shell ../../git/weston/compositor/main.c:956
    #7 0x7fcdc7272baa in wet_main ../../git/weston/compositor/main.c:3410
    #8 0x55e12a669e29 in execute_compositor ../../git/weston/tests/weston-test-fixture-compositor.c:432
    #9 0x55e12a66d85d in weston_test_harness_execute_as_client ../../git/weston/tests/weston-test-runner.c:528
    #10 0x55e12a65dc48 in fixture_setup ../../git/weston/tests/ivi-layout-test-client.c:48
    #11 0x55e12a65dcca in fixture_setup_run_ ../../git/weston/tests/ivi-layout-test-client.c:50
    #12 0x55e12a66de12 in main ../../git/weston/tests/weston-test-runner.c:661
    #13 0x7fcdc6ed709a in __libc_start_main ../csu/libc-start.c:308
    #14 0x55e12a65d769 in _start (/home/pq/build/weston-meson/tests/test-ivi-layout-client+0xd769)

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-06-16 14:41:08 +00:00
Michael Tretter 16e3f27fc7 ivi-shell: bring back reference weston.ini
In commit d8e09afc9f ("tests: Convert ivi-shell-app-test.c to use
`weston_ini_setup`") the reference weston.ini for the ivi-shell was
removed, because it is not required by the test anymore.

The reference weston.ini still has value as an example for the ivi-shell
and how the ivi-shell-user-interface has to be configured. Retrieving
this information from the test case is not intuitive. Furthermore, the
file is still referenced by the ivi-shell/README, and the
configuration_data for generating the file was not fully removed.

Bring back the reference weston.ini for the ivi-shell and, while at it, cleanup
the configuration_data() to define only keys that are actually used in
weston.ivi.in.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2021-06-04 12:40:12 +02:00
Pekka Paalanen 9706a807f9 ivi-shell: call weston_layer_fini()
This ensures the layers are torn down properly.

See commit: libweston: add weston_layer_fini()

There would be a lot more to tear down here, but that is for another
time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-05-28 13:38:28 +03:00
Harsha M M 1b470f96d2 ivi-shell: clean up remaining ivisurface during de-init
Signed-off-by: Harsha M M <harsha.manjulamallikarjun@in.bosch.com>
2020-10-16 16:23:25 +00:00
Igor Matheus Andrade Torrente d8e09afc9f tests: Convert ivi-shell-app-test.c to use `weston_ini_setup`
Convert ivi-shell-app-test.c to use `weston_ini_setup`. It also removes
the pre-made weston.ini and all the related code in the meson files.

Signed-off-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
2020-09-30 09:41:34 -03:00
Rajendraprasad K J 4a378afa3b ivi-shell: Avoid unnecessary scaling of the view transformation matrix
The opaque region of a weston view is updated only if the alpha value is 1
and the transform matrix is of type WESTON_MATRIX_TRANSFORM_TRANSLATE.

While using ivi-shell, opaque region is never updated, as we are performing
scaling operations to the view transform matrix, even when the scaling
factor is 1 and thereby changing the type to WESTON_MATRIX_TRANSFORM_SCALE.

Perform scaling of the view transformation matrix only when the scaling
factor is non-zero.

Signed-off-by: Rajendraprasad K J <KarammelJayakumar.Rajendraprasad@in.bosch.com>
2020-08-17 09:58:23 +00:00
Philipp Zabel 4b1de0112b build: add rpath to modules that use symbols from libexec_weston
The cms-static, desktop-shell, hmi-controller, ivi-shell, and screen-share
modules use symbols from libexec_weston, e.g.:

  $ ldd /usr/lib/x86_64-linux-gnu/weston/desktop-shell.so | grep "not found"
  	libexec_weston.so.0 => not found

Loading these modules from weston happens to work because the weston executable
itself links against libexec_weston, and has an rpath set. Still, these modules
depend on a library in a non-standard location. Adding an rpath could help
static checkers to make sure all shared objects' dependencies are present.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2020-02-06 09:00:42 +00:00
Daniel Stone 51d995ad82 config-parser: Make get_bool be bool
Wayland innovated a lot of cool things, but non-binary boolean values is
the great advances of our time.

Make config_parser_get_bool() work on boolean values, and switch all its
users.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-11-28 19:24:13 +00:00
Pekka Paalanen 6ffbba3ac1 Use weston_compositor_add_destroy_listener_once() in plugins
This introduces a new convention of checking through the compositor destroy
listener if the plugin is already initialized. If the plugin is already
initialized, then the plugin entry function succeeds as a no-op. This makes it
safe to load the same plugin multiple times in a running compositor.

Currently module loading functions return failure if a plugin is already
loaded, but that will change in the future. Therefore we need this other method
of ensuring we do not double-initialize a plugin which would lead to list
corruptions the very least.

All plugins are converted to use the new helper, except:
- those that do not have a destroy listener already, and
- hmi-controller which does the same open-coded as the common code pattern
  did not fit there.

Plugins should always have a compositor destroy listener registered since they
very least allocate a struct to hold their data. Hence omissions are
highlighted in code.

Backends do not need this because weston_compositor_load_backend() already
protects against double-init. GL-renderer does not export a standard module
init function so cannot be initialized the usual way and therefore is not
vulnerable to double-init.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21 16:32:55 +00:00
Pekka Paalanen d2b9b5d1cc ivi-shell: fix init error path
This was forgetting to remove the compositor destroy listener if init failed,
which would lead to use-after-free on compositor tear-down. Found by
inspection.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-11-21 16:32:55 +00:00
Pekka Paalanen 8e7f9501e4 Link Weston plugins to libexec-weston.so
All these plugins use symbols that were exported by the weston executable and
are now exported by libexec-weston.so. Linking these to libexec-weston.so fixes
unresolved symbols.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-24 13:40:51 +03:00
Pekka Paalanen 5e734ba308 build: link libm explicitly
In the future libweston will stop providing it for its users, since it's not
part of libweston API.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-24 13:29:33 +03:00
Pekka Paalanen 71ff95a544 build: separate deps for int and ext libweston users
We have two kinds of libweston users: internal and external. Weston, the
frontend, counts as an external user, and should not have access to libweston
private headers. The shell plugins are external users as well, because we
intend people to be able to write them. Renderers, backends, and some plugins
are internal users who will need access to private headers.

Create two different Meson dependency objects, one for each kind.

This makes it less likely to accidentally use a private header.

Screen-share is a Weston plugin and therefore counts as an external user, but
it needs the backend API to deliver input. Until we are comfortable exposing
public API for that purpose, let it use internal headers.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-24 13:29:33 +03:00
Pekka Paalanen 4f5e360180 build: simplify include_directories
Define common_inc which includes both public_inc and the project root directory.
The project root directory will allow access to config.h and all the shared/
headers.

Replacing all custom '.', '..', '../..', '../shared' etc. include paths with
common_inc reduces clutter in the target definitions and enforces the common
 #include directive style, as e.g. including shared/ headers without the
subdirectory name no longer works.

Unfortunately this does not prevent one from using private libweston headers
with the usual include pattern for public headers.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-10-04 17:14:22 +03:00
Michael Olbrich 6ef2d45a2d ivi-layout: unmap desktop surfaces in ivi_view_destroy()
weston_desktop_surface_unlink_view() does now call weston_view_destroy() so the
weston_view is not destroyed here. This is a problem because the view remains in
the weston_layer view_list. If ivi_view_destroy() is called from
ivi_layout_surface_destroy() and the view list is rebuilt in the 'removed'
signal, then the list gets corrupted when the view is destroyed immediately
afterwards.
Fix this by calling weston_view_destroy() unconditionally for all view.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2019-07-01 15:51:57 +00:00
Michael Olbrich 640109cf5e ivi-layout: use libweston-desktop api is to send configure events everywhere
Whenever shell_surface_send_configure() is called
weston_desktop_surface_set_size() should be used instead for desktop
surfaces. It is already done for IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, do
it everywhere else too.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2019-07-01 15:50:08 +00:00
Pekka Paalanen 8ebd9817e7 Move libweston-desktop.h
This too is a public installed header.

The public headers are moved under a new top-level directory include/ to make
them clearly stand out as special (public API).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen 27b377f51f Rename plugin-registry.h to libweston/plugin-registry.h
See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen 3d5d9476e3 Rename compositor.h to libweston/libweston.h
The main idea is to make libweston users use the form

 #include <libweston/libweston.h>

instead of the plain

 #include <compositor.h>

which is prone to name conflicts. This is reflected both in the installed
files, and the internal header search paths so that Weston would use the exact
same form as an external project using libweston would.

The public headers are moved under a new top-level directory include/ to make
them clearly stand out as special (public API).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Harish Krupo b81fc517d8 meson.build: Fix warning for configure_file
We claim to support meson versions >= 0.47 but the `install:` argument
in configure_file was introduced in version 0.50. This produces the
following meson warning:

WARNING: Project specifies a minimum meson_version '>= 0.47' but uses
features which were added in newer versions:
 * 0.50.0: {'install arg in configure_file'}

From the documentation for the install argument [1]:
" When omitted it (install) defaults to true when install_dir is set and
not empty, false otherwise."

So, remove the `install:` argument and just depend on `install_dir` for
installing.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/225

[1] https://mesonbuild.com/Reference-manual.html#configure_file

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
2019-04-16 10:51:36 +05:30
Héctor Orón Martínez 250f1066ff support byte-by-byte reproducible build
build path ends in the final binary package causing the
build not to be reproducible byte-by-byte.

Reference:
https://bugs.debian.org/899358

Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
2019-04-09 10:08:23 +00:00
Pekka Paalanen 5dc2ddf9c6 Clean up .gitignore after autotools removal
There is no such thing as building in-tree anymore, so no need to ignore build
artifacts.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-03-28 13:56:45 +02:00
Emmanuel Gil Peyrot 426c24673f Fix typos all around (thanks codespell!) 2019-02-20 16:47:35 +01:00
Michael Teyfel e894b3e4a3 hmi-controller: register for desktop_surface_configured
Since ivi-shell now supports xdg-protocol, the surface_created listener
can be removed and the desktop_surface_configured listener is needed.
ivi-layout: libweston-desktop api is used to send configure event to
application.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 2763b66d31 ivi-shell: create weston_desktop in wet_shell_init
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel ed28f020b8 ivi-shell: remove surface_destroy_listener
Since the surface_destroy_listener is only registered for ivi-shell
applications, it should only be removed for ivi-shell applications.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 62d6d56a83 ivi-shell: added libweston-desktop-api implementation
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel c04188e546 ivi-layout: use libweston-desktop api for configure event
The libweston-desktop api is used to send configure
event to application.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 831e58f8e6 ivi-layout: use libweston-desktop api for views
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 8f9e92e8e3 ivi-shell: linked libweston-desktop and added structs
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 4d886d6058 ivi-layout: introduced surface create and configure
Introduced surface create and configure function for xdg-apps.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 65e1be1234 ivi-layout: introduced configure_desktop_changed
Introduced signal configure_desktop_changed with interface. This signal
should be sent, when a desktop-surface is configured.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel c9c247730b layout-interface: added interface to change surface id
This interface enables an id-agent to change the surface ids of an
ivi-layout-surface once.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 7419dc26e0 ivi-shell: introduction of IVI_INVALID_ID
Introduction of IVI_INVALID_ID for xdg-shell applications.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel 8b6fb14871 ivi-shell: removed assert
Removed assert, that checks if ivi-surface is not available, since this
can now happen with xdg-shell support.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Michael Teyfel f2042e132e ivi-shell: rework goto labels to avoid memory leaks
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
2019-02-06 17:45:09 +00:00
Pekka Paalanen 1ed3506b70 libweston: export weston_config API
Make it official that libweston will export the weston_config API, as requested
in https://gitlab.freedesktop.org/wayland/weston/merge_requests/29 .

There is no other way third party helper clients could access the API.

The autotools build has been accidentally exporting it all the time, but the
Meson build needed fixing.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-06 16:50:21 +02:00
Pekka Paalanen 818c20e78b ivi-shell: use weston_compositor_exit
Use the proper function to exit instead of the libwayland one, to allow main
handle_exit() to be called.

This is just to unify the exit paths.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-06 10:58:22 +00:00
Marius Vlad 64fbd0f41f compositor: Add some handy wrappers for wet_get_binary_path()
This allows to possibility to specify where to look for the executable
but also simplifies the need of having to pass either BINDIR/LIBEXECDIR
for retrieving full-path of the executable.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad 6bc37259e6 ivi-shell/hmi-controller: Include config.h as to not break ivi-shell build on meson
We're going to eventually pass bindir to weston-screenshooter and we
will need config.h info.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Daniel Stone 8011b0fa03 Add Meson build system
Meson is a build system, currently implemented in Python, with multiple
output backends, including Ninja and Make. The build file syntax is
clean and easy to read unlike autotools. In practise, configuring and
building with Meson and Ninja has been observed to be much faster than
with autotools. Also cross-building support is excellent.

More information at http://mesonbuild.com

Since moving to Meson requires some changes from users in any case, we
took this opportunity to revamp build options. Most of the build options
still exist, some have changed names or more, and a few have been
dropped. The option to choose the Cairo flavour is not implemented since
for the longest time the Cairo image backend has been the only
recommended one.

This Meson build should be fully functional and it installs everything
an all-enabled autotools build does. Installed pkg-config files have
some minor differences that should be insignificant. Building of some
developer documentation that was never installed with autotools is
missing.

It is expected that the autotools build system will be removed soon
after the next Weston release.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 14:50:54 +02:00
Emre Ucan 61eb170b73 ivi-shell: remove input-method section from config
input_method protocol is no longer supported.
Therefore, we should remove it from the example config

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-05 08:37:07 +00:00
Emre Ucan 27839fe913 ivi-shell: remove unused functions and members
input panel related members of ivi_shell struct are
not required anymore. Also get_default_view(),
input_panel_setup() and input_panel_destroy() are not used.
Therefore, we can remove them.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-05 08:37:07 +00:00
Emre Ucan eefb8b9ac5 ivi-shell: remove input panel implementation
it is unused now

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-05 08:37:07 +00:00
Emre Ucan 71f9ee1d22 ivi-shell: don't use input panel implementation
input panel implementation puts contents of an
application, which uses input_method protocol,
on top of all other surfaces. It is not controllable
with ivi-layout interface.

This is not acceptable for an In-Vehicle Infotainment
platform. Because we have to ensure configured scenegraph
cannot be hijacked by any rogue application.

Therefore, I am removing input panel implementation

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-05 08:37:07 +00:00
Emre Ucan d93a52a6f9 ivi-shell: check ivi_view mappedness in commit_changes()
If the view is not mapped, we do not need to update its
properties. We can use ivi_view_is_mapped() function to
check it.

Also we don't need to call weston_view_damage_below()
for weston_views, which were in the scenegraph. Because
we are calling weston_view_unmap for views of unmapped
ivi_views in build_view_list() function

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:32 +01:00
Emre Ucan f6638a7f0f ivi-shell: unmap views which are not in scenegraph
From Michael Olbrich:
"Both the core in weston_compositor_build_view_list() with view.link
and the ivi-shell in commit_screen_list() with view.layer_link
don't remove the old views from the list.

As a result, all views that are not currently in the list have
old broken links. Destroying such a view tries to remove
the view from these lists and will access the old, invalid pointers."

Therefore, we have to unmap weston_views which are not in current
scenegraph of ivi-shell. I implemented ivi_view_is_mapped() function
to check mappedness of ivi_views. The functions checks:
   - the view is on a layer's order list
   - the layer is on a screen
   - the layer and view's ivi_surface are visible

If ivi_view is not mapped but weston_view is still mapped,
we have to unmap the weston_view with weston_view_unmap() call.

Reported-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:32 +01:00
Emre Ucan e1e7ebdbea ivi-shell: Add build_view_list function
Move the implementation from commit_screen_list to
build_view_list function

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:31 +01:00
Emmanuel Gil Peyrot 9fd254d7b2 ivi-shell: Add missing sentence point
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2018-09-18 11:54:29 +02:00
Sruthik P e0b3022ebb Fix and remove broken links to confluence pages 2018-09-18 11:53:29 +02:00
Harsha M M 46cbd0a7f5 ivi-shell: Remove the compositor destory listener from list during de-init
During de-init ensure removal of compositor destroy notification
from list. Otherwise a dongling pointer is left behind which will
affect other plugins.

Signed-off-by: Harsha M M <harsha.manjulamallikarjun@in.bosch.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-08-10 13:23:14 +03:00
Emre Ucan 67546bed04 ivi-shell: use install paths in example config
The example weston.ini file uses source and build
directory paths. Therefore, it is only useful when
used on the same system that is used to build Weston.

We can use install paths instead of build/source paths
to fix this problem.

v2 changes:
- use $(westondatadir) instead of $(datadir)

Reported-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-07-22 11:17:40 +01:00
Emre Ucan cf4113c629 ivi-shell: listen compositor wake_signal
If compositor wakes up from sleep state, we have
to trigger repaint for all outputs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-07-22 11:06:38 +01:00
Daniel Stone 78a42116ae tests: Reshuffle IVI layout tests
Rename the IVI tests to be more consistent with the others, and invert
the naming of plugin/client to make it slightly more clear what's going
to happen. Handle the renaming by using wet_get_binary_path to rewrite
the local binaries.

As a side-effect, weston.ini ivi-shell-user-interface no longer needs to
be given as an absolute path.

Signed-off-by: Daniel Stone <daniels@collabora.com>

v2:

Call ivi-layout.ivi as ivi-layout-test-client.ivi to keep the same name
in both the file and the lookup, so that the module map does not need to
change the name.

Update code comments to reflect the new names.

Rename ivi_layout-test-plugin.c to ivi-layout-test-plugin.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-06-20 16:10:12 +03:00
Pekka Paalanen 055c1137ae libweston: make wl_output point to weston_head
The user data of a wl_resource representing a wl_output protocol object
used to be a pointer to weston_output. Now that weston_output is being
split, wl_output more accurately refers to weston_head which is a single
monitor.

Change the wl_output user data to point to weston_head.
weston_output_from_resource() is replaced with
weston_head_from_resource().

This change is not strictly necessary, but architecturally it is the
right thing to do. In the future there might appear the need to refer to
a specific head of a cloned pair, for instance.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v5 Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
2018-04-10 14:33:59 +03:00
Emre Ucan 77db9316eb ivi-shell: remove dead assignments in layer transition
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-03-28 13:09:50 +03:00
Emre Ucan 16ac6a0f9d hmi-controller: remove dead assignments in add_launchers
assigned values of x, y, ret and layout_surface are
never read.

(Found by clang source code analyzer)

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-03-28 13:09:50 +03:00
Emre Ucan e8ff7df863 ivi-shell: fix the layer assignment change from one screen to another
if the layer is in order of some screen we need to remove it
from there and mark the screen order as dirty so it will be removed
in commit_screen_list call later
layer should only be assigned to one screen at a time

Signed-off-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-08 14:17:12 +02:00
Emre Ucan 40d67c2862 ivi-shell: don't expilicitly assign outputs to views
it is assigned in weston_view_assign_outputs

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-08 14:16:57 +02:00
Emre Ucan 7b690559a5 ivi-shell: don't schedule compositor repaint
it is not necessary to repaint all outputs after
each commit_changes. Only outputs with modified
views has to be repainted.

We need to call weston_view_update_transform
for assigning views to outputs first.
Then, We can call weston_view_schedule_repaint
to trigger repaint for outputs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-08 14:16:44 +02:00
Emre Ucan a4608461b2 ivi-shell: change layer visibility to bool
ivi_layout_layer_set_visibility has bool
as argument.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-08 14:16:44 +02:00
Emre Ucan f85bf152c1 ivi-shell: remove ivi_shell_setting
it has only developermode option parameter.
The parameter is only used in init_ivi_shell.
Therefore, we can basically remove the struct,
and check the option locally in the function.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:55:03 +02:00
Emre Ucan 0c1bbb9e52 ivi-shell: don't load controller modules
controller modules can be loaded as weston modules
from the main function of weston.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:55:03 +02:00
Emre Ucan ffaf09eb2f hmi-controller: load as weston module
weston loads hmi-controller as a weston module.
IVI-shell does not need to load it explicitly.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:54:53 +02:00
Emre Ucan a9db8d7d64 hmi-controller: remove ivi_layout_interface global
Put the interface into hmi_controller struct.
It is better to have it in an object.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:54:53 +02:00
Emre Ucan ce9bc35185 ivi-shell: register ivi_layout_interface
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-02-07 11:54:37 +02:00
Alexandros Frantzis 7d2abcf6c8 libweston: Use struct timespec for touch motion events
Change code related to touch motion events to use struct timespec to
represent time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 27a51b83e5 libweston: Use struct timespec for touch up events
Change code related to touch up events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 9448deb073 libweston: Use struct timespec for touch down events
Change code related to touch down events to use struct timespec to
represent time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 47e79c860b libweston: Use struct timespec for key events
Change code related to key events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 80321942e7 libweston: Use struct timespec for axis events
Change code related to axis events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 215bedc88b libweston: Use struct timespec for button events
Change code related to button events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 84b31f8956 libweston: Use struct timespec for motion events
Change code related to motion events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27 11:42:07 +02:00
Alexandros Frantzis 0343c6ac69 ivi-shell: Fix incorrect use of logical instead of bitwise operator
Fix the code to use the correct bitwise AND operator '&', instead of the
currently used logical AND operator '&&', to check the value of a bit
flag in a bit mask.

This problem was reported as a warning when building with clang.

Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2017-11-24 14:02:19 +02:00
Pekka Paalanen 9ffb25009c libweston: introduce weston_output_from_resource()
This is a simple wrapper for casting the user data of a wl_resource into
a struct weston_output pointer. Using the wrapper clearly marks all the
places where a wl_output protocol object is used.

Replace ALL wl_output related calls to wl_resource_get_user_data() with
a call to weston_output_from_resource().

v2: add type assert in weston_output_from_resource().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
2017-07-25 16:08:48 +03:00
Michael Teyfel d2535d7614 ivi-shell: Fixed broken link to wiki page in ivi-layout header file
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-25 13:41:52 +03:00
Ucan, Emre (ADITG/SW1) 57ac260c5d ivi-shell: remove orientation calculation
Dead code as orientation cannot be changed anymore, see patches:
ivi-shell: remove layer_set_orientation API
ivi-shell: remove surface_set_orientation API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: added commit message]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-24 13:33:05 +03:00
Ucan, Emre (ADITG/SW1) 6e423ed996 ivi-shell: remove layer_set_orientation API
This API is used to rotate the contents of
application's buffer, which are in the render
order list of the layer. But this API is not
needed because an application can rotate
its buffers with set_buffer_transform request
of wl_surface interface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-24 13:33:00 +03:00
Ucan, Emre (ADITG/SW1) 9337197f82 ivi-shell: remove surface_set_orientation API
This API is used to rotate the contents of
application's buffer. But it is not needed
because an application can rotate its buffers
with set_buffer_transform request of
wl_surface interface.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-24 13:32:48 +03:00
Ucan, Emre (ADITG/SW1) deee858b0b ivi-shell: add_screen_remove_layer API
It is analagous to layer_remove_surface API.
The API removes a layer from the render order
of the screen.

v3:
add the new vfunc at the end of
the ivi_layout_interface struct.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-07-24 13:13:37 +03:00
Raúl Peñacoba bd8dc0a255
ivi-layout: Add missing free() in ivi_view_create
Signed-off-by: Raúl Peñacoba <raul.mikaop.zelda@gmail.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-03-31 01:32:46 +02:00
Ucan, Emre (ADITG/SW1) 7fe0bb2580 ivi-shell: Damage view below after unmapping
If ivilayer or ivisurf of ivi_view is made invisible in the
commit_changes call, we have to damage the weston_view below this
ivi_view. Otherwise content of this ivi_view will stay visible.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-07 15:03:10 +02:00
Ucan, Emre (ADITG/SW1) 27799355a9 ivi-shell: simplify commit_changes function
It is a better idea to use one for loop instead
of using three nested for loops.

We do not need to update the transformation of
views according to the scenegraph. The important
thing is that every visible view is updated before
commit_changes function returns.

The first if statement checks, if the view is on
the currently rendered scenegraph. The second if
statement checks, if the view's layer or surface
is visible. These checks ensure that we do not
update the transformation matrix of a view, which
is not visible on the screen.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: minor whitespace fix]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-06 12:11:33 +02:00
Ucan, Emre (ADITG/SW1) 1b92ba20ac ivi-shell: pass only ivi_view to update_prop
We can get ivisurf, ivilayer and iviscreen
easily from ivi_view. Then, we do not need
to check, if ivi_view's layer is the same
as the given ivilayer.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-06 12:10:56 +02:00
Ucan, Emre (ADITG/SW1) 847c32d34b ivi-shell: don't check layer is already on the screen
If a layer is removed from a screen's render order list, but the
changes are not commited. Then, the layer could not be added to the
same screen. Because on_screen property of the layer is only changed
in ivi_layout_commit_changes API, when active render order of the screen
is changed.

It is not possible to change the order of layers in a screen without
clearing and commiting the changes before. This patch fixes this issue.

After this patch, the pending render order list of a screen is always
modified regardless of its active render order list.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-27 16:43:47 +02:00
Ucan, Emre (ADITG/SW1) 67ed902f4b ivi-shell: don't check view is rendered before adding surface
If a surface is removed from a layer's render order list, but the
changes are not commited. Then, the surface could not be added to the
same layer. Because ivi_view of the surface is still in the render order
list of the layer.

It is not possible to change the order of surfaces in a layer without
clearing and commiting the changes before. This patch fixes this issue.

After this patch, the pending render order list of a layer is always
modified regardless of its active render order list.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-27 16:43:46 +02:00
Ucan, Emre (ADITG/SW1) 6660252274 ivi-shell: fix typo in layer_destroy API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-27 16:39:43 +02:00
Quentin Glidic da01c1d105
weston: Make the shell entrypoint specific
This avoids loading a shell as a module, so we are sure to have only one
shell loaded at a time.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-01-17 18:24:58 +01:00
Quentin Glidic 8af2beccbd
weston: Properly namespace modules entrypoint
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-01-17 18:24:56 +01:00
Quentin Glidic 82681571cf libweston: Position layers in an absolute way
Currently, layers’ order depends on the module loading order and it does
not survive runtime modifications (like shell locking/unlocking).
With this patch, modules can safely add their own layer at the expected
position in the stack, with runtime persistence.

v4 Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Daniel Stone <daniels@collabora.com>
[Pekka: fix three whitespace issues]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-17 16:50:18 +02:00
Abdur Rehman b833d742c7 ivi-shell: fix minor typos
- ivi-shell/hmi-controller.c:41: a to an
- ivi-shell/hmi-controller.c:1296: Duplicated 'a'
- ivi-shell/ivi-layout-export.h:28: An to A

Signed-off-by: Abdur Rehman <arehmanq199@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2017-01-03 11:58:52 +00:00
Ucan, Emre (ADITG/SW1) 7da3823ae3 ivi-shell: describe members of type wl_list
I wrote comments on which list they are used with

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: fix surface_list to layer_list, add ivi_layout_transition_set::transition_list]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-09 16:00:36 +02:00
Ucan, Emre (ADITG/SW1) 606f59261d ivi-shell: clear unused struct members
I removed unused members of ivi_layout* data
structs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-09 16:00:19 +02:00
Quentin Glidic 2edc3d5462
libweston: Rename weston_surface::configure to ::committed
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Giulio Camuffo <giulio.camuffo@kdab.com>

Differential Revision: https://phabricator.freedesktop.org/D1246
2016-08-14 09:28:50 +02:00
Jussi Kukkonen 649bbce607 include stdint.h for int32_t/uint32_t
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-26 16:26:08 -07:00