Meson's warning level maps to -Wall, -Wextra and -Wpedantic.
-Wmissing-prototypes is added by neither of those flag. Consequently,
it is manually added to the build command line arguments.
Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
Fixes missing prototypes compilation warnings emitted when a function
is defined before its prototype is declared.
These warnings were introduced over time since the switch to meson
because the -Wmissing-protoypes was not included in the compilation
arguments.
Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
Declare touch_handle_shape and touch_handle_orientation as static
functions as they are local to window.c.
Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
weston_environment_get_fd was declared in weston-launch and implemented
in compositor.c. Since the function is not used elsewhere in the code,
it is replaced by a static function in launcher-weston-launch.c
Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
Just a couple of places which shouldn't be possible, so initialized and
added assertions to make sure.
Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
There's a function named weston_compositor_log_scope_destroy()
but it doesn't take a struct weston_compositor argument.
Rename it to weston_log_scope_destroy(), as the argument is a
struct weston_log_scope.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
There's a function named weston_compositor_add_log_scope()
but it doesn't take a struct weston_compositor argument.
Rename it to weston_log_ctx_add_log_scope(), as
the log_scope is being added to a log_context.
Also, bump libweston_major to 9.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
In the function weston_log_subscription_printf() we have
a struct weston_log_subscription parameter that in the .c file
is named sub. In the .h, the same parameter is named scope.
This is confusing, since its type is not struct weston_log_scope,
but struct weston_log_subscription.
Rename the parameter in the .h to sub.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
In the function weston_compositor_add_log_scope() we have
a struct weston_log_context parameter that in the .c file
is named log_ctx. In the .h, the same parameter is named
compositor. This is confusing, since its type is not
struct weston_compositor, but struct weston_log_context.
Rename the parameter in the .h to log_ctx.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
When we were designing the libweston output API, I wrote a design document
as a Phabricator wiki page. Phabricator is no longer accessible so that
information needs to be migrated to a new place. Here I am converting most of
it into libweston Sphinx documentation, particularly pulling in the sequence
diagrams I drew. This should help people understand how libweston output
configuration works.
The diagrams are committed as both MSC source files and rendered PNG files. I
did not bother tinkering with the build to run mscgen automatically and then
with the CI images to install the tool.
The Sphinx configuration need numref explicitly enabled so that figures are
automatically numbered and can be referenced by their number rather than their
whole caption text(!).
The document structure is changed a little better flowing with Output
Management being the overview page and the Heads and Outputs being the API
pages.
First I wrote the struct weston_output and weston_head descriptions in Doxygen
comments in libweston.h, but then in the API page that text would have been
buried somewhere towards the end of the page. So I put that text in ReST
instead where it comes as first on the pages as it should. The doc for the
structs only contain a link to the top of the page. Yes, the comment style in
libweston.h is a little broken. If I left the asterisk there it would show up
as a bullet point in Sphinx. OTOH putting everything from \rst in a single line
did not produce anything.
Because Sphinx cannot look in two places, the images need to be copied into the
build dir too.
mscgen: http://www.mcternan.me.uk/mscgen/
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/25
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
weston-test-runner.h includes wayland-util.h, therefore it needs
wayland-client. A partial dependency with just compile_args might have been
enough as it does not seem to use functions from wayland-util.c, but safer this
way and no harm.
Fixes: https://lists.freedesktop.org/archives/wayland-devel/2020-January/041149.html
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This should make EGL headers not pull in Xlib headers when no specific platform
define is in effect.
Use both the old Mesa-specific hack and the new official define EGL_NO_X11 to
have this work on both old and new EGL headers.
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/350
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Introduced with a8da2084, it seems that there are cases when there's no
parent available (zenity, for instance).
Removes any potential child and re-initialize it, in case the parent is
not set. (Simon Ser)
Fixes: #340
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reported-by: n3rdopolis <bluescreenavenger@gmail.com>
The function weston_seat_init_keyboard makes sure that it has its
own reference to keymap, hence we can safely drop our reference.
This is similarly done in the X11 backend. It avoids leaking a
struct xkb_keymap per connection.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Instead of allocating our own copy of struct xkb_context use the
compositor wide instance. This avoids leaking of a struct
xkb_context per connection as well.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Properly disconnect and free all RDP peers on compositor shutdown.
This makes sure that all events are disabled, which should avoid
any race conditions with pending events.
Signed-off-by: Stefan Agner <stefan@agner.ch>
If a xdg_toplevel surface has a child (or multiple), the desktop shell
still allows to activate the parent. This can be problematic with
modal dialogs such as message boxes which then are hidden behind the
main window, which might be non-responsive to inputs at this this
point.
The protocol specifies set_parent as follows: "Set the 'parent' of
this surface. This surface should be stacked above the parent surface
and all other ancestor surfaces."
Track parent/child relationship in desktop-shell. Follow the protocol
recommendation and make sure the child stays stacked above the parent.
Fixes: #231
Signed-off-by: Stefan Agner <stefan@agner.ch>
The RDP-backend is reporting a non-zero physical size
value, and there are some clients that get the resolution
in pixels directly from the physical size reported. This
leads to a resolution of 25.4 PPI (or 1px/1mm), which is too
small.
But there's no need for that. The physical size is reported
on enabling the output (in the case of RDP-backend we have
no information about it before this), and the resolution is
already set in this moment.
Report a zero physical size to compositor, what makes frontend
and clients use their default values and applications become
readable.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
The reason the Xwayland test skips is that Xwayland was not installed. We
should exercise Xwayland as well in CI, so install it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This line is far too long, it makes it really had to see in a diff what
changed. Wrap it into multiple lines and sort them alphabetically. If a piece
of it changes in the future, it will be easy to see in a diff.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Ensure that no command in the script fails silently. If any command fails, the
image is likely broken.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The mask argument is uint16_t so declare the variable with the same.
Suggested-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Knowing the kind of decoration drawn will help track down issues with
unexpected decorations.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Print the changes to the debug scope, helping to figure out why Xwayland is or
is not committing.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Add the missing newline to printing a property that is of type cardinal array.
Fixes messed up debug scope output.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
protocol
As dmabuf uses a different coordinate (top-left) system than OpenGL
(bottom-left) using both direct-display with the Y_INVERT dmabuf attrib
flag would result in the image being inverted (direct-display will
remove the Y_INVERT flag, which caused the image to be displayed
correctly). Notifies users that direct-display is in use.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Define the void pointer as pixman_region32_t instead of using it
directly.
Void pointers are used by generic API's so each user can define
a data type as needed. Not doing this is dangerous, since void
pointers implicitly cast from/to any pointer without giving
warnings. So we must define its type instead of using it directly
in a function call.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
Remove member preferred_format from struct window and hardcode
ARGB32 pixel format for clients/window.
The member preferred_format was first added to allow hinting
of a preference for RGB565 when creating a window. But it is
not being used for a long time now. So it's safe to remove it
from the code, dropping support for RGB565 in clients/window.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
wayland/ci-templates!18 allows the $HOME environment variable to
propagate into the execution of creating our build container. Without
that, buildah would leave us with an empty $HOME, which would have pip
install into /.local/bin.
As $HOME is preserved during our actual native builds, we would try to
find meson in /root/.local/bin and fail, since it had been stored to a
different path.
Bump the ci-templates dependency to one with the fix so we can build new
images again.
Signed-off-by: Daniel Stone <daniels@collabora.com>
The aspect ratio definitions for 64:27 and 256:135 have been added with
libdrm 2.4.95. However, Weston currently depends on libdrm 2.4.89 or
higher. Define the definitions in Weston to support libdrm older than
2.4.95.
Fixes: #332
Fixes: 6093772f45 ("backend-drm: Use aspect-ratio bit definitions from libdrm")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Commit adaf8c7410 ("renderer: change frame_signal emission to pass
previous_damage as data argument") missed updating all frame_signal
emissions. Later commit 2619bfe420 ("move frame_signal emission to
weston_output_repaint()") fixed this deficency along with moving the
location of the emission. Due to an issue of the location change, this
commit had to be reverted again.
This makes sure that the pixman as well as the GL renderer now also
emits the damage region instead of the Weston output.
Fixes: adaf8c7410 ("renderer: change frame_signal emission to pass previous_damage as data argument")
Signed-off-by: Stefan Agner <stefan@agner.ch>
The member previous_damage from struct weston_output is no longer necessary.
First, stop calling init, fini and copying output_damage to it. Then remove
it from struct weston_output.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
The emission of frame_signal has to happen before a flip, otherwise
glReadPixels() could read an old frame or even worse an uninitialized buffer.
So move frame_signal emission back to renderers.
This reverts commit 2619bfe420.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
This header is not used anymore.
Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 0a4f6e7d6d ("clients: drop simple-dmabuf-drm")
Reported-by: Marius Vlad <marius.vlad@collabora.com>
When option-parser is confronted with a boolean option, have it write a
bool rather than treating the value as a pointer to an int32.
(lib)weston already heavily uses bool types internally, so this has the
nice side effect of eliminating quite a few local variables which only
existed as integer shadows of internal boolean variables.
Signed-off-by: Daniel Stone <daniels@collabora.com>
test012 and test013 were exact duplicates of each other: asserting that
they could successfully look up a single boolean value.
Signed-off-by: Daniel Stone <daniels@collabora.com>