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.]
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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()
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>