If Xwayland is not in /usr/bin, distcheck will fail without patch
023b265b, which propagates @XSERVER_PATH@ to distcheck but blocks other
use of the DISTCHECK_CONFIGURE_FLAGS env var. Instead, revert the fix
and merely document the need for setting DISTCHECK_CONFIGURE_FLAGS
manually.
Revert "build: Pass along any user-specified xserver path to distcheck"
This reverts commit 023b265b44.
The replacement xwayland-test should succeed, so we should run it
from distcheck again.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Xwayland isn't part of this distribution so looking for Xwayland in
weston's install dir will cause distcheck to fail. Let's set the
default to /usr/bin where it's likely to live.
It can still be overriden during configure exactly as before.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
If a client calls xdg_shell.get_xdg_surface on a surface that is already
an xdg_surface would, prior to this patch, succeed, but cause weston to
crash later when trying to configure. This patch instead sends a role
error to the client complaining that it already is an xdg_surface.
Note that .._set_role() only fails when changing roles, not when setting
the same role twice.
The same is done for xdg_popup.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Failing to remove this can result in a crash when the signal is sent
after the window manager is destroyed.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
of application launching. This is because cancel callback is mistakenly
set to weston_touch_grab_interface. To fix this issue, add a
callback, touch_move_workspace_grab_frame and set it to the
weston_touch_grab_interface like desktop-shell.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Add autotools remnants, as well as more comprehensive vim swapfiles,
Sublime Text configuration, and git format-patch output.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
The input loop is actually dispatched in the middle of the frame repaint.
When the X11 event results in closing the compositor, this can cause the
current output to be destroyed just prior to trying to process animations
on it.
We fix this by handling the window close event in an idle callback.
NOTE: this requires a patch for wayland that moves the idle handler
dispatch to after epoll_wait in the event loop processing.
Closes bug: https://bugs.freedesktop.org/show_bug.cgi?id=81314
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Keyboard key events will be received from a device where a key has
been pressed, even though an equivalent key has been pressed (same
key code) on a device connected to the same seat. notify_key()
expects to only be called as if there was only one keyboard device
associated with the given seat, so to achieve this, ignore every event
where forwarding it would result in multiple 'pressed' or 'released'
notifications.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Pointer button events will be received from a device where a button has
been pressed, even though an equivalent button has been pressed (same
button code) on a device connected to the same seat. notify_button()
expects to only be called as if there was only one pointer device
associated with the given seat, so to achieve this, ignore every event
where forwarding it would result in multiple 'pressed' or 'released'
notifications.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This patch adds the maximize button to the window frame for the windows
which set the MWM_DECOR_MAXIMIZE hint, and it wires it with the shell
via a new method in weston_shell_interface.
Additionally, it also listens for the wm hints coming from the client,
but it doesn't support maximizing a window only vertically or horizontally.
The window will be maximized only when both directions are maximized.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Remove a few instances of casting weston_seat to weston_seat.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
The zoom effect zooms at the seat's current pointer location. When no
pointer is present the zoom key bindings cause a crash.
Instead, check for the absence of a pointer and log a warning.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
The old xwayland-test hasn't worked in a while...
This new test checks that the wayland specific WL_SURFACE_ID atom exists,
checks that the window manager name is "Weston WM" and then maps a window
and waits for an exposure event.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
Calling wl_event_source_remove() will free the event source later, so
reset the pointer to avoid calling it two times on the same pointer.
Fix a compositor crash when copying some text from weston terminal,
pasting it in the same terminal and hitting ctrl-u, while a X client
is running.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
With multi-seat, multiple entries can occur on the text inputs in the
editor. Also, the panel shouldn't be hidden by the editor if either
text entry is still active.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Some X clients use the _NET_WM_DESKTOP property to tell if the window
is mapped or not. If set, it should say the virtual desktop the window
is currently in, if unset it means the window is unmapped.
The xwm currently has no way to know how many virtual desktops
the shell plugin has, or if it even implements the metaphor. For now
just set the property to 0, meaning the first desktop, if the window is
mapped, and delete the property when unmapped.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
While it conceptually makes sense to put the x11 event handler
in the compositor "input" loop, the input loop is actually
dispatched in the middle of the frame repaint. When the
X11 event results in closing the compositor, this can cause
the current output to be destroyed just prior to trying to
process animations on it.
Closes bug: https://bugs.freedesktop.org/show_bug.cgi?id=81314
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Some X clients create popup or tooltips windows as top level, without
setting them as override redirect or as transient. Since we don't want
to take the focus away from a surface when one of its popup is opened,
check the _NET_WM_WINDOW_TYPE of the X surfaces being mapped and set
them as inactive if it is one of some types.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This skips the test when running on the headless backend.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
(Presumably) Reviewed-by: Daniel Stone <daniel@fooishbar.org>
dist_wayland_session_DATA is not set anywhere before, so using +=
results in:
error: dist_wayland_session_DATA must be set with '=' before using '+='
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Using the x11 output (maybe with others as well), weston would hang
when closing the output if the colord plugin is enabled.
The hang occurs in mutex lock in the output notifier handler because
the given GMutex value is incorrect.
This is because of a cast error, the type of container should be
"cms_output" and not "cms_colord".
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Richard Hughes <richard@hughsie.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Note that for weston, configure.ac needs version numbers updated in
several places. `make distcheck` for weston no longer triggers the test
suite to run, so update the directions to run a `make check`
pre-release. Switch to using the X.org release.sh script in place of
some of the manual steps.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Check the value of level before dividing 1 by it.
Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
So that we can test the per-surface ZERO_COPY flag:
- start Weston on DRM backend
- run ./weston-simple-egl -o (need to be opaque to end up on overlay)
- hit debug key 'V' to enable the (broken) hw overlays
The debug key is used by first hitting Mod+Shift+space, then hitting 'v'.
Enabling overlays should change the flags from 0x7 to 0xe. To verify the
window is really on an overlay, use debug key 'S' to tint all
GL-composited things green.
This patch is not intended for upstream.
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Decode the new feedback flags.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
PRESENTATION_FEEDBACK_KIND_ZERO_COPY is a flag that needs to be set for
each surface separately. Some surfaces may be zero-copy (as defined by
Presentation feedback) while some are not.
A complication with Weston is that a surface may have multiple views on
screen. All copies (views) of the surface are required to be zero-copy
for the ZERO_COPY flag to be set.
Backends set per-view feedback flags during the assing_planes hook, and
then Weston core collects the flags from all views of a surface.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Change weston_output_finish_frame() signature so that backends are
required to set the flags, that will be reported on the Presentation
'presented' event. This is meant for output-wide feedback flags. Flags
that vary per wl_surface are subject for the following patch.
All start_repaint_loop functions use the special private flag
PRESENTATION_FEEDBACK_INVALID to mark, that this call of
weston_output_finish_frame() cannot trigger the 'presented' event. If it
does, we now hit an assert, and should then investigate why a fake update
triggered Presentation feedback.
DRM:
Page flip is always vsync'd, and always gets the completion timestamp
from the kernel which should correspond well to hardware. Completion is
triggered by the kernel/hardware.
Vblank handler is only used with the broken planes path, therefore do
not report VSYNC, because we cannot guarantee all the planes updated at
the same time. We cannot set the INVALID, because it would abort the
compositor if the broken planes path was ever used. This is a hack that
will get fixed with nuclear pageflip support in the future.
fbdev:
No vsync, update done by copy, no completion event from hardware, and
completion time is totally fake.
headless:
No real output to update.
RDP:
Guessing that maybe no vsync, fake time, and copy make sense (pixels
sent over network). Also no event that the pixels have been shown?
RPI:
Presumably Dispmanx updates are vsync'd. We get a completion event from
the driver, but need to read the clock ourselves, so the completion time
is somewhat unreliable. Zero-copy flag not implemented though it would
be theoretically possible with EGL clients (zero-copy is a per-surface
flag anyway, so in this patch).
Wayland:
No information how the host compositor is doing updates, so make a safe
guess without assuming vsync or hardware completion event. While we do
get some timestamp from the host compositor, it is not the completion
time. Would need to hook to the Presentation extension of the host
compositor to get more accurate flags.
X11:
No idea about vsync, completion event, or copying. Also the timestamp is
a fake.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Acked-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Add the missing feedback flags to the Presentation extension protocol
specification.
These flags are slightly different from the previous RFCv3.1 definition:
http://lists.freedesktop.org/archives/wayland-devel/2014-March/013598.html
Now, all compositors are safe to use 0 as the flags if they don't bother
setting them properly. 0 is the "worst case" with the least guarantees.
The meaning of ZERO_COPY is not exactly the opposite of the old COPY
flag. ZERO_COPY is more strict, but applies only to that one surface.
Therefore it can be used to verify a zero-copy video playback pipeline,
also to a hardware overlay.
There is no longer a flag to clearly indicate if the final presentation
was done by a copy or a page flip. ZERO_COPY forbids the copy, but VSYNC
alone does allow copy in case it cannot tear. It is possible to have
first a compositing pass, and then another copy into the frontbuffer,
and still set VSYNC if it cannot tear. Usually "cannot tear" is too
hard to guarantee with a copy, so it often implies a page flip.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
When a function is named drm_output_FOO(), you'd expect it to take a
struct drm_output * as an argument. Convert
drm_output_prepare_scanout_view(), drm_output_prepare_overlay_view(),
drm_output_prepare_cursor_view() from weston_output to drm_output.
Additionally convert drm_sprite_crtc_supported() from weston_output to
drm_output.
This change makes drm_assign_planes() to operate on drm_output terms,
which makes further changes a tiny bit easier.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
The current parser directly reads a BOOLEAN on the PropertiesChanged
signal for 'Active' properties. However, all property-values are packed in
a VARIANT, otherwise, we wouldn't know the type. Fix the parser to recurse
into the variant before reading the boolean.
To avoid such bugs in the future, we extract the 'Active' parser into a
helper function parse_active(), which is then shared between the
PropertiesChanged and Get handlers.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: nerdopolis <bluescreen_avenger@verizon.net>