Mostly remove headers that aren't actually needed for anything.
Add stdint.h to permit dropping xf86drm.h, which is otherwise unneeded.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Marek Chalupa <mchqwerty@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>