Commit Graph

4319 Commits

Author SHA1 Message Date
Pekka Paalanen 8b5211835f 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>
2014-11-27 09:13:39 +02:00
Pekka Paalanen ba5ebf8364 configure: remove input backend result
Don't print a line with empty value.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-26 13:48:29 +02:00
Peter Hutterer 823ad33ef3 compositor: Drop legacy backends in favor of libinput
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-26 13:47:42 +02:00
Pekka Paalanen a4bac9e0e0 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>
2014-11-24 13:47:32 +02:00
Giulio Camuffo fde9490d7e 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>
2014-11-24 13:44:06 +02:00
Derek Foreman 6bef237943 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>
2014-11-24 12:21:05 +02:00
Bryce Harrington 3e3b59e0a2 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>
2014-11-21 16:35:25 +02:00
Derek Foreman 4703d689fd 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>
2014-11-21 16:30:42 +02:00
Derek Foreman a04e913304 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>
2014-11-21 16:29:06 +02:00
Bryce Harrington 19c8db9cce 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>
2014-11-21 16:28:12 +02:00
Pekka Paalanen b4e976ab56 man: explain idle-time=0 in weston.ini
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-21 16:11:44 +02:00
Frederic Plourde 4a84c83ad7 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>
2014-11-21 16:03:37 +02:00
Marek Chalupa e9fe467453 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>
2014-11-21 15:14:55 +02:00
Javier Jardón c47931e0f9 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
2014-11-21 14:18:05 +02:00
Derek Foreman f81809864e 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>
2014-11-21 12:32:53 +02:00
Derek Foreman 64a3df086e 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>
2014-11-19 16:46:56 +02:00
Marek Chalupa eaea470510 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>
2014-11-19 15:46:30 +02:00
Marek Chalupa 0d7fe8d925 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>
2014-11-19 15:39:36 +02:00
Seedo Eldho Paul 95292f22f4 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>
2014-11-19 13:55:00 +02:00
Pekka Paalanen 86b5396d89 Revert "input: don't send to clients key events eaten by bindings"
This reverts commit 5c11fc6fb7.

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>
2014-11-19 13:45:38 +02:00
Pekka Paalanen f5ef88ff60 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>
2014-11-18 15:57:04 +02:00
Frederic Plourde c336f06e70 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>
2014-11-18 15:55:42 +02:00
Giulio Camuffo ad7305ad74 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.
2014-11-18 15:00:27 +02:00
Pekka Paalanen c557ff7ea3 input: use tmp var in pointer_unmap_sprite
Remove lots of repeated indirection.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-12 16:42:52 +02:00
Giulio Camuffo 5c11fc6fb7 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>
2014-11-11 15:07:12 +02:00
Pekka Paalanen 86b70e16eb compositor: add missing newline to help text
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-11 14:10:46 +02:00
Bryce Harrington 32297c96d3 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>
2014-11-11 14:08:51 +02:00
Bryce Harrington 8eb95c495c 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>
2014-11-11 14:08:20 +02:00
Bryce Harrington b8b25bd5e8 compositor: Fix typos in help text
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2014-11-11 14:04:05 +02:00
Bryce Harrington f5b34aeeb8 compositor: Fix tabbing of help output
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2014-11-11 14:03:34 +02:00
Bryce Harrington 59fe423e3a compositor: (Whitespace-only) Indent with tabs
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2014-11-11 14:03:16 +02:00
Frederic Plourde 4b53f630e8 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>
2014-11-11 13:05:48 +02:00
Frank Binns 77f7daca68 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>
2014-11-11 12:59:43 +02:00
Jasper St. Pierre c8e41868fd 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>
2014-11-11 12:33:01 +02:00
Giulio Camuffo de77e32b10 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>
2014-11-11 11:56:37 +02:00
Derek Foreman 0fd6d4ec53 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>
2014-11-11 09:32:02 +02:00
Derek Foreman dd4cd33f18 compositor: stop sending spurious events on mode switch
commit 6ae7bc982f 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>
2014-11-11 08:59:22 +02:00
Derek Foreman 41bdc27393 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>
2014-11-10 13:27:38 +02:00
Giulio Camuffo 24b98d0108 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>
2014-11-05 15:35:47 +02:00
Derek Foreman 6ae7bc982f 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>
2014-11-05 13:15:13 +02:00
Carlos Olmedo Escobar 61a9bf5557 compositor: Fix weston_subsurface_is_synchronized() return value.
Commit 280e7dd918 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>
2014-11-05 12:49:42 +02:00
kabeer khan 6ce67ecbce 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>
2014-11-04 15:27:07 +02:00
kabeer khan 3a510d8f52 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>
2014-11-04 15:21:58 +02:00
Derek Foreman 280e7dd918 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>
2014-11-04 12:45:49 +02:00
Derek Foreman 4c582666dd 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>
2014-10-10 05:18:27 -07:00
Daniel Stone 32d9ea1c8a Very OCD cosmetic nitpick 2014-10-08 12:15:48 +01:00
Daniel Stone 16a34f1e32 releasing: update web host name
Signed-off-by: Daniel Stone <daniels@collabora.com>
2014-10-08 12:12:41 +01:00
Pekka Paalanen 3c5f1c76b2 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>
2014-10-08 13:16:40 +03:00
Pekka Paalanen 50b6747903 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>
2014-10-08 13:16:30 +03:00
Pekka Paalanen d7cd1480d4 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>
2014-10-08 13:15:45 +03:00