Hierarchy and Device changed events come through with the X window set
to be the root window, not the stage window. We need to whitelist them
so that we can actually support hotplugging and device changes.
Slave and floating devices should always be disabled, and not deliver
events to the scene. It is up to the user to enable non-master devices
and handle events coming from them.
ClutterInputDevice gets a new :enabled property, defaulting to FALSE;
when a device manager creates a new device it has to set it to TRUE if
the :device-mode property is set to CLUTTER_INPUT_MODE_MASTER.
The main event queue entry point, _clutter_event_push(), will
automatically discard events coming from disabled devices.
This is a lump commit that is fairly difficult to break down without
either breaking bisecting or breaking the test cases.
The new design for handling X11 event translation works this way:
- ClutterBackend::translate_event() has been added as the central
point used by a ClutterBackend implementation to translate a
native event into a ClutterEvent;
- ClutterEventTranslator is a private interface that should be
implemented by backend-specific objects, like stage
implementations and ClutterDeviceManager sub-classes, and
allows dealing with class-specific event translation;
- ClutterStageX11 implements EventTranslator, and deals with the
stage-relative X11 events coming from the X11 event source;
- ClutterStageGLX overrides EventTranslator, in order to
deal with the INTEL_GLX_swap_event extension, and it chains up
to the X11 default implementation;
- ClutterDeviceManagerX11 has been split into two separate classes,
one that deals with core and (optionally) XI1 events, and the
other that deals with XI2 events; the selection is done at run-time,
since the core+XI1 and XI2 mechanisms are mutually exclusive.
All the other backends we officially support still use their own
custom event source and translation function, but the end goal is to
migrate them to the translate_event() virtual function, and have the
event source be a shared part of Clutter core.
The extension keyboard support in XInput 1.x is hopelessly broken.
Nevertheless, it's possible to use some bits of it, as we prefer the
core keyboard events to the XInput events, thus at least having proper
handling for X11 key events on the Stage window.
The build for interactive tests creates symbolic links for the data
under tests/data; it also uses symbolic links for creating "binaries"
for each interactive test. This is less than ideal, though.
Instead, the tests should build a path to the data files by using
a pre-processor define like TESTS_DATADIR; both g_build_filename() and
pre-processor string concatenation can be used to generate a valid
file name with the full path to the files.
The build system should also create wrapper scripts, just like we
do inside the conformance test suite, to be able to launch single
tests.
Now that we can safely check for an uninitialized Clutter we
don't have side effects in calling one of the functions like
clutter_x11_enable_xinput(), which require to be called before
any other Clutter function.
The input device API is split halfway thorugh the backends in a very
weird way. The data structures are private, as they should, but most
of the information should be available in the main API since it's
generic enough.
The device type enumeration, for instance, should be common across
every backend; the accessors for device type and id should live in the
core API. The internal API should always use ClutterInputDevice and
not the private X11 implementation when dealing with public structures
like ClutterEvent.
By adding accessors for the device type and id, and by moving the
device type enumeration into the core API we can cut down the amount
of symbols private and/or visible only to the X11 backends; this way
when other backends start implementing multi-pointer support we can
share the same API across the code.
framework
* configure.ac:
* tests/*:
The tests have been reorganised into different categories: conformance,
interactive and micro benchmarks.
- conformance tests can be run as part of automated tests
- interactive tests are basically all the existing tests
- micro benchmarks focus on a single performance metric
I converted the timeline tests to conformance tests and also added some
tests from Neil Roberts and Ebassi.
Note: currently only the conformance tests use the glib test APIs,
though the micro benchmarks should too.
The other change is to make the unit tests link into monolithic binaries
which makes the build time for unit tests considerably faster. To deal
with the extra complexity this adds to debugging individual tests I
have added some sugar to the makefiles so all the tests can be run
directly via a symlink and when an individual test is run this way,
then a note is printed to the terminal explaining exactly how that test
may be debugged using GDB.
There is a convenience make rule: 'make test-report', that will run all
the conformance tests and hopefully even open the results in your web
browser. It skips some of the slower timeline tests, but you can run
those using 'make full-report'