Commit graph

5615 commits

Author SHA1 Message Date
Daniel Stone 17339233a0 compositor-drm: Comment struct members
Clarify the difference between crtc_id (DRM object) and pipe (index into
drmModeRes->crtcs array, possible_crtcs bitmask).

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
Differential Revision: https://phabricator.freedesktop.org/D1405
2016-12-12 16:52:22 +00:00
Giulio Camuffo f15320faee
libweston-desktop: don't crash when getting the pid for X clients
X client's don't have a wl_client associated with their
weston_desktop_client, so make sure to not use it.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-12-08 11:58:18 +01:00
Daniel Stone 2295a62788 tests: Skip Xwayland test if binary isn't available
We know we're not going to succeed if the binary isn't installed, so
skip the test in that case.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-30 10:28:04 +00:00
Daniel Stone beb97e5f79 libweston: Make module loading safe against long paths
Avoid any buffer overflows here by checking we don't go over PATH_MAX
with stupid module names.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-30 10:27:51 +00:00
Daniel Stone 698f9bf854 compositor-wayland: Destroy cursor images earlier
Destroying a wl_cursor will attempt to access the wl_display, which
we have just freed. Avoid a segfault by destroying the cursor images
before we destroy the display.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dima Ryazanov <dima@gmail.com>
2016-11-29 09:49:29 +00:00
Daniel Stone 7dbb0e148f Don't prepend protocol/ to include paths
No need to add protocol/, as it's already handled by an explicit
compiler include path.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Dima Ryazanov <dima@gmail.com>
2016-11-29 09:49:00 +00:00
Bryce Harrington 411ffabbb5 editor: Load a file if specified on command line
Add support for basic text file loading, to facilitate more expansive
testing of its UTF-8 text editing support.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-11-28 15:41:01 -08:00
Bryce Harrington 3d90da21fe editor: Use parse_options() from shared for command line options
Also add a basic --help option

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-11-28 15:40:21 -08:00
Daniel Stone 21fac60838 compositor-wayland: Set frame callback for Pixman
Fixing 89c2f637b9, also set the output's frame_cb for the Pixman
renderer, not just GL. Fixes a segfault when using compositor-wayland
with --use-pixman.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Dima Ryazanov <dima@gmail.com>
2016-11-28 22:00:46 +00:00
Dima Ryazanov 6a38ad740c gl-renderer: Fix an invalid write when closing a Weston window
Call eglMakeCurrent before destroying the native EGL window, similar to what
other sample clients are already doing.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-28 18:11:09 +00:00
Dima Ryazanov 89c2f637b9 compositor-wayland: Fix a use after free
When a window is being closed, the frame_done callback often runs after
the output is already destroyed, i.e:

  wayland_output_start_repaint_loop
  input_handle_button
    wayland_output_destroy
  frame_done

To fix this, destroy the callback before destroying the output.

(Also, fix the type of output in frame_done: it's passed in
a wayland_output, not a weston_output.)

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-28 11:29:30 +00:00
Pekka Paalanen e3a582f9ff libweston-desktop/xwayland: add is_mapped handling for XWAYLAND
The xwayland window type XWAYLAND is not handled by the shell at all,
instead libweston-desktop maps such surfaces itself. However, it forgot
to set weston_surface::is_mapped and weston_view::is_mapped.

weston_surface::is_mapped affects the behaviour of weston_view_unmap()
and weston_surface_attach().

weston_view::is_mapped affects the behaviour of weston_view_unmap() and
weston_view_destroy().

When manually mapping a window of type XWAYLAND, mark both the view and
surface as mapped. This follows the expections in libweston, even though
the meaning of is_mapped is not clearly defined for either surface or
view.

Also, when the XWAYLAND window is manually unmapped, unmap the
weston_surface. This updates weston_surface::is_mapped to reflect the
state. However, as a side-effect it will also unmap all sibling views,
should any exist.

