Bryce Harrington [Thu, 20 Nov 2014 01:18:33 +0000 (17:18 -0800)]
tests: Include "config.h" as first header
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Derek Foreman [Thu, 20 Nov 2014 21:32:40 +0000 (15:32 -0600)]
dnd: Fix some mouse cursor issues
When ending a drag in the window the cursor will be wrong until the mouse
is moved again. This is because the item being dragged isn't added
until after the enter event.
Also, when picking up an item while moving the mouse the cursor can switch
back to a non-drag cursor before the drag begins. This is because of a
slight delay between button click and drag start.
Finally picking up or dropping an item under a second pointer could cause
that pointer to have the wrong cursor.
Closes one of the issues in bug 56298
https://bugs.freedesktop.org/show_bug.cgi?id=56298
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Wed, 19 Nov 2014 17:04:12 +0000 (11:04 -0600)]
input: Use slightly less obscure logic in evdev_notify_keyboard_focus()
While the test is actually correct (for non-negative numbers), it's not
at all clear and seems to be an accidental order of operations mistake.
Also, add an assert() to make sure this number is never negative.
Closes bug 86346 - https://bugs.freedesktop.org/show_bug.cgi?id=86346
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Pekka Paalanen [Tue, 25 Nov 2014 07:56:53 +0000 (09:56 +0200)]
simple-shm: explain two initial roundtrips
Explain carefully why we need two roundtrips, not just one, not just
dispatch and roundtrip, but two roundtrips after creating the
wl_registry object.
v2: Explain what initial events are, and that this is a general
technique.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Pekka Paalanen [Wed, 26 Nov 2014 11:48:29 +0000 (13:48 +0200)]
configure: remove input backend result
Don't print a line with empty value.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Peter Hutterer [Tue, 25 Nov 2014 21:06:31 +0000 (07:06 +1000)]
compositor: Drop legacy backends in favor of libinput
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Thu, 20 Nov 2014 08:15:07 +0000 (10:15 +0200)]
desktop-shell: don't crash input-panel if no kbd focus
If a keyboard exists but it has no current focus, yet something asks the
input-panel to come up, we would crash here. Check that there is a focus
before attempting to use it.
Maybe there should not even exist a case where input-panel tries to come
up without a keyboard focus, but I am not sure there is no race where it
could happen.
In any case, this fix was brought up by the ivi-shell work, where I
suppose you can somehow hit it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Cc: Tanibata, Nobuhiko <ntanibata@jp.adit-jv.com>
Giulio Camuffo [Thu, 20 Nov 2014 21:03:22 +0000 (23:03 +0200)]
input: don't run the key bindings on focus in
When getting the focus we get the list of pressed keys, but we are
not supposed to run the key binding on them.
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Derek Foreman [Wed, 19 Nov 2014 23:06:20 +0000 (15:06 -0800)]
tests: Allow tests to use customized command line parameters
Tests will now return the extra command line parameters they need
when run with --params
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Bryce Harrington [Wed, 19 Nov 2014 23:06:19 +0000 (15:06 -0800)]
compositor: Document options for headless compositor
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: s/Wayland surface/memory surface/, and say default renderer.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Wed, 19 Nov 2014 23:06:18 +0000 (15:06 -0800)]
compositor-headless: add support for transforms set on command line
We now allow --transform with the headless compositor, however it still
doesn't parse anything out of weston.ini
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Wed, 19 Nov 2014 23:06:17 +0000 (15:06 -0800)]
compositor-headless: allow rendering with pixman
Allow the headless backend to render into an off screen buffer with pixman.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Bryce Harrington [Wed, 19 Nov 2014 23:06:16 +0000 (15:06 -0800)]
configure.ac: Indicate headless compositor presence in config.h
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 21 Nov 2014 14:11:44 +0000 (16:11 +0200)]
man: explain idle-time=0 in weston.ini
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Frederic Plourde [Thu, 30 Oct 2014 19:06:34 +0000 (15:06 -0400)]
compositor: Add idle timeout option to weston.ini
Weston's idle timeout can already be set via the '-i' command-line
option, but this patch lets users specify it also via weston.ini.
Note that the command-line option takes precedence over the .ini,
should the option be set by both.
This patch also Updates weston.ini man page with idle-timeout bits
https://bugs.freedesktop.org/show_bug.cgi?id=83921
Signed-off-by: Frederic Plourde <frederic.plourde@collabora.co.uk>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Marek Chalupa [Wed, 29 Oct 2014 12:44:44 +0000 (13:44 +0100)]
xwayland: fix fullscreening
set_fullscreen has been sending configure before changing the state
and xwayland windows added border to the fullscreen size.
This fixes the bug:
https://bugs.freedesktop.org/show_bug.cgi?id=83502
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Ryo Munakata <ryomnktml@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Javier Jardón [Mon, 27 Oct 2014 15:13:19 +0000 (15:13 +0000)]
Makefile.am: Link weston_multi_resource against rt library
This fixes this build failure:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../x86_64-unknown-linux-gnu/bin/ld:
clients/weston_multi_resource-multi-resource.o: undefined reference to
symbol 'clock_gettime@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../x86_64-unknown-linux-gnu/bin/ld:
note: 'clock_gettime@@GLIBC_2.2.5' is defined in DSO /lib64/librt.so.1
so try adding it to the linker command line
/lib64/librt.so.1: could not read symbols: Invalid operation
Derek Foreman [Thu, 16 Oct 2014 21:37:02 +0000 (16:37 -0500)]
gl-renderer: compress pixman bands to simplify geometry
Pixman uses y-x banded rectangles to represent regions. We use these
y-x banded rectangles to generate triangle fans, resulting in more
geometry than strictly necessary to draw the screen.
This patch combines the bands to reduce geometry for complex scenes.
Acked-by: "Jasper St. Pierre" <jstpierre@mecheye.net>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Thu, 23 Oct 2014 17:24:18 +0000 (12:24 -0500)]
backends: refactor transform string parsing
Most of the backends do their own parsing of transform strings, so let's
put that all in the same place (compositor.c/h)
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Marek Chalupa [Wed, 29 Oct 2014 13:51:23 +0000 (14:51 +0100)]
cairo-util: fix shadows for small clients
If the client is small (< 128 pixels in any ward),
then the shadows overlap and create dark lines behind clients.
This is a problem mosly with pop-up menues. The lines become observable
when the menu has less than three items. The other case is when
the client doesn't restrict its size when resizing (try
'weston-eventdemo --max-width=1 --max-height=1' for example)
This fixes a part of the bug:
https://bugs.freedesktop.org/show_bug.cgi?id=78511
v2:
- rework computing of the size of corners
- rewrite some comments
- rename tile_mask to render_shadow (in separate patch)
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Marek Chalupa [Wed, 29 Oct 2014 13:51:22 +0000 (14:51 +0100)]
toytoolkit: rename tile_mask to render_shadow
This function is used and clearly designed only for drawing the shadows.
Rename it so that it has name after what it does and also move some
common code into the function.
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Seedo Eldho Paul [Sun, 16 Nov 2014 13:34:04 +0000 (19:04 +0530)]
protocol: Fix some typos in protocol files
Signed-off-by: Seedo Eldho Paul <seedoeldhopaul@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 19 Nov 2014 11:43:32 +0000 (13:43 +0200)]
Revert "input: don't send to clients key events eaten by bindings"
This reverts commit
5c11fc6fb7d9b1bccd50fc982c0798c9e09a2a04.
According to two input specialists, this was the wrong way:
http://lists.freedesktop.org/archives/wayland-devel/2014-November/018287.html
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Daniel Stone <daniel@fooishbar.org>
Cc: Giulio Camuffo <giuliocamuffo@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Tue, 18 Nov 2014 13:57:04 +0000 (15:57 +0200)]
compositor: do not overwrite error exit code
If there are several things that cause an exit, keep the error code from
the first one, not the last one. The latter ones could be just fallout
from the first.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Frederic Plourde [Wed, 29 Oct 2014 18:44:33 +0000 (14:44 -0400)]
compositor: Return a user-defined exit code
Currently, once we've reached our main's wl_display_run(), we always
return ret=EXIT_SUCCESS when weston terminates through wl_display_terminate.
This patch makes it possible to specify another return value by setting
prior to terminating Weston. This is useful for automated tests that want
to report test failures to the overlying testing infrastructure.
Signed-off-by: Frederic Plourde <frederic.plourde@collabora.co.uk>
[Pekka: fixed some tabs.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Giulio Camuffo [Sat, 4 Oct 2014 10:58:33 +0000 (13:58 +0300)]
xwm: find a seat for all the surface's views
This allows to move or resize a xwayland client by acting on all
its views.
Pekka Paalanen [Wed, 12 Nov 2014 14:42:52 +0000 (16:42 +0200)]
input: use tmp var in pointer_unmap_sprite
Remove lots of repeated indirection.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Giulio Camuffo [Tue, 11 Nov 2014 09:23:40 +0000 (11:23 +0200)]
input: don't send to clients key events eaten by bindings
weston key bindings are supposed to eat the key events, and not pass it
on to clients, and indeed the wl_keyboard.key event is not sent. But
we must also not put the key in the keys array to pass to client with
the wl_keyboard.enter event, or else we may send the 'eaten' one too.
In the case of a key binding hiding a surface having the keyboard focus,
the shell may decide to give the focus to another surface, but that will
happen before the key is released, so the new focus surface will receive
the code of the bound key in the wl_keyboard.enter array.
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Tue, 11 Nov 2014 12:10:46 +0000 (14:10 +0200)]
compositor: add missing newline to help text
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Bryce Harrington [Thu, 23 Oct 2014 22:25:04 +0000 (15:25 -0700)]
compositor: List only available backends in help text
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Bryce Harrington [Thu, 23 Oct 2014 22:25:03 +0000 (15:25 -0700)]
compositor: Display option help text only for enabled backends
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Bryce Harrington [Thu, 23 Oct 2014 21:44:36 +0000 (14:44 -0700)]
compositor: Fix typos in help text
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Bryce Harrington [Thu, 23 Oct 2014 21:44:35 +0000 (14:44 -0700)]
compositor: Fix tabbing of help output
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Bryce Harrington [Thu, 23 Oct 2014 21:44:34 +0000 (14:44 -0700)]
compositor: (Whitespace-only) Indent with tabs
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Frederic Plourde [Fri, 24 Oct 2014 02:40:03 +0000 (22:40 -0400)]
man: Fix some weston.ini.man typesetting macros
This patch fixes a couple of misuses around .TP 7 macros that wrongly
limited right margins and relative identation.
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Frank Binns [Tue, 28 Oct 2014 10:50:18 +0000 (10:50 +0000)]
smoke: fix valgrind invalid read errors
There are a number of invalid read errors reported by valgrind of the
form:
==13428== Invalid read of size 4
==13428== at 0x405656: advect (smoke.c:116)
==13428== by 0x405E80: redraw_handler (smoke.c:228)
==13428== by 0x40DE74: widget_redraw (window.c:3995)
==13428== by 0x40E02D: surface_redraw (window.c:4053)
==13428== by 0x40E0C9: idle_redraw (window.c:4082)
==13428== by 0x410FC9: display_run (window.c:5561)
==13428== by 0x406518: main (smoke.c:373)
==13428== Address 0xb2c9b14 is 4 bytes after a block of size
160,000 alloc'd
==13428== at 0x4C29DB4: calloc
==13428== by 0x40646B: main (smoke.c:360)
This results in invalid rendering when running a debug version of the
application.
Fix the issue by limiting the maximum values of px and py to 1.5 less
than width and height. This prevents reading past the end of the source
buffer.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82287
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Jasper St. Pierre [Mon, 13 Oct 2014 01:57:31 +0000 (18:57 -0700)]
smoke: Don't commit an xdg_surface with a NULL buffer
Committing to an xdg_surface with a NULL buffer is currently illegal in
the mutter implementation, so this simply causes the client to error and
exit.
It seems the reason the client did this was so it could add its own
frame callback, but toytoolkit actually provides accurate everything we
need. Just use its functions instead to get the time and schedule a
redraw.
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Giulio Camuffo [Fri, 10 Oct 2014 20:46:50 +0000 (23:46 +0300)]
input: fix access to invalid resource
the keyboard focus surface may not have a valid resource (server side
surface or a surface surviving its client), so check if it is valid
before using it.
Acked-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Fri, 10 Oct 2014 14:36:45 +0000 (09:36 -0500)]
compositor: make keep_buffer a bool
The comments already call it bool, so let's just make it one
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Mon, 10 Nov 2014 16:29:59 +0000 (10:29 -0600)]
compositor: stop sending spurious events on mode switch
commit
6ae7bc982fa accidentally made weston_output_mode_switch_temporary
send done events when it shouldn't.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Wed, 5 Nov 2014 19:26:57 +0000 (13:26 -0600)]
compositor: check version before calling wl_output_send_scale()
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Giulio Camuffo [Fri, 3 Oct 2014 20:36:34 +0000 (23:36 +0300)]
input: allow to destroy bindings in their handler
use wl_list_for_each_safe to iterate on the bindings list when
firing them, this way a binding can safely be destroyed in its
function handler.
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Tue, 4 Nov 2014 16:47:33 +0000 (10:47 -0600)]
compositor: Refactor weston_output_mode_switch()
This breaks weston_output_mode_switch() into 3 functions:
weston_output_mode_set_native()
weston_output_mode_switch_to_temporary()
weston_output_mode_switch_to_native()
Differences from previous behaviour:
SET_NATIVE didn't set current_scale (now it does)
SET_TEMPORARY could set mode and scale independently - now it can't.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Carlos Olmedo Escobar [Tue, 4 Nov 2014 13:38:39 +0000 (14:38 +0100)]
compositor: Fix weston_subsurface_is_synchronized() return value.
Commit
280e7dd918f1717c7d677676384a9cd991097741 introduced a bug in the
return value of weston_subsurface_is_synchronized().
Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
kabeer khan [Mon, 20 Oct 2014 06:25:29 +0000 (11:55 +0530)]
window : compare version and call appropriate destructor
[Pekka Paalanen: removed trailing space, split long line.]
Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
kabeer khan [Mon, 20 Oct 2014 06:17:15 +0000 (11:47 +0530)]
data_device : change version while initializing data_device_manager interface and data_device interface
[Pekka Paalanen: split long lines, dropped MIN().]
Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Fri, 3 Oct 2014 18:13:42 +0000 (13:13 -0500)]
cosmetic: replace boolean function return values with bool
For functions that test if something is true/valid and return a 1
or 0, it makes sense to switch to bool.
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Thu, 9 Oct 2014 23:39:44 +0000 (18:39 -0500)]
gl-renderer: don't move memory in output_rotate_damage
output_rotate_damage shifted an array of pixman regions with a loop. Now
it uses an index into that array.
This currently only saves 1 pixman_region32_copy, but we can now raise
BUFFER_DAMAGE_COUNT without a performance impact if we run into a
configuration where this is useful.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Daniel Stone [Wed, 8 Oct 2014 11:15:48 +0000 (12:15 +0100)]
Very OCD cosmetic nitpick
Daniel Stone [Wed, 8 Oct 2014 11:12:41 +0000 (12:12 +0100)]
releasing: update web host name
Signed-off-by: Daniel Stone <daniels@collabora.com>
Pekka Paalanen [Wed, 1 Oct 2014 13:34:48 +0000 (16:34 +0300)]
tests: add role conflict sub-surface vs. wl_shell_surface
Add tests for triggering the role conflict when a wl_surface is already
a wl_shell_surface and then attempted to be made into a sub-surface, and
vice versa.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Pekka Paalanen [Wed, 1 Oct 2014 12:02:41 +0000 (15:02 +0300)]
compositor: send error for surface role resets
With the more accurate definition of wl_surface roles in Wayland,
enforce the restriction: a role is always set permanently, and
attempting to change it is a protocol error.
This patch is based on Jasper's patch:
http://lists.freedesktop.org/archives/wayland-devel/2014-August/016811.html
The difference in this patch compared to his are:
- send role errors on the interface whose request triggers it, not on
wl_surface
- an interface could have several requests assigning different roles,
cannot use wl_interface as the unique key; use an arbitary string
instead
- ensure in window-manager.c that create_shell_surface() ->
create_common_surface() is never called with surface->configure set,
to avoid compositor abort
- use wl_resource_post_no_memory() where appropriate instead of
hand-rolling it with wl_resource_post_error()
Ideally we would not add weston_surface::role_name field, but use
weston_surface::configure. At the moment this is not possible though,
because at least shell.c uses several different roles with the same
configure function. Drag'n'drop uses two configure functions for the
same role. The configure hook is also reset in several places,
which is not good for role tracking.
This patch overlooks the wl_surface roles assigned in privileged
extensions: screensaver, panel, background, lock, input panel.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Pekka Paalanen [Wed, 1 Oct 2014 11:01:59 +0000 (14:01 +0300)]
protocol: add role error code to xdg_shell
Needed for properly reporting role violations from
xdg_shell.get_xdg_surface and .get_xdg_popup.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
Pekka Paalanen [Wed, 1 Oct 2014 11:03:56 +0000 (14:03 +0300)]
shell: don't crash on create_common_surface() failure
Noticed while reading code, that create_common_surface() may return
NULL, and callers of its direct callers check for NULL, but the
intermediate function in between would crash.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 24 Sep 2014 02:08:49 +0000 (22:08 -0400)]
clients: add presentation-shm demo
This started as a copy of simple-shm.c before it was converted to
xdg_shell.
This demo excercises the presentation feedback interface in five
different modes:
- A continuous repaint loop triggered by frame callbacks, and using
immediate commits, just gathering presentation feedback and computing
some time intervals for statistics.
- The same as above, except with 1s sleep before actually repainting as
a response to frame callback. This tests how well the compositor can
do a repaint from idle state (not continuously repainting), assuming
nothing else is causing repaints.
- A continuous repaint loop triggered by 'presented' events rather than
by frame callbacks. If Weston uses an appropriate scheduling
algorithm, this mode achieves the smallest possible frame latency
(below one output refresh period).
In all modes, all frames are pre-rendered at startup, so no rendering
happens during the animation.
[Louis-Francis Ratté-Boulianne: split queuing feature]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Pekka Paalanen [Wed, 24 Sep 2014 02:08:48 +0000 (22:08 -0400)]
tests: presentation test, simple
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 24 Sep 2014 02:08:47 +0000 (22:08 -0400)]
compositor-drm: deliver frame seq for feedback
Add 'msc' field to weston_output to maintain the refresh counter, and
use it in presentation_feedback.presented.
Make compositor-drm update the per-output refresh counter with the
values reported by DRM. If the DRM reported value jumps backwards,
assume it wrapped around once.
Other backends do not update weston_output::msc, and there
presentation_feedback will always deliver refresh counter as zero.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Pekka Paalanen [Wed, 24 Sep 2014 02:08:46 +0000 (22:08 -0400)]
compositor: implement presentation_feedback
Implement the presentation.feedback request, and the
presentation_feedback protocol interface. Feedback information is
delivered to clients as the backend reports it, except the refresh
counter (MSC) which is always reported as zero.
Changes in v4:
* add 'flags' argument to 'presented' event without implementation
Changes in v5:
* remove the 'destroy' method implementation for feedback objects
[Pekka Paalanen: do not leak struct feedback.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Pekka Paalanen [Wed, 24 Sep 2014 02:08:45 +0000 (22:08 -0400)]
compositor: set and use the presentation clock everywhere
Add presentation clock setters that verify the given clock actually
works. Offer an automatic choice of a software fallback clock, when a
backend has to always use clock_gettime() to approximate the
presentation time.
The DRM backend already queried the DRM about the clock id, just let the
DRM backend set the presentation clock from that.
For all other backends which do not get a timestamp from the driver,
call the software clock setter to choose a suitable clock.
Report the chosen clock via presentation.clock_id event to clients.
In finish_frame(), upgrade the argument from uint32_t milliseconds to
struct timespec which can accurately hold the presentation clock values.
This will be needed when weston_output_finish_frame() starts to send out
presentation_feedback.presented events.
While at it, replace gettimeofday() calls with clock_gettime() using the
chosen presentation clock, so we manufacture presentation timestamps
from the presentation clock when the gfx drivers cannot give us a proper
timestamp.
Rpi patch is more verbose due to not having the compositor pointer
available in rpi_flippipe_update_complete(). Explicitly carry the clock
id with flippipe so it is available in the thread.
Changes in v4:
* rpi debug build fix
v4 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Pekka Paalanen [Wed, 24 Sep 2014 02:08:44 +0000 (22:08 -0400)]
weston-info: report presentation clock
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Pekka Paalanen [Wed, 24 Sep 2014 02:08:43 +0000 (22:08 -0400)]
compositor: add stub implementation of presentation interface
You can bind to the global interface, and it delivers a fake clock id.
All requests on it raise an error.
Changes in v4:
* queuing methods were extractracted for a later series
[Louis-Francis Ratté-Boulianne: split queuing feature]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Pekka Paalanen [Wed, 24 Sep 2014 02:08:42 +0000 (22:08 -0400)]
protocol: add presentation extension v5
Add accurate presentation timing features to Wayland: queueing and
feedback.
This specification is based on the draft written by Frederic Plourde
<frederic.plourde@collabora.co.uk> and redesigned by Pekka Paalanen.
The RFC v2 version is from
http://lists.freedesktop.org/archives/wayland-devel/2014-January/012988.html
Changes in v3:
* associate presentation time to current surface contents
This implements the suggestion from
http://lists.freedesktop.org/archives/wayland-devel/2014-February/013066.html
which prevents surface content from jumping backwards in time if a
client retroactively queues an update with a target time in the past.
* use 64-bit tv_sec in presentation
The time_t type used in struct timespec could be almost anything. POSIX
probably defines it to be an integer, but not the size. Apparently it is
usually 'long', which makes it 64-bit on x86_64.
To be able to fully represent timespec values returned by clock_gettime,
change the protocol to use 64 bits for the tv_sec part.
* define an error for invalid tv_nsec
This allow us to rely on the normalized timestamp form.
* define some interactions with sub-surfaces
Sub-surface cached state updates (synchronized mode) are designed
especially for resizing. As queued updates are not meant to produce any
resizing-like effects, they also do not trigger any sub-surface
operations.
* add sub-headings as xml comments
* queued update cannot map
Because before mapping, the surface has no main output assigned. An
immediate commit is needed anyway, to be able to set all the surface
state, which a queued update cannot touch.
* frame callbacks are not queued
It is not known when queueing frame callbacks would be useful.
Changes in v4:
* remove mentions of the queuing feature
The specification has been split and the queuing feature will be added
back in another version of the extension.
* add flags argument to 'presented' event
Describe the nature of how the update was presented to screen and the
characteristics of the feedback information. No flags have been
defined for now.
* add a protocol error code for invalid flags
Changes in v5:
* remove the destroy method for the feedback object
The protocol object should instead be automatically destroyed after
a 'presented' or 'discarded' event has been triggered.
* some grammatical corrections to the specification
[Louis-Francis Ratté-Boulianne: split the spec in two parts]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Derek Foreman [Fri, 19 Sep 2014 19:43:23 +0000 (14:43 -0500)]
shell: fix weston_output_mode_switch() usage
Calling weston_output_mode_switch() with WESTON_MODE_SWITCH_RESTORE_NATIVE
will result in the mode being set "back" to the passed in mode - so the
passed mode should be the native mode.
Additionally, weston_output_mode_switch() should be called when
output->original_mode is non-NULL (which indicates we had a temporary
mode set). The comparison to current_mode results in a lot of
log chatter.
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Xiong Zhang [Thu, 12 Jun 2014 03:06:26 +0000 (11:06 +0800)]
clients: Maximize window when double touch on title bar
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Derek Foreman [Thu, 18 Sep 2014 21:46:49 +0000 (16:46 -0500)]
cosmetic: Move WL_EXPORT out of header files
Most of the code only puts WL_EXPORT in .c files. Remove the few
instances in header files.
If it's missing form the associated .c, put it there instead.
Derek Foreman [Thu, 18 Sep 2014 21:46:48 +0000 (16:46 -0500)]
cosmetic: Remove prototype for nonexistent function
Pekka Paalanen [Mon, 22 Sep 2014 07:02:17 +0000 (10:02 +0300)]
configure.ac: bump version to 1.6.90
Open master for new features again.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 19 Sep 2014 10:40:14 +0000 (13:40 +0300)]
configure.ac: bump version to 1.6.0
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Olivier Blin [Tue, 16 Sep 2014 17:13:17 +0000 (19:13 +0200)]
editor: do not crash when text input manager is not available
[Pekka Paalanen: whitespace fix]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Olivier Blin [Tue, 16 Sep 2014 17:13:16 +0000 (19:13 +0200)]
keyboard: do not crash when input panel is not available
[Pekka Paalanen: whitespace fix]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Jason Ekstrand [Mon, 15 Sep 2014 19:10:27 +0000 (12:10 -0700)]
compositor-x11: Rename the output make to "weston-X11"
Previously all outputs in the X11 backend had the make "xwayland" which is
confusing. Now they have something that makes a little more sense.
Ondřej Majerech [Sat, 13 Sep 2014 14:35:45 +0000 (16:35 +0200)]
window: Don't needlessly sync parent and geometry
When a toytoolkit client redraws, the toolkit syncs the parent and
geometry. If a client redraws often (such as the terminal drawing a huge
amount of output), this can spam the compositor with requests and may
result in the client's eventual being killed.
We don't need to send requests for changing the geometry or parent if
these haven't changed. So remember the last geometry and parent, and
update them only if needed.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83297
Signed-off-by: Ondřej Majerech <majerech.o@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 12 Sep 2014 09:45:08 +0000 (12:45 +0300)]
configure.ac: bump version 1.5.93 for rc2
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 12 Sep 2014 09:07:43 +0000 (12:07 +0300)]
libinput: default to INFO log level
Set the default logging level from libinput to INFO. This matches better
the behaviour of the old input backend, and prints the found input
devices into Weston's log.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Thu, 11 Sep 2014 21:35:58 +0000 (23:35 +0200)]
libinput-device: Don't get initial key states
Initial key state is no pressed keys, and the libinput_device_get_keys
function was deprecated in libinput 0.6.0.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Peter Hutterer [Tue, 9 Sep 2014 03:02:25 +0000 (13:02 +1000)]
libinput: normalize WL_CALIBRATION before passing it to libinput
WL_CALIBRATION, introduced in weston-1.1, requires the translation component
of the calibration matrix to be in screen coordinates. libinput does not have
access to this and it's not a very generic way to do this anyway. So with
the libinput backend, WL_CALIBRATION support is currently broken (#82742).
This cannot be fixed in libinput without changing its API for this specific
use-case.
This patch lets weston take care of WL_CALIBRATION. It takes the original
format and normalizes it before passing it to libinput. This way libinput
still does the coordinate transformation, weston just needs to provide the
initial configuration.
Note that this needs an updated libinput, otherwise libinput will try to
transform coordinates as well.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82742
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Ondřej Majerech [Thu, 11 Sep 2014 13:53:15 +0000 (15:53 +0200)]
compositor: Don't free an uninitialised pointer.
When backend_init returns NULL, we goto out_signals, which wants to
free(modules), but in this particular code path, modules hasn't been
initialised leading to a "Double-free or corruption" error message.
Initialising modules to NULL makes the free a no-op in this scenario.
Signed-off-by: Ondřej Majerech <majerech.o@gmail.com>
Reviewed-by: Ryo Munakata <ryomnktml@gmail.com>
Bill Spitzak [Wed, 20 Aug 2014 01:13:11 +0000 (18:13 -0700)]
image: don't print redundant error
This error is printed by load_image() now
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Bill Spitzak [Wed, 20 Aug 2014 01:13:10 +0000 (18:13 -0700)]
load_image: always print a message on failure if filename is not empty
It was rather inconsistent before. This may help users figure out why
backgrounds and icons don't show up. A better api where the error can
be queried might be nice, but this seems sufficient for current Weston use.
[Pekka Paalanen: removed one stray space.]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Bill Spitzak [Wed, 20 Aug 2014 01:13:09 +0000 (18:13 -0700)]
parse_options: fail on more malformed options
Fail on trailing text after numbers, such as --width=100mm
Fail on any text after booleans, such as --flag=false
Also fixed reading of memory after the null terminator of a long
option with no = sign in it.
[Pekka Paalanen: some whitespace style fixes.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Wed, 10 Sep 2014 20:37:33 +0000 (15:37 -0500)]
cosmetic: update comments that refer to weston_surface_update_transform()
weston_surface_update_transform() no longer exists, except in comments.
Fix that.
[Pekka Paalanen: don't lose the full comment in compositor-drm.c.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 10 Sep 2014 12:10:30 +0000 (15:10 +0300)]
Partially revert "xdg-shell: Add show_window_menu request"
This reverts the parts of commit
81ff075bf48c55cd07e37784e20c310fa52ed926
that touch window.c.
This brings the toytoolkit window context menus back, until someone
implements the xdg-shell equivalent in the compositor.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82972
Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Marek Chalupa [Mon, 1 Sep 2014 15:20:33 +0000 (17:20 +0200)]
xdg-shell: fix maximizing in multi-head setup
Set the right position of maximized window. Up until now we ignored
output's "position" and were using only the working area
of output which is in output-relative coordinates. This led to
showing the maximized window always on the first output.
This, along with the previous patch, fixes
https://bugs.freedesktop.org/show_bug.cgi?id=82967
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Marek Chalupa [Mon, 8 Sep 2014 10:34:20 +0000 (12:34 +0200)]
xdg-shell: update shsurf->output when maximizing
shsurf->output is the output that user expects the shell surface
is on. When maximizing, we don't have any explicit setting of the output
like in the case of fullscreening, so set the output to the one that
the surface is currently on. In the case that the surface is not mapped yet,
(if it ever happens) use the same heuristics as for fullscreening.
This fixes the size sent with configure event, when maximizing a window.
The size is now picked up by the correct output, but the maximized
window position is still wrong. [Pekka Paalanen]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82967
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Jonas Ådahl [Mon, 8 Sep 2014 17:33:41 +0000 (19:33 +0200)]
input: Schedule pointer sprite repaint when cursor is set
If a cursor was set with wl_pointer.set_cursor but not in combination
with an action that has the side effect of damaging the region where the
cursor is positioned, it would not be drawn. This patch explicitly
schedules a repaint of the pointer sprite when it is set.
clickdot is updated to illustrate the bug; when moving the pointer over
clickdot, the pointer is hidden. When not having moved the pointer for
500 ms it is made visible using wl_pointer.set_pointer.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Giulio Camuffo [Sat, 6 Sep 2014 13:18:02 +0000 (16:18 +0300)]
compositor: fix memory corruption when removing an output
The destructor set on the wl_output resources needs the weston_output
to be allocated, because it removes the resource from its list.
So unset the destructor on all the resources when destroying an
output.
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Ryo Munakata [Fri, 5 Sep 2014 22:32:51 +0000 (07:32 +0900)]
main: don't leak option strings
[Pekka Paalanen: fix a long line]
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Ryo Munakata [Fri, 5 Sep 2014 22:32:05 +0000 (07:32 +0900)]
compositor: extract choose_default_backend and create_listening_socket
Extract these two new functions from main() to improve readability.
Refactoring only, no functioncal changes.
[Pekka Paalanen: commit message]
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Giulio Camuffo [Fri, 5 Sep 2014 20:26:33 +0000 (23:26 +0300)]
compositor: remove unused signal
The move_signal in weston_output isn't used, and not even initialized,
so anything trying to listen to it will crash on wl_signal_add().
Instead of it, the 'output_moved_signal' in weston_compositor is
used, so remove it.
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Jason Ekstrand [Sat, 6 Sep 2014 16:01:28 +0000 (09:01 -0700)]
Fix a copy-paste error in weston_surface_commit_state
Pekka Paalanen [Fri, 5 Sep 2014 12:05:56 +0000 (15:05 +0300)]
configure.ac: bump version to 1.5.92 for rc1
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 5 Sep 2014 11:45:09 +0000 (14:45 +0300)]
fix asprintf warnings
Fix recently introduced compiler warnings:
desktop-shell/shell.c: In function 'shell_configuration':
desktop-shell/shell.c:588:10: warning: ignoring return value of
'asprintf', declared with attribute warn_unused_result [-Wunused-result]
src/screenshooter.c: In function ‘screenshooter_binding’:
src/screenshooter.c:291:10: warning: ignoring return value of
‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
src/text-backend.c: In function ‘text_backend_configuration’:
src/text-backend.c:944:10: warning: ignoring return value of ‘asprintf’,
declared with attribute warn_unused_result [-Wunused-result]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Marek Chalupa [Tue, 2 Sep 2014 09:35:12 +0000 (11:35 +0200)]
xdg-shell: handle clients launched in fullscreen
When client is lauched in fullscreen, it is placed on the
first output, because it is not mapped and
shell_surface_set_output() therefore sets default output.
Since we have no better way how to position newly created windows,
(http://lists.freedesktop.org/archives/wayland-devel/2014-May/thread.html#14568)
set the output to the one that has currently focus. Priority has
the touch focus, then pointer and then keyboard focus.
This fixes bug
https://bugs.freedesktop.org/show_bug.cgi?id=69780
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Thu, 4 Sep 2014 19:31:30 +0000 (14:31 -0500)]
matrix-test: fix units in report
The matrix-test speed tests are calculated in ns but some printed the
units as us
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Thu, 4 Sep 2014 15:23:05 +0000 (10:23 -0500)]
touch-input: Don't dereference NULL pointer during full screen fade
If a full screen program is fading out and a touch start happens, it
will result in a NULL pointer dereference when weston_touch_set_focus
tries to derefernce view->surface->resource.
Instead, this patch sets the focus to NULL, which should be the
same as if the program was destroyed during the touch anyway.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=78706
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Xiong Zhang [Thu, 12 Jun 2014 03:06:25 +0000 (11:06 +0800)]
clients: Maximize window when double click on title bar
Signed-off-by: Xiong Zhang <panda0626@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Boyan Ding [Sat, 30 Aug 2014 02:33:23 +0000 (10:33 +0800)]
xwm: Do not activate override redirect windows
We shouldn't do WM-y things on an O-R window, including setting input
focus to it.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=81273
Signed-off-by: Boyan Ding <stu_dby@126.com>
Tested-by: Ryo Munakata <ryomnktml@gmail.com>
Acked-by: Christopher Michael <cp.michael@samsung.com>
Jonny Lamb [Wed, 20 Aug 2014 09:27:10 +0000 (11:27 +0200)]
desktop-shell: implement touch popup grabs
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Ryo Munakata [Wed, 3 Sep 2014 16:56:53 +0000 (01:56 +0900)]
pixman-renderer: copy_to_hw_buffer: don't leak output_region
This was reported by Valgrind.
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Derek Foreman [Mon, 1 Sep 2014 15:33:28 +0000 (10:33 -0500)]
pixman-renderer: fail to zoom more gracefully
When zoom is activated in the pixman rendered the log is filled with warnings
and all rendering stops. With this patch the warning is generated once and
rendering continues without zooming.
Closes bug 80258
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80258
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>