Commit Graph

4910 Commits

Author SHA1 Message Date
Egor Starkov 7ce2e971b2 compositor: systemd notifications support
Add systemd status and watchdog notification support.
Feature is not compiled by default and can be enabled by
"--enable-systemd-notify" configuration flag. It compiles
into module "systemd-notify.so" and can be loaded by
adding it in weston.ini like any other module, i.e.
"modules=systemd-notify.so". Watchdog timeout equals to
half of timeout defined by "WATCHDOG_USEC" environment
variable, which is set by "WatchdogSec=" setting in
service file.

Signed-off-by: Egor Starkov <egor.starkov@ge.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-25 15:11:32 -07:00
Bryce Harrington 892122ed64 tests: Migrate screenshot code from internal test to client helpers
These routines provide test cases an ability to capture screen images
for rendering verification.

This commit is a no-change refactoring, except for making the routines
non-static.  Makefile rules are also updated; most notably, this links
test clients against the cairo libraries now.

v2: Fix pointer code styling, suggested in review

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-25 11:23:08 -07:00
Derek Foreman 89dcea9b58 text: Switch to weston_client_start instead of weston_client_launch
We really don't want to deal with sighups and pids.  It's far easier
to just deal with the client destroyed signal to respawn the input method.

Inspiration taken from Pekka's commit 826dc14ec4

