get_surfaces_on_layer() allocates memory and stores the pointer to
'ivisurfs'. But it was not freed.
Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The warning of ivisurface reassign can be removed. It is ok to reassign
a surface to a layer it is already on.
The warning started to show up during normal operations since patch
"hmi-controller: remove duplicate commit_changes in random mode".
Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
[Pekka: rewrote commit message, removed unneeded comments.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Previous code cleaned up surfaces in layer once and then added
surfaces to a layer in random. In this flow, two commitchanges are
required.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[WATARU_NATSUME@xddp.denso.co.jp: Removes unnecessary check]
Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
update_opacity is only called when a ivi-surface is visible. But the
previous code also checks event masks redundantly. However if the event
happens when ivi-surface is invisible, opacity is not calculated. This
patch removes this redundant check to fix potential bug.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
[jonas: only send focus wl_pointer.frame if resource supports it]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Use an event struct to pass axis events around. This helps dealing with the
upcoming axis discrete changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
It shows ivi applications at screensa randomly.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It shows ivi applications in fullscreen per screen like,
The first screen: Application 1,4,5,6,,,,
The seconed screen: Application 2,
The third screen: Application 3
Thie mode assigns one application to each screen at first. And remaind
applications more than screens will be assigned to the first screen.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It shows 2 ivi application in a screen at side-by-side. It moves
additinal application more than 2xN to next screen N+1.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It shows 8 ivi applications in a screen at tiling. It moves additional
application more than 8xN to next screen N+1.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
To locate surfaces of application on multi screens, multi layers are
created baseod on application-layer-id + base-layer-id-offset x N.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
A surface ID for layer of background/panel image is set by key: background-id
or panel-id at weston.ini. To support multi screens, it also support offset,
surface-id-offset, to offset the surface ID to next ID for a layer on next
screen.
According to the above key, hmi-controller and ivi-shell-user-interface
who increments the number of screens per notification of wl_output.
crate surface and draw background/panel image on multi surface on screens.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
A layer ID for screen is set by key: base-layer-id at weston.ini. To
support multi screens. It also support offset to offset the layer ID
to next ID for next screen.
For example,
base-layer-id=1000
base-layer-id-offset=10000
Layer id for screen 0: 1000
Layer id for screen 1: 11000
Layer id for screen 2: 21000
To support multi screen, create layers for background and panel bar which
located in the below per screens. At the moment, it is only layers.
Surfaces to be created at next patch in the patch set.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
- get screens from weston core
- provide screens as internel method
- the iviscn is stored in array inverse order in index.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
A weston_surface is transformed to multi screen coordinate, global
coordinate by matrix:m now.
Additionally, a mask needs to be calucated, taking account into,
- multi screen coordination: a destination rectangle of layer in the
coordination is easily calcurated by adding weston_output.{x,y} in
simple. This is because there is no scaled and rotated transformation.
- intersect inside of a screen the layer is assigned to. This is because
overlapped region of weston surface in another screen shall not be
displayed according to ivi use case.
Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
In single screen, the coordinates of layer local coordinates are the
same as global coordinates. However, to support multi screens, the
layer-local coordinates shall be transformed to multi screen coordinates,
which is global coordinates. The abosolute coordinates of a screen in global
stored in (x,y) of output of its weston output so it shall be used to
transform layer-local to global coordinates.
Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
For multi screen support, ivi_layout_screen to be taken account into
property change in commitChanges.
Property change is now done in update_prop so to consider ivi_screen
property for caluculating transform of weston surface, ivi_layout_screen
is added as a parameter of update_prop.
However, update_prop of weston_view of a ivi_surface can not be done
even if it is set on a screen. The propoerty change shall be done only
when a visibility of ivi_surface or ivi_layer which contains the
ivi_surface is ON. Such a condition shall be checked at commit_changes
as well to avoid calling update_prop, which actually updates
weston_views.
Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Similar with Desktop shell, set activate to weston surface which is
left-clicked by pointer or touched. This is needed to focus it with a seat.
Without this, a feature who gets activated weston surface by using
weston_surface_get_main_surface doesn't work correctly because it can
not get correct focused weston surface. For example, input-panel uses
weston_surface_get_main_surface to get a weston surface. With this
weston surface, it get a member: output to decide which output shall
show a input-panel, software keyboard. Without activation,
input-panel-ivi can not find a correct output which shows e.g.
weston-editor who uses input-method.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It breaks from wl_list_for_each of screens when the frist screen found.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This is potential bug when it supports several screens. If view_list is
initilized here, the views, which are set by the previous screen, are
cleared. So View list shall be initilized in front of wl_list_for_each
of all screens.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
In just previous wl_list_for_each_safe, list of layer in a screen is
cleaned up. And then, the list is re-constructed from
pending.layer_list.
In this re-construction, if order.link of a layer were inserted into a
screen whose number is later one of current screen, the order.link will
inserted into layer_list of two screens. This shall be avoided.
However, if we want to implement a feature to allow a layer to be added
to multiple screens. A layer shall have several order.link per screens.
So, I marked here as TODO.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It just return the first screen found in screen list.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Instead of only passing absolute pointer coordinates, effectively
loosing motion event data, pass a struct that can potentially contain
different types of motion events, currently being absolute and relative.
A helper function to get resulting absolute coordinates was added for
when previous callbacks simply used the (x, y) coordinates.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Don't only send motions and buttons but also axis events through the
pointer grab interface.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
The name of ivi_controller_interface is changed to ivi_layout_interface
with this patch.
This name is better suited to the interface, because it is implemented
in ivi-layout.c and its methods are linked to ivi_layout* functions.
Furthermore, the controller modules (e.g. hmi-controller) are the users
of this interface and they have their own interfaces,
which are called *_controller_interface,
e.g.: ivi_hmi_controller_interface.
This causes confusion about the software architecture.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
The internal API "get_weston_view" is introduced, which returns the
weston_view of the given ivi_layout_surface. The API returns a NULL
pointer, if the ivi_layout_surface does not have any weston_view.
The weston_view is required in many places of ivi-shell implementation.
Therefore, this API will reduce lines of code. Furthermore, it will
increase the maintainability of the ivi-shell implementation.
Old way of getting the weston_view was flawed, because the views list of
the weston_surface is read without controlling the existence of the
weston_surface. New implementation explicitly throws an error if the
weston_surface does not exist.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[Pekka: Line-wrapped the commit message.]
This internal API is redundant, because a surface is allowed to be only
on one layer.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
This internal API is redundant, because a layer is allowed to be only on
one screen.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
link_layer's sole purpose is to link a surface to multiple layers, if
the surface should be shown in multiple layers. This can be only
achieved, if the surface has multiple weston_views with different
transformation matrices.
Current implementation assumes in many places that a ivi_surface has
only one weston_view. Therefore, a surface can be only shown on one
layer.
Although this (a surface on multiple layers) is a nice to have feature
for ivi-shell, it is not very crucial. In any case, it is not an easy
task to implement this feature, because it has lot of corner cases.
I removed with this patch the link_layer data structure, because it does
not have any purpose in current implementation.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[Pekka: Line-wrapped the commit message.]
link_screen's sole purpose is to link a layer to multiple screens, if
the layer should be shown in multiple screens. This can be only
achieved, if surfaces of the layer have multiple weston_views dedicated
to the different screens.
Current implementation assumes in many places that a ivi_surface has
only one weston_view. Therefore, a layer can be only shown on one
screen.
Although this (a layer on multiple screens) is a nice to have feature
for ivi-shell, it is not very crucial. In any case, it is not an easy
task to implement this feature, because it has lot of corner cases.
I removed with this patch the link_screen data structure, because it
does not have any purpose in current implementation.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[Pekka: Line-wrapped commit message.]
Check the return from layout_transition_register in order to fix
potential leak of memory pointed to by transition. And don't register a
null transition.
Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Several fixes to handle invalid transition objects:
1. Free transition in ivi_layout_transition_fade_layer if we fail to
allocate memory for data
2. Check if transition is not null and if layout_transition_register was
ok before return, if not, free transition
3. Destroy transition if layout_transition_register was not ok, we can't
just free transition, we need to call layout_transition_destroy in
order to free private_data from transition
Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
create_layout_transition does not initialize is_transition_func.
This patch initializes it to NULL.
Signed-off-by: John-John Tedro <johnjohn.tedro@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
layout_transition_register could not work and we need to free trans in
the calling function.
Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Free transition before return. We don't need to use layout_transition_destroy,
because transition was not registered yet.
v2: consolidate memory leaks fixes
Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>