v2: rename surface_base to wsurface
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Daniel Stone <daniels@collabora.com>
2016-11-25 13:13:43 +02:00
Pekka Paalanen bbc749af73 libweston-desktop/xwayland: XWAYLAND surfaces are never 'added'
Add documentation (asserts) that show that windows of types XWAYLAND are
never registered with the shell.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-11-25 13:13:09 +02:00
Pekka Paalanen 3326820e0f libweston-desktop/xwayland: clarify 'added' logic
Setting to a constant is much easier to read and grep for than setting to
a computed variable.

There are no functional changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-11-25 13:12:51 +02:00
Pekka Paalanen a838b7825f libweston-desktop/xwayland: window type XWAYLAND cannot have a parent
Add an assert to ensure that a window of type XWAYLAND is never
attempted with a parent. Following the code though, the assert can be
made even stricter by allowing only TRANSIENT to have a parent.

This is essentially adding documentation.

v2: use stricter assert
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-25 13:12:21 +02:00
Pekka Paalanen 44660c3b9c XWM: debug position and size on map request
Helps debugging initial placement problems.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-24 16:42:16 +02:00
Pekka Paalanen 7db6c43b5b XWM: debug position on create_notify
Helps debugging X11 window positioning issues.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-24 16:42:16 +02:00
Ryo Munakata e6dec90e29 compositor-x11: fix segfault when use_pixman is true
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-24 11:45:40 +00:00
Daniel Stone 04bd040258 Don't include version.h from compositor.h
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewd-by: Bryce Harrington <bryce@osg.samsung.com>
2016-11-24 11:42:05 +00:00
Daniel Stone 9983400465 tests: Extend subsurface place_{above,below} hierarchy
Following on from b8c16c995b, extend the family tree being tested by
place_above and place_below a little, ensuring that subsurfaces can't be
placed above or below surfaces which are related to them, but aren't
their immediate parent or sibling.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-23 10:17:43 +00:00
Pekka Paalanen 9f3d95e0d7 build: fix wayland-backend distcheck
Fix the following error from 'make distcheck':

  CC       libweston/wayland_backend_la-compositor-wayland.lo
../../libweston/compositor-wayland.c:54:51: fatal error: xdg-shell-unstable-v6-client-protocol.h: No such file or directory
 #include "xdg-shell-unstable-v6-client-protocol.h"

Files generated with the scanner belong in nodist_*_SOURCES, not with
the regular sources.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-23 10:17:22 +00:00
Derek Foreman 2b685d9de9 weston-terminal: Fix crash on first keystroke
Since 894b3rcc634 weston-terminal will crash on first keystroke if you
fail to create an xkb compose state.  This can happen if you don't have
a Compose file.

Instead, now we just return uncomposed symbols.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-22 19:14:40 +00:00
Arnaud Vrac b8c16c995b compositor: allow using nested parent as a subsurface sibling
The parent of a subsurface can be used as a sibling in the place_below
and place_above calls. However this did not work when the parent is
nested, so fix the sibling check and add a test to check this case.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2016-11-22 12:39:11 +00:00
Carlos Garnacho 11f8fcbefe xwayland: Create the drag-and-drop window in weston_wm_dnd_init
Just to keep it hidden so far... A lot of the plumbing necessary to
handle x11->wayland drag and drop is missing, and the current
partial handling gets in the middle for X11 drag-and-drop itself
to work.

