We loaded the use-pixman configuration value from both the command line
and the configuration file, but completely ignored the former. Make sure
we actually use both.
Tested with all permutations of config/command line.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
(cherry picked from commit 8a4585c27f)
We were testing the wrong variable to see if output creation had failed:
instead of testing the return of the function we'd just called, we were
testing something we'd already checked earlier.
Signed-off-by: Daniel Stone <daniels@collabora.com>
(cherry picked from commit 814335821e)
WESTON_OPTION_BOOLEAN takes a pointer to an int as an argument, but
there were several cases of being passed a pointer to a bool instead.
This changes it to use a local int instead, and then write that value to
the bool.
Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
(cherry picked from commit 2edbcbd9cd)
The printf() format specifier "%m" is a glibc extension to print
the string returned by strerror(errno). While supported by other
libraries (e.g. uClibc and musl), it is not widely portable.
In Weston code the format string is often passed to a logging
function that calls other syscalls before the conversion of "%m"
takes place. If one of such syscall modifies the value in errno,
the conversion of "%m" will incorrectly report the error string
corresponding to the new value of errno.
Remove all the occurrences of the specifier "%m" in Weston code
by using directly the string returned by strerror(errno).
While there, fix some minor indentation issue.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
(cherry picked from commit 3957863667)
Since v6 release, -Dtest-junit-xml=false build regressed because its
ifdef branch no longer includes stddef.h and thus NULL, either directly
or through another header. Using musl-1.1.22 and llvm-8.0.0.
(cherry picked from commit 45d38856c8)
In the simple examples in which keymap is not handled, the open
descriptor has to be properly closed.
After each suspend/resume sequence the keymap is send again to
every client. On client weston-simple-egl the leak causes a
segfault when no more file descriptors can be opened.
Close the file descriptor and lazily copy/paste the comment
already available in simple-dmabuf-v4l.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
(cherry picked from commit 4071225cdc)
As per the wl_data_offer::finish documentation, the request is only
valid for drag n drop operations and signifies that a dnd is completed.
Send finish request only when we have a dnd operation active.
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
(cherry picked from commit 43152a3a8f)
The documentation of wl_data_offer::finish states that it should be
used to signify that a drag and drop operation is completed. So send
WL_DATA_OFFER_ERROR_INVALID_FINISH when the client calls the finish
request but the operation isn't dnd.
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
(cherry picked from commit 737ac0d4b3)
The toytoolkit assumes that wl_seats are advertised after
wl_data_device_manager and creates a data_device during wl_seat
registry binding. This patch removes this assumption by creating
data_devices for all the wl_seats created up until then.
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/201
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
(cherry picked from commit ee4c7a24dd)
In file included from ../clients/multi-resource.c:38:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
#warning redirecting incorrect #include <sys/poll.h> to <poll.h>
^~~~~~~
(cherry picked from commit 923a1e9688)
Fix variable EGL_NO_IMAGE to EGL_NO_IMAGE_KHR in
clients/simple-dmabuf-egl.c
Signed-off-by: Kamal Pandey <pandeykamal13526@gmail.com>
(cherry picked from commit 53d7c243ba)
If buttons list isn't empty and title is NULL, SEGV is occured in
pango_layout_set_text(). This patch fixes this problem.
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
(cherry picked from commit 6f9db6c4a1)
With the addition of patch 433f4e77b7 we display the same view id (0)
for every view as we're modifying the local variable.
Displaying sub-surfaces based views is also problematic. The caller need
to modify the view number as well, so we instead we pass the address as
to allow that to happen. Otherwise we end up repeating the same number
for views without sub-subrfaces once those have been printed.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit a6acfa8346)
gbm_bo_get_handle_for_plane returns handle.s32 == -1 on error, at least
for the Mesa dri implementation.
Reported-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
(cherry picked from commit ff98a9080f)
These protocols are from libweston, not weston.
Even the pkg-config files is called libweston-6-protocols.pc.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit 4ab901ebb0)
Identical to 8a8558dd, where we need to pass `-Wl` as linker args.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit 3a28bd66ff)
We claim to support meson versions >= 0.47 but the `install:` argument
in configure_file was introduced in version 0.50. This produces the
following meson warning:
WARNING: Project specifies a minimum meson_version '>= 0.47' but uses
features which were added in newer versions:
* 0.50.0: {'install arg in configure_file'}
From the documentation for the install argument [1]:
" When omitted it (install) defaults to true when install_dir is set and
not empty, false otherwise."
So, remove the `install:` argument and just depend on `install_dir` for
installing.
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/225
[1] https://mesonbuild.com/Reference-manual.html#configure_file
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
(cherry picked from commit b81fc517d8)
All the GBM code is unconditional in compositor-drm.c, so while disabling the
GL-renderer would stop GBM from being used, GBM headers would still be needed
for building and GBM library for linking.
Leave a note to fix it properly later. At least we now check for GBM and do not
mislead with the error message.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit fe6dd7bcef)
remoting-plugin.c calls things like g_error_free() and g_object_set(), so it
needs to link glib-2.0 and gobject-2.0 explicitly, instead of relying on
GStreamer pkg-config bringing them in.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit 292aaf9308)
cms-colord.c calls things like g_string_free() and g_object_unref(), so it
needs to link glib-2.0 and gobject-2.0 explicitly, instead of relying on colord
pkg-config bringing them in.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit 191c453f83)
editor.c calls g_clear_object(), so it should link to gobject directly instead
of relying on pangocairo pulling it in in its pkg-config.
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/211
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit cbffca980b)
When building screen-share module with meson loading the module
fails with:
[00:01:28.604] Failed to load module: /usr/local/lib/weston/screen-share.so: undefined symbol: os_create_anonymous_file
Failed to process Wayland connection: Broken pipe
failed to create display: Broken pipe
The function os_create_anonymous_file is defined in libshared,
adding libshared to the dependency makes sure the function gets
compiled into screen-share.so.
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/208
Signed-off-by: Stefan Agner <stefan@agner.ch>
Since commit ee1d968e64 ("compositor-drm: Fall back if GBM surface fails with
modifiers"), drm_output_init_egl requires output->gbm_surface to be NULL, or
gbm_surface_create will not be called if HAVE_GBM_MODIFIERS is enabled but no
modifiers are supported by the plane. This could happen if _init_egl is called
after drm_ouptut_fini_egl drom drm_output_switch_mode.
Add an assert to guarantee the requirement and clears the gbm_surface pointer
after the surface is destroyed.
Signed-off-by: Philipp Zabel <p.pzabel@pengutronix.de>
Since we are managing and rendering to buffers on our own with GBM,
create the EGL display using the GBM platform with the DRM render node,
instead of using the Wayland EGL platform.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
../libweston/compositor-rdp.c: In function ‘rdp_peer_refresh_rfx’:
../libweston/compositor-rdp.c:213:25: error: invalid type argument of unary ‘*’ (have ‘SURFACE_BITS_COMMAND’ {aka ‘struct _SURFACE_BITS_COMMAND’})
memset(&cmd, 0, sizeof(*cmd));
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
If we cannot create a gbm_surface using a list of modifiers, fall back
to using the old pre-modifier version.
This fixes initialisation on systems where KMS supports modifiers but
the GBM driver does not, such as old i915 systems like Pine View using
the unified KMS driver but the old i915 Mesa driver.
Signed-off-by: Daniel Stone <daniels@collabora.com>
A surface can get destroyed while a shell grab is active, which can
for example happen if the command running in weston-terminal exits.
When a surface gets destroyed, grab->shsurf is reset to NULL by
destroy_shell_grab_shsurf(), but otherwise the grab remains active and
its callbacks continue to be called. Thus, dereferencing grab->shsurf
in a callback without checking it for NULL first can lead to undefined
behavior, including crashes.
Several functions were already properly checking grab->shsurf for NULL,
move_grab_motion() being one example. Others, however, were not, which
is what this commit fixes.
Related to https://gitlab.freedesktop.org/wayland/weston/issues/192
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Changing the focused surface did remove the surface_destroy_listener from the wl_signal list,
but destroying the focus state did not. As a result, sometimes the same listener would be added
to two surfaces, which would join their wl_signal lists together, which would cause infinite
loops and use-after-frees when closing desktop surfaces.
This crash was happening when *releasing* a pointer button on a window
that was being resized and got destroyed during the grab.
[@daniels: Cosmetic fixes; apply same fix to grab cancel.]