Commit Graph

4938 Commits

Author SHA1 Message Date
Jon Cruz a151975347 doc: Correct absolute path in doxygen graphs.
Adds a config item to prevent doxygen from using absolute paths in
generated diagrams. This trims off the base directory during config to
leave just relative paths.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-10-07 17:09:09 -07:00
Derek Foreman bdc8c721e4 cosmetic: Remove a few double semicolons
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-10-07 11:22:03 -07:00
Jonas Ådahl bc5d849c9d desktop-shell: NULL check whether a popup parent is a shell surface
get_shell_surface(parent) may return NULL if the client passed a
unassigned wl_surface or a wl_surface with a non-shell surface role
(such as cursor role).

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

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-10-07 11:43:59 -05:00
Chris Michael 3f607d3e1c weston-input: Reformat weston_log line to add missing space between words
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-10-07 11:34:49 -05:00
Ben Hummon 445e44cfb2 clients: Moving and rotating transient surfaces
Transient surfaces use child/parent surfaces for stacking order. This
change resloves an issue in which attempting to move or rotate a
toplevel transient surface can move or rotate its ancestor.
2015-10-06 15:24:28 -05:00
Lucas Tanure ed8dd4ef6a animation: Fix potential leak of memory pointed to by move
Free move before return if animation is null.

Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-10-05 18:54:29 -07:00
Giulio Camuffo 3c241b18b8 main: fix destroying the compositor on error while starting
Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-10-05 16:42:40 -05:00
Giulio Camuffo 2d24e64776 compositor: don't crash if destroying a compositor without a backend
Calling weston_compositor_destroy() on a pointer returned by
weston_compositor_create() should be always valid, even if the
compositor does not have yet a backend.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-10-05 16:22:13 -05:00
Chris Michael 7e17fec68d compositor-rdp: Add missing '\n' in weston_log usage
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-01 10:04:22 -07:00
Chris Michael c262b4a94f cms-colord: Add missing '\n' in weston_log usage
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-01 10:04:21 -07:00
Chris Michael 5169a57013 screen-share: Add missing '\n' in weston_log usage
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-01 10:04:18 -07:00
Chris Michael c083af9907 ivi-shell: Add missing '\n' in weston_log function usage
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-01 10:04:15 -07:00
Ucan, Emre (ADITG/SW1) 64635ee699 ivi-shell: introduce get_weston_view
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.]
2015-10-01 12:56:32 +03:00
Ucan, Emre (ADITG/SW1) 4a18364595 ivi-shell: remove is_surface_in_layer API
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>
2015-10-01 12:35:49 +03:00
Ucan, Emre (ADITG/SW1) bb4ec0a186 ivi-shell: remove is_layer_in_screen API
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>
2015-10-01 12:34:24 +03:00
Ucan, Emre (ADITG/SW1) dfac375993 ivi-shell: remove struct link_layer
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.]
2015-10-01 12:09:40 +03:00
Ucan, Emre (ADITG/SW1) 8a223673ad ivi-shell: remove struct link_screen
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.]
2015-10-01 12:07:39 +03:00
Derek Foreman dcba1a10d3 xdg-shell: Clarify ack_configure behaviour
Right now many toolkits (toytoolkit, gtk+ and EFL) will send an
ack_configure request immediately in response to a configure event,
even if they're not immediately committing the surface at that time.

This leads to a situation where multiple configures receive ack_configure
before any commit happens.

There's really no reason for that sequence of events to bother a compositor,
so this just clarifies the language to make it ok.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2015-09-30 13:06:44 -07:00
Derek Foreman 0b7da01c04 cosmetic: add missing line between variable declarations and code
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-30 12:33:52 -07:00
Lucas Tanure a3377cd114 ivi-layout-transition: Standardize the check for layout_transition_register
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>
2015-09-30 12:27:56 -07:00
Giulio Camuffo aa9747833e xwm: use always a valid 'primary view' for an X window
The xwm gets a primary view for a X window using the get_primary_view
vfunc of the shell_interface struct. Storing it is dangerous though
because it doesn't listen for its destruction so it may end up using the
old stored view pointer after that view was freed, or after the primary
view for that window was changed to another one.

Fetch the primary view just before using it every time and try to not
abuse this 'primary view' concept which may map badly to some shells:
iterate over all the views instead when it makes sense.

Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-29 18:22:45 -07:00
Frederico Cadete 8e1efcd40b configure.ac: add explicit enable/disable for systemd-login support
Otherwise, auto-enable depending on whether the system has the necessary
libraries.

[Updated help text as per pq suggestion -- bwh]

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-09-29 18:15:33 -07:00
Egor Starkov 94fd9a5694 compositor: remove systemd-notify.h
Systemd notifications support was converted into loadable
module, so systemd-notify.h header is not needed.

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>
2015-09-29 18:10:33 -07:00
Chris Michael 90eea27f05 compositor-wayland: Terminate weston_log error message
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
[Pekka: manually applied]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-09-29 17:03:20 +03:00
Frederico Cadete 5eb025a867 configure.ac: add support for new versions of systemd
Starting from systemd version 209, a single libsystemd.pc is provided.
For previous versions, fall back on libsystemd-login.pc.

Signed-off-by: Frederico Cadete <frederico@cadete.eu>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-09-28 17:28:27 -07:00
Benoit Gschwind 1a42ca1596 weston_wm: Implement _NET_ACTIVE_WINDOW
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-09-25 15:37:25 -07:00
Emmanuel Gil Peyrot c59f18ed19 compositor-wayland: Expose zlinux_dmabuf
This mirrors what 5ffb440c3f did for
compositor-x11, and allows testing without having to restart the
compositor-drm everytime.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-09-25 15:21:14 -07:00
Bryce Harrington a0dd5b4d1f systemd: Fix distcheck for typo in header path 2015-09-25 15:16:25 -07:00
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