The approach is well directed, but needs some further work, till
then, just keep our fake drag-and-drop target hidden. This allows
drag-and-drop to work between X11 clients in Xwayland, and avoids
a crash with (currently unhandled) wl_resource-less data sources.

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

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-22 12:01:37 +00:00
Quentin Glidic 24d306ccd8 libweston: Add move (without scale) animation
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:22:47 +00:00
Quentin Glidic e7ed60fabe desktop-shell/client: Add left/right panel position (basic) support
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:18:04 +00:00
Quentin Glidic 51c2c37e0e desktop-shell/client: Introduce helper variables
These variables will be much more useful in the following commit.
The indentation is off to avoid future diff noise.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:18:00 +00:00
Quentin Glidic 3e37b343a2 desktop-shell/client: Parse the clock format once
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:17:57 +00:00
Quentin Glidic f9574f2314 desktop-shell/client: Use a proper enum for clock format
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:17:53 +00:00
Quentin Glidic e8bf959764 desktop-shell: Properly position the panel surface
Now weston actually supports putting the panel at the bottom of the
screen.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:17:49 +00:00
Quentin Glidic 581df06ad1 desktop-shell: Compute panel size without using output
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:17:46 +00:00
Quentin Glidic 55d5701ddf desktop-shell/client: Add bottom panel support
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:17:41 +00:00
Bryce Harrington fe0410b0cc gl: Don't declare variables in for loop
Fixes compilation error introduced by 43cea54c:

  libweston/gl-renderer.c:2862:2: error: ‘for’ loop initial declarations
  are only allowed in C99 mode
    for (unsigned i = 0; i < ARRAY_LENGTH(swap_damage_ext_to_entrypoint);
    i++) {
    ^

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:04:40 +00:00
Armin Krezović 3447619a3a compositor-wayland: Port to xdg-shell-v6
v2:

 - Keep wl_shell code around until xdg_shell is declared stable.

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 18:00:19 +00:00
Vincent ABRIOU e5732c7866 gl-renderer: add support of WL_SHM_FORMAT_YUYV
This patch allow gl-renderer to accept WL_SHM_FORMAT_YUYV buffers.
This is the pixel format supported by most of the USB webcams.

v2:
 - fix hsub Vs vsub inversion

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 17:47:13 +00:00
Armin Krezović 225bf9dff1 compositor-x11: Move vfunc setting from set_size to enable
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:50:20 +00:00
Armin Krezović 2e66252582 compositor-wayland: Destroy shm buffers on output disable
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
2016-11-21 16:44:49 +00:00
Armin Krezović 78895c5fd8 compositor-wayland: Properly clean up on backend destroy
Also remove a wrong XXX comment.

Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
2016-11-21 16:44:46 +00:00
Armin Krezović f054d35aad compositor-wayland: Simplify fullscreen output surface handling
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
2016-11-21 16:44:42 +00:00
Armin Krezović f16de17054 compositor-wayland: Move vfunc setting from set_size to enable
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
2016-11-21 16:44:38 +00:00
Silvan Jegen e31d95f262 weston-editor: Free preferred_language in text_entry_destroy
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:12:08 +00:00
Emil Velikov 5e604082d1 clients/nested-client: call eglTerminate/eglReleaseThread at exit
Do a minimalistic teardown at program exist.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:32 +00:00
Emil Velikov a69b870e1d tests/buffer-count-test: teardown after the test
Might be a bit of an overkill, but still. One should cleanup after
themselves.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:29 +00:00
Emil Velikov 02639554e7 gl-renderer: use weston_platform_destroy_egl_surface wrapper
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:26 +00:00
Emil Velikov 050e5d00da clients/window: use weston_platform_destroy_egl_surface wrapper
v2: Use correct (destroy) API (Dan)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:22 +00:00
Emil Velikov 0050536702 clients/subsurfaces: use weston_platform_destroy_egl_surface wrapper
... over a direct eglDestroySurface call. Provides symmetry in the
create/destroy paths.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:19 +00:00
Emil Velikov 903cb5727b clients/simple-egl: use weston_platform_destroy_egl_surface wrapper
... over a direct eglDestroySurface call. Provides symmetry in the
create/destroy paths.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:16 +00:00
Emil Velikov 915ee13278 clients/nested-client: destroy the EGL surface during teardown
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:10 +00:00
Emil Velikov 3612be2302 shared/platform.h: introduce weston_platform_destroy_egl_surface()
Introduce the weston_platform_destroy_egl_surface() wrapper to
complement the weston_platform_create_egl_surface() one.

We'll use the former with the next patches trhoughout weston to
consistently destroy the surface as needed.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 16:07:05 +00:00
Emil Velikov 43cea54c90 gl-renderer: add support for EGL_KHR_swap_buffers_with_damage
Extension is identical to the EXT one, yet we need to check for the KHR
abbreviated extension name + entry-point.

v2: s/foo/swap_damage_ext_to_entrypoint/ (Eric, Daniel)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-21 11:31:29 +00:00