Direct fail_on_null calls now produce output like:
[weston-info] clients/weston-info.c:714: out of memory
xmalloc, et al produce output on failure like:
[weston-info] out of memory (-1)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
the `shm_format` function seems to assume the `wl_shm_format`
enum has bit-exclusive enumerations which is not true.
Signed-off-by: Murray Calavera <murray.calavera@gmail.com>
[Pekka: fix whitespace with an 'if'.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Sometimes weston-simple-egl aborts in create_surface
under some conditions. It is because wl_display_dispatch()
may not be enough to make sure we have all requried objects.
Can be modeled by wldbg:
$ wldbg -i weston-simple-egl
(wldbg) b re get_registry
(wldbg) c
(wldbg) c
After these steps the weston-simple-egl aborts, because
it has not got shell neither ivi-shell objects
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This patch enhances the panel clock by adding a config file
option which can be used to either disable the clock or make
it also show seconds in the current clock format.
v2: Implement suggestions from Pekka:
- Include Signed-off-by
- Coding style fixes
- Implement clock widget allocation by using
width from cairo_text_extents
- Highlight config option values in man page
v3: Implement suggestions from Pekka and Bryce:
- Use CLOCK_FORMAT_* instead of FORMAT_* in the enum
- Switch to using fixed clock widget size instead
of one returned from cairo_text_extents
- Fixes to config option highlighting in the man page
v4: Implement more suggestions from Pekka and Bryce:
- Improve patch changelog
- Move the check for CLOCK_FORMAT_NONE into the
caller function
- Fix a memory leak in panel_create introduced by
previous revision of this patch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57583
Signed-off-by: Armin Krezović <armin.krezovic@fet.ba>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Remove the unstable presentation_timing.xml file, and use
presentation-time.xml from wayland-protocols instead to generate all the
Presentation extension bindings.
The following renames are done according to the XML changes:
- generated header includes
- enum constants and macros prefixed with WP_
- interface symbol names prefixed with wp_
- protocol API calls prefixed with wp_
Clients use wp_presentation_interface.name rather than hardcoding the
global interface name: presentation-shm, weston-info, presentation-test.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
[Pekka: updated wayland-protocols dependency to 1.2]
In order to keep things simple, weston-dnd made a few choices that
turn out to be unrealistic, a few tweaks have been done to make it
less of a playground demo:
- It now caters for copy/move operations, instead of just move,
which still remains the default nonetheless.
- As "move" operations are no longer assumed, the item isn't removed
on start_drag, instead it is made translucent until the drag
operation finishes (and we know whether the item is to be
removed after transfer or left as is)
- For the same reasons, "Drop nowhere to delete item" no longer
happens. Drag-and-drop is a failable operation and must not result
in data loss.
- As multiple actions are now allowed, we set the pointer icon
surface accordingly to the current operation.
This makes weston-dnd a better example of what applications usually
want to do here.
Changes since v2:
- Updated to behave alright-ish with version < 3.
Changes since v1:
- Remove unneeded include. Remove extra newlines. Other minor
code fixes.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
That way we'll be able to set the corresponding pointer surface to
a current DnD operation.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
The policy in weston in order to determine the chosen DnD action is
deliberately simple, and is probably the minimals that any compositor
should be doing here.
Besides honoring the set_actions requests on both wl_data_source and
wl_data_offer, weston now will emit the newly added "action" events
notifying both source and dest of the chosen action.
The "dnd" client has been updated too (although minimally), so it
notifies the compositor of a "move" action on both sides.
Changes since v8:
- Add back wl_data_offer.source_actions emission, gone during last
code shuffling. Fix nits found in review.
Changes since v7:
- Fixes spotted during review. Add client-side version checks.
Implement .action emission as specified in protocol patch v11.
Changes since v6:
- Emit errors as defined in DnD actions patch v10.
Changes since v5:
- Use enum types and values for not-a-bitfield stored values.
handle errors when finding unexpected dnd_actions values.
Changes since v4:
- Added compositor-side version checks. Spaces vs tabs fixes.
Fixed resource versioning. Initialized new weston_data_source/offer
fields.
Changes since v3:
- Put data_source.action to use in the dnd client, now updates
the dnd surface like data_source.target events do.
Changes since v2:
- Split from DnD progress notification changes.
Changes since v1:
- Updated to v2 of DnD actions protocol changes, implement
wl_data_offer.source_actions.
- Fixed coding style issues.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Michael Catanzaro <mcatanzaro@igalia.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Weston now sends wl_data_source.dnd_drop_performed and .dnd_finished in
order to notify about the different phases of DnD.
wl_data_source.cancelled is also used as mentioned in the docs, being
emitted also on DnD when the operation is meant to fail (eg. source
and dest didn't agree on a mimetype).
The dnd demo is also fixed so the struct dnd_drag isn't leaked.
https://bugs.freedesktop.org/show_bug.cgi?id=91943https://bugs.freedesktop.org/show_bug.cgi?id=91944
Changes since v6:
- Add client-side version checks. Minor code shuffling.
Changes since v5:
- Dissociate source and offer after cancel. Updated to
apply on top of c9f8f8a7f.
Changes since v4:
- Make wl_data_offer.finish with the wrong state an error.
Changes since v3:
- Fixed wl_data_source.dnd_finished vs cancelled emission on
when interoperating with version < 3 drag destinations.
Changes since v2:
- Handle wl_data_offer.finish. Fixed commit log inconsistencies.
Added version checks. Spaces vs tabs fixes. Fixed resource
versioning.
Changes since v1:
- Updated to protocol v2.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Michael Catanzaro <mcatanzaro@igalia.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
[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>
Cannot find out why stropts.h is needed and Linux doesn't support
streams anyway, so there is no stropts.h.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This client opens a V4L2 device, usually exposed as /dev/videoN, and
retrieves its frames as dmabuf for later import into the compositor.
It supports both single- and multi-planar devices, and any format
exposed by the V4L2 device the Wayland compositor accepts.
This client never changes the v4l2 settings, use `v4l2-ctl -c` if you
want to change those.
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Tested-by: Derek Foreman <derekf@osg.samsung.com>
Maniphest Tasks: T90
Differential Revision: https://phabricator.freedesktop.org/D339
Those were found while working on simple-dmabuf-v4l, as found in the
next patch of this series.
After each buffer’s params were ready to be submitted to the
compositor, a roundtrip was done, which is wasteful since we can do it
only once after having queued all the params we want. Removing those
nested roundtrips also prevent the potentially dangerous side-effect of
calling callbacks for later events while previous events were still
being processed.
An extraneous surface damage was also removed.
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Differential Revision: https://phabricator.freedesktop.org/D344
This client was using an Intel-specific way to allocate a dmabuf, so it
makes sense to have that in its name.
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Differential Revision: https://phabricator.freedesktop.org/D342
Fall back to not showing anything as before if we don't have a
compositor with wl_output new enough (version 2 or newer).
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
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>
Add a new flag for testing damage in buffer co-ordinates
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
We've been setting up the viewport by moving the start pointer of the
draw buffer, but later when we want to post damage in buffer co-ordinates
we'll need to keep track of the x,y offsets anyway.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
when weston is running on qemux86 device, there is an error with following.
[08:02:07.897] launching '/usr/lib/weston/weston-ivi-shell-user-interface'
[08:02:08.201] /usr/lib/weston/weston-ivi-shell-user-interface died on signal 11
this is caused by type mismatch, and
it does occur on qemux86-64
Signed-off-by: Yong-iL Joh <yong-il.joh@windriver.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
It's just a direct call to wl_surface_damage() anyway, and the only
caller no longer exists.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
We're going to post damage when the widget redraw happens anyway.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It doesn't fill a useful function and is not intended to be continued.
If there is need for workspace manipulation from clients a protocol
based on those future needs need to be properly designed.
workspaces.xml is probably not very relevant since it did the bare
minimum.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Due to the effort of moving a way from non-prefixed protocols, rename
the weston specific screenshooter protocol to weston_screenshooter.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
In the effort of going away from generic names of protocols only
relevant for weston, rename the weston desktop shell
weston_desktop_shell.
This also resets the version to 1, as there will be no prior versions
to weston_desktop_shell.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
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>
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>
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
We discard motion outside the window on the assumption it's from before
some event that caused the window to shrink. However, if we have a grab
it's likely that this motion is actually from dragging from the inside
of the window out.
This fixes a problem where drag selecting in weston terminal behaves
oddly - it doesn't update the select region while the drag is happening
outside the window.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Tested-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
If we're going to ignore motion below and to the right when coming
out of maximize, we should probably also ignore it above and to
the left.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Tested-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Fix a graphics glitch in the stacking demo in which a transient
window's drop shadow is visibile within the interior of the window.
Signed-off-by: Ben Hummon <benjamin.hummon@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
CLOCK_BOOTTIME is a relatively new* feature that may not actually be
present everywhere (I'm looking at you wheezy). Since our use of it
is actually only cosmetic, I've just ifdef'd if.
* No it isn't.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Apparently it's possible for a compositor to advertise seats with
different versions on the same connection, so this makes us more robust
against that dubious behaviour.
This also tracks the seat version we requested instead of the advertised
maximum.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: David FORT <contact@hardening-consulting.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This patch adds the missing calls to release when the seat has capabilities
changes. It also fixes a missing release of the touch object and a leak with
old clients.
Signed-off-by: David FORT <contact@hardening-consulting.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.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>
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>
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>
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>
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>
v2:
- adapted to protocol changes
- added TODO comments
- minor clean-up
- change y-invert from per-plane boolean to per-buffer flag
v3:
- fix a typo: 1 -> i (noticed by Carlos Olmedo Escobar)
Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
- opening braces are on the same line as the if statement
- opening braces are not on the same line as the function name
- space between for/while/if and opening parenthesis
Signed-off-by: Dawid Gajownik <gajownik@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This seems like a good idea for consistency that the protocol header
is included for any protocols used by the code. This also means the
code will compile with headers generated by wayland-scanner -c.
Fixed to use angle brackets.
Reviewed-by: Daniel Stone <daniels@collabora.com>