This fixes a potential crash on shutdown.  If the input method client
pointer is still set (sighup handler hasn't run) but the client is
already destroyed, a call to text_backend_destroy() will try to destroy
the client a second time resulting in a segfault.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-24 13:50:13 -07:00
Derek Foreman e821ce6869 text: Don't track binding in struct text_backend
The binding is only used for preventing launch, and we've already got the
pid for that.

With multiple seats there are multiple bindings, so if the most recent
binding unbinds it will clear the pointer, so using it like this is risky
anyway.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-24 13:50:11 -07:00
Derek Foreman b4bacd258d text: Launch input method in text_backend_init
Previously we tried to launch the input method every time a seat was
created, and the launch function would notice it was running and not
bother to actually launch.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-24 13:50:08 -07:00
Derek Foreman e7d868aaad launcher: fix typo
In the launcher split up patch WESTON_LAUNCHER_SOCK was accidentally
changed to WESTON_LAUNCH_SOCK

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-24 13:37:40 -07:00
Derek Foreman cb15620b74 launcher: fix broken distcheck
We were missing launcher-impl.h in Makefile.am

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-24 12:03:26 -07:00
Egor Starkov 56fe1c7edd compositor: remove incorrect idle timer initialization
weston_compositor_create() should just create idle timer but not arm it,
because idle-time setting is not ready at this point.

Remove idle timer first update in weston_compositor_create() since
idle_time variable is not set at this point. Idle timer is armed
properly later in weston_compositor_wake().

Signed-off-by: Egor Starkov <egor.starkov@ge.com>
[Pekka: tweaked commit message]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-09-24 13:26:23 +03:00
Bryce Harrington 44bbdd08af fbdev: Ensure strncpy results are null terminated.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-23 17:39:05 -07:00
Lucas Tanure c8dcd16b01 ivi-layout-transition: Fix potential leak of memory pointed to by transition
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>
2015-09-23 17:02:28 -07:00
Jasper St. Pierre ae5df83f8e launcher-logind: Remove old VT switching code, move to SwitchTo/Activate
In the time since this code was written, logind has gained new APIs to
handle VT switching automatically and activate sessions. Switch to that.

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-23 15:47:50 -07:00
Jasper St. Pierre 72dea06d79 launcher: Split out launcher implementations into three distinct ones
We now have a launcher interface and distinct implementations for
logind, weston-launch, and direct DRM, each in their own files.

This helps up clean up the spaghetti code into something that's
hopefully a bit more understood. There should be no functional
changes here.

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>

update:  Dropped redundant free() in weston_launcher_destroy()
2015-09-23 15:47:48 -07:00
Jasper St. Pierre 30bcf35ceb launcher: Rename logind-util to launcher-logind
We're refactoring this to have multiple launcher "implementations".

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-23 15:47:36 -07:00
Bryce Harrington 9c7de167f8 compositor-drm: Ensure strings from EDID blobs are null terminated
strncpy only adds null terminating bytes if the source string is smaller
than the destination string.  Since this function relies on the string
being null terminated when checking its contents, we better make sure
there is at least a \0 as the last character.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-22 18:40:57 -07:00
Manuel Bachmann e54cee17a7 terminal: allow copy-paste when selection is scrolled out
We could not paste text when its source went outside the
visible part of the buffer ; this is because we were
incorrectly assuming that our iterator should start at
row 0, while it could very well be negative.

Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 18:37:19 -07:00
Marek Chalupa a1f3f3c9f2 xwm: flush xcb connection only when we processed some event
xwayland source is checked, so it dispatches twice on any event.
If the other turn has no events to dispatch, we flush the connection
redundantly

v2. do not flood logs with 'unhandled event' messages

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 18:35:01 -07:00
Seedo Eldho Paul 43af680abf tests: Convert 'xalloc's to 'zalloc's
xalloc terminates the program abruptly if the requested amount of
memory couldn't be allocated. To insure that the errors are handled
cleanly, use zalloc instead.

Signed-off-by: Seedo Eldho Paul <seedoeldhopaul@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 18:23:44 -07:00
Derek Foreman 673bbe2e8c clients: ungrab the correct input when menus close
We need to input_ungrab() on the stored input, not the one that caused
the release - otherwise bad things can happen in multi-seat environments
when a seat that didn't open the menu closes it.

To reproduce:
 configure two seats
 launch weston terminal
 open the right click pop up
 select a menu item from the other seat

The next click from the seat that opened the menu will cause a segfault.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 18:22:28 -07:00
John-John Tedro 9d7aff0e38 ivi-shell: initialize all fields in create_layout_transition
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>
2015-09-22 18:19:20 -07:00
Lucas Tanure bfae30d814 vaapi-recorder: Fix allocator sizeof operand mismatch
Result of 'calloc' is converted to a pointer of type 'unsigned int', which is
incompatible with sizeof operand type 'int'

Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 17:22:19 -07:00
Lucas Tanure 193c7a54a8 ivi_layout_surface_add_notification: Fix potential leak of memory pointed to by 'notification'
Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 17:18:32 -07:00
Lucas Tanure 96db07741f ivi-layout-transition: Fix potential leak of memory pointed to by transition
Check if layout_transition_register worked, otherwise destroy transition

Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 14:37:27 -07:00
Lucas Tanure 9b5fe423bf ivi-layout-transition: Change layout_transition_register return type
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>
2015-09-22 14:37:19 -07:00
Lucas Tanure 9af0017077 ivi-layout-transition: Fix potential leak of memory pointed to by transition
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>
2015-09-22 14:37:10 -07:00
Bryce Harrington 713acd6860 releasing: Update command path to reflect new scripts dir in wayland-web 2015-09-22 13:40:43 -07:00
Bryce Harrington 8c15360ded configure.ac: bump to version 1.9.90 for open development
Master is open for new feature development again.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-22 13:38:25 -07:00
Bryce Harrington b05cdb82f7 configure.ac: bump to version 1.9.0 for the official release 2015-09-21 18:11:26 -07:00
Bryce Harrington 90e2d07ec1 releasing: Note need for pgp signing announcement 2015-09-17 16:33:48 -07:00
Bryce Harrington 30e24ed51c configure.ac: bump to version 1.8.93 for the RC1 release 2015-09-15 20:20:37 -07:00
Derek Foreman 45a7c27f2b clients: If available, prefer top level surfaces for move or rotate
This stops us from rotating or moving pop-up menus by instead rotating
their parents.

This is easiest to see using a multi-seat configuration.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-15 06:51:15 -07:00
Derek Foreman c0c1497f99 shell: Make sure we actually have a resource in end_busy_cursor
It's actually possible to get here after the surface has been destroyed,
especially when running client apps under valgrind.

That probably shouldn't be able to segfault the compositor.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-14 11:33:31 -07:00
John Sadler ca510d06dc rpi: fix segfault at startup in rpi_flippipe_init() v2
When running with the RPi backend, Weston now segfaults at startup on the
line:

    flippipe->clk_id = output->base.compositor->presentation_clock;

in `rpi_flippipe_init()`.

This is because `output->base.compositor` is NULL. This problem did not
exist on 1.8.0, and it looks like it may have been introduced by 954f183e2f.

This commit ensures that the `compositor` is initialised in `rpi_backend`
and that flippipe init uses the compositor pointer from backend.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91885

Signed-off-by: John Sadler <deathofathousandpapercuts@gmail.com>

Changes in v2:
- fix summary to not break the build
- use output->backend->compositor in rpi_flippipe_init() instead of
  output->base.compositor. The latter is set by weston_output_init()
  which gets called later than rpi_flippipe_init().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: John Sadler <deathofathousandpapercuts@gmail.com>
2015-09-10 10:45:03 +03:00
Derek Foreman 7978bc82dd terminal: Don't crash when selecting non-ascii characters
So it turns out if you cat /dev/urandom and drag select in the mess
you can crash weston-terminal.  There may also be more legitimate
ways of doing this.

The reason is that isalpha() and isdigit() only accept values that
fit within an unsigned char or are EOF.

By treating values < 0 the same as values > 127 we prevent this crash.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-10 10:07:16 +03:00
Derek Foreman 617933840b compositor-fbdev: Remove bizarre division by sizeof
Really not sure why this was even here - it worked because
we were dividing by 1.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-10 10:01:03 +03:00
Pekka Paalanen 3f32a13acd Revert "compositor-drm: disable hardware cursors"
This reverts commit 6858383d51.

The main reason for the original patch was a regression on the Intel
drivers causing compositor framerate to drop to half during cursor
updates or motion. The Intel problem was fixed in
2e7f43c41c
The fix is included in Linux 4.1-rc6 and 4.0.5.

The comment in the original patch is still true, but arguably the
possible minor glitches with cursor updates are less bad than not using
cursor planes at all.

Cc: nerdopolis <bluescreen_avenger@verizon.net>
Cc: Daniel Stone <daniel@fooishbar.org>
Cc: Giulio Camuffo <giuliocamuffo@gmail.com>
Cc: David FORT <contact@hardening-consulting.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-09 10:13:05 +03:00
Bryce Harrington ae6f1bb3f7 clients: Fix height typo in clamp_view()
We should be checking our scaled image height against the allocation
height rather than the allocation width.

Fixes vertical image motion when horizontal motion restricted, i.e.
when window is wide and short compared to the image.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-09-09 10:07:27 +03:00
John Sadler 7628789640 rpi: prevent segfault on shut-down due to NULL backend
When running with the RPi backend, Weston sefaults during shutdown. This is
due to the fact that `compositor->backend` is never initialised, and there
is no NULL check prior to calling `destroy()`.

This commit fixes the issue by making `rpi_backend_create()` intialise
`compositor->backend` - just like the X11 backend does.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91886

Signed-off-by: John Sadler <deathofathousandpapercuts@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-09-08 16:53:45 +03:00
John Sadler 960b5ebd82 rpi: avoid segfault in rpir_view_compute_rects() when EGL client destroys buffer
This commit works-around a serious issue when running with the RPi backend.
When an EGL client shuts down and destroys it's EGL window, Weston dies with
a segmentation fault in the above function (because `buffer` is now NULL).

The addition of a simple NULL check avoids the problem.

This is a minor re-formatting of the patch already submitted here:

  http://patchwork.freedesktop.org/patch/34885

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85167

Signed-off-by: John Sadler <deathofathousandpapercuts@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-09-08 16:21:45 +03:00
Bryce Harrington cdb91d019f configure.ac: bump to version 1.8.92 for the beta release 2015-09-01 16:58:25 -07:00
Nobuhiko Tanibata 4412cd1974 hmi-controller: fix wrong width and height are set to a layer of workspace.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-08-26 11:13:29 +03:00
Nobuhiko Tanibata d290f881d5 hmi-controller: fix the laucher layer width
A layer for workspace is used to display icons for invoking applications
in several pages. These pages are swapped from one to next page. The
width of the layer was decided as a size of screen before reading
weston.ini. This worked correctly because there was no feature of
clipping of layer so the width of layer was not taken account.

Now clipping feature is supported. So the width shall be set to correct
one after reading weston.ini.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-08-26 11:13:23 +03:00
Nobuhiko Tanibata acbcc6c978 ivi-layout: implement surface clipping
View clip region is set in surface-local coordinates. To compute that
region, the ivi-layer destination rectangle in the global coordinates
are transformed back into the surface-local coordinates.

The transformation is computed by first forming the transformation
matric for the forward mappings, and then inverting it. The inverse
matric is used to transform the destination rectangles to the
surface-local coordinate system. The intersection of the rectangles is
the view clip mask.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-08-26 11:12:49 +03:00
Pekka Paalanen ab81f1515a build, compositor-drm: fix output name constants another way
Bumping libdrm requirement by 3 years just for output connector name
constants was a bit much. Fix the problem introduced in
89c49b3060 by conditionally using the new
additions.

Both VIRTUAL and DSI came in the same libdrm commit
566c3ce877a4be72697e15cdfc421ce965f7c37d, so we check only for DSI.

This patch also reverts faee330c5e.

Reported-by: Eugen Friedrich <friedrix@gmail.com>
Cc: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
2015-08-24 16:33:46 -07:00
Derek Foreman faee330c5e build: Require newer version of libdrm
commit 89c49b3060 changed the way we name
outputs, but it also added the new output names VIRTUAL and DSI.

These aren't available until libdrm 2.4.59

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-08-24 11:45:41 +03:00
Jonas Ådahl decc965be9 clients: Drop deadlock circumvention hack now that we don't need it
mesa supports EGLSwapInterval 0 now, so lets remove this hack. As a
bonus we don't conflict with the XDG shell protocol that doesn't allow
committing a null-buffer, which was a side effect of this hack.

This patch reverts e9297f8e7e. See that
commit for an explanation how this worked.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
[Pekka: added reference to the original commit]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-08-21 15:22:03 +03:00
Dawid Gajownik 1a912a9fe3 gl-renderer: gl_renderer_create display cleanup on error
Clean up display connection via eglTerminate() in case of EGL
initialisation error.

Signed-off-by: Dawid Gajownik <gajownik@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-08-21 15:00:10 +03:00
Pekka Paalanen 89c49b3060 compositor-drm: rename outputs to follow kernel style
The problem with the old table of names is that it contains duplicates.
It is possible to end up with multiple outputs with the same name. In
that case you cannot write individual configurations for these outputs
in weston.ini, because they are matched by the name.

Change all names to follow the kernel naming scheme set in
drivers/gpu/drm/drm_crtc.c. The snprintf format now follows the kernel
style, too. Use the DRM_MODE_CONNECTOR_* macros rather than implicit
table ordering.

Completely new entries in the table are "Virtual" and "DSI".

There should not be any gaps in the macro values, but if there are, deal
with a NULL entry.

Also change "UNKNOWN" to "UNNAMED" so it's easier to distinguish from
"Unknown" by the kernel.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89361
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Tested-by: Drew DeVault <sir@cmpwn.com>
2015-08-21 14:46:41 +03:00
Ucan, Emre (ADITG/SW1) cf34dc2334 ivi-shell: remove redundant wl_list_empty/init calls
Checking wl_list_empty() on a link offers no information: if it returns
true, wl_list_remove() is safe to do. If it returns false, you still do
not know if wl_list_remove() is safe; the link could be part of a list,
or the link could be "uninitialized" (e.g. just wl_list_remove()'d).
(From Pekka Paalanen's comment at
http://lists.freedesktop.org/archives/wayland-devel/2015-August/023987.html).

Calling wl_list_init just before wl_list_insert is redundant.  Because
the links of the list are not read before it is overwritten by
wl_list_insert.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: line-wrapped commit message]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-08-21 12:03:33 +03:00
Ucan, Emre (ADITG/SW1) 174257bdf8 ivi-shell: clear order.layer_list before reordering it
It is only possible to remove a layer from the order.layer_list of a
screen, when ivi_layout_screen_set_render_order is called with an empty
array.  Therefore, list of layers are cumulated if the API is called
many times with different list of layers.

Change how the flags are set:
    - Introduce the dirty parameter for triggering the render order change.
    - IVI_NOTIFICATION_REMOVE/ADD flags are set only at commit_screen_list.

Checking wl_list_empty() on a link offers no information: if it returns
true, wl_list_remove() is safe to do. If it returns false, you still do
not know if wl_list_remove() is safe; the link could be part of a list,
or the link could be "uninitialized" (e.g. just wl_list_remove()'d).
(From Pekka Paalanen's comment at
http://lists.freedesktop.org/archives/wayland-devel/2015-August/023987.html).

Calling wl_list_init just before wl_list_insert is redundant.  Because
the links of the list are not read before it is overwritten by
wl_list_insert.

Use assert to control if the ivilayer->order.surface_list is empty.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: line-wrapped commit message]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-08-21 11:53:43 +03:00
Ucan, Emre (ADITG/SW1) 38fcf381be ivi-shell: clear order.surface_list before reordering it
It is only possible to remove a surface from the order.surface_list of a
layer, when ivi_layout_layer_set_render_order is called with an empty
array.  Therefore, list of surfaces are cumulated if the API is called
many times with different list of surfaces.

Change how the flags are set:
- Introduce the dirty parameter for triggering the render order change.
- IVI_NOTIFICATION_REMOVE/ADD flags are set only at commit_layer_list.

Checking wl_list_empty() on a link offers no information: if it returns
true, wl_list_remove() is safe to do. If it returns false, you still do
not know if wl_list_remove() is safe; the link could be part of a list,
or the link could be "uninitialized" (e.g. just wl_list_remove()'d).
(From Pekka Paalanen's comment at
http://lists.freedesktop.org/archives/wayland-devel/2015-August/023987.html).

Calling wl_list_init just before wl_list_insert is redundant, because
the links of the list are not read before it is overwritten by
wl_list_insert.

Use assert to control if the ivilayer->order.surface_list is empty.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: wrapped the commit message]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

[Earlier version Reviewed-by: Nobuhiko Tanibata
<NOBUHIKO_TANIBATA@xddp.denso.co.jp>]
2015-08-21 11:46:23 +03:00