In seat_handle_capabilities, if input->pointer is not properly
initialized, then it will contain an arbitrary value and results
in the wl_pointer listener not getting registered if that value
is not 0/null. Thus, use calloc to initialize the "input" instance.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=49937
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Also make all the callers of weston_surface_assign_output() update the
transform instead. This makes sure that when the surface is assigned an
output its bouding box is valid.
This fixes a bug where a newly created surface would have a NULL output
assigned. This would cause weston_surface_schedule_repaint() to not
schedule a repaint, preventing the surface to be shown until something
else caused a repaint.
Add key event to the text_model interface and a key request to the
input_method_context interface. Implement it in the example editor
client and the example keyboard.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Add delete_surrounding_text event in the text_model interface and the
request in the input_method_context interface. Implement it in the
example editor client and in the example keyboard so that the backspace
key works with it.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Remove the wl_surface argument from create_text_model request. The
wl_surface is specified as an argument in the activate request instead.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
We can now load any number of general modules, and the shell and xwayland
are just two of them. We continue to use the mechanism for testing but
custom input drivers or logging mechanisms, for example are other use cases.
Modify the pkg-config check for setbacklight so that failure only
disables building setbacklight, instead of failing the whole configure.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
These keymap events communicate the keymap from the compositor to the
clients via fd passing, rather than having the clients separately
compile a map.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_pointer_button_state enum, and explicit comparisons.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Took me a second to work out that the 272 was actually BTN_LEFT, as keys
and buttons share a namespace in evdev.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
wl_input_device has been both renamed and split. wl_seat is now a
virtual object representing a group of logically related input devices
with related focus.
It now only generates one event: to let clients know that it has new
capabilities. It takes requests which hand back objects for the
wl_pointer, wl_keyboard and wl_touch interfaces it exposes which all
provide the old input interface, just under different names.
This commit tracks these changes in weston and the clients, as well as
similar renames (e.g. weston_input_device -> weston_seat). Some other
changes were necessary, e.g. renaming the name for the visible mouse
sprite from 'pointer' to 'cursor' so as to not conflict.
For simplicity, every seat is always exposed with all three interfaces,
although this will change as time goes on.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
To add greater precision when working with transformed surfaces and/or
high-resolution input devices.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
We check that we get surface.enter_output and move the pointer into
the window and make sure we get input_device.pointer_enter with
the right coordinates.
There's a lot of code for a very simple test here, so we need to
figure out how to reuse most of the event handling and such. It's also
not clear that a custom, text based protocol is practical here, we might
just use a wayland extension after all.
There are no dependencies or requirements there that we don't already
need for weston itself. So lets just always build them.
Use check_PROGRAMS for the matrix unit test case.
Updates the .gitignore files for clients and tests to reflect a new test and a
couple of renamed applications.
Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
We just set the input region to the bounding box of the window frame
and set the opaque region to be the opaque rectangle inside the window
if the child widget is opaque.
This test uses files from src/ so use COMPOSITOR_CFLAGS to find headers
in non-standard locations.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
The compositor will likely do an order of magnitude less matrix
inversions than point transformations with an inverse, hence we do not
really need the optimised path for single-shot invert-and-transform.
Expose only the computing of the explicit inverse matrix in the API.
However, the matrix inversion tests need access to the internal
functions. Designate a unit test build by #defining UNIT_TEST, and
export the internal functions in that case.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Add a new directory tests/ for unit test applications. This directory
will be built only if --enable-tests is given to ./configure.
Add matrix-test application. It excercises especially the
weston_matrix_invert() and weston_matrix_inverse_transform() functions.
It has one test for correctness and precision, and other tests for
measuring the speed of various matrix operations.
For the record, the correctness test prints:
a random matrix:
1.112418e-02 2.628150e+00 8.205844e+02 -1.147526e-04
4.943677e-04 -1.117819e-04 -9.158849e-06 3.678122e-02
7.915063e-03 -3.093254e-04 -4.376583e+02 3.424706e-02
-2.504038e+02 2.481788e+03 -7.545445e+01 1.752909e-03
The matrix multiplied by its inverse, error:
0.000000e+00 -0.000000e+00 -0.000000e+00 -0.000000e+00
0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
-0.000000e+00 -0.000000e+00 0.000000e+00 -0.000000e+00
0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
max abs error: 0, original determinant 11595.2
Running a test loop for 10 seconds...
test fail, det: -0.00464805, error sup: inf
test fail, det: -0.0424053, error sup: 1.30787e-06
test fail, det: 5.15191, error sup: 1.15956e-06
tests: 6791767 ok, 1 not invertible but ok, 3 failed.
Total: 6791771 iterations.
These results are expected with the current precision thresholds in
src/matrix.c and tests/matrix-test.c. The random number generator is
seeded with a constant, so the random numbers should be the same on
every run. Machine speed and scheduling affect how many iterations are
run.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>