Commit Graph

14 Commits

Author SHA1 Message Date
Emmanuele Bassi
e0f04efa41 device: When changing the stage, unset the pointer actor
If we do not unset the Stage we will have stale data, and the Crossing
event when re-entering a Stage will not be emitted, as the actor under
the pointer might be the same as before.
2010-02-26 11:19:26 +00:00
Emmanuele Bassi
5ed4732737 device: Force ENTER on Stage with overlapping Actors
If an actor is on the boundary of a Stage and the pointer for a device
enters the Stage over that actor, the sequence of events currently is:

  ➔ ENTER (source: actor, related: NULL)
  ➔ MOTION

Thus the Stage never gets an ENTER event. This is a regression from
Clutter 1.0.

The correct sequence is:

  ➔ ENTER (source: stage, related: NULL)
  ➔ ENTER (source: actor, related: stage)
  ➔ MOTION

This also maps to the sequence of events sythesized by Clutter when
leaving the Stage through an actor overlapping the Stage boundary.

http://bugzilla.moblin.org/show_bug.cgi?id=9781
2010-02-22 11:30:14 +00:00
Emmanuele Bassi
9a6de8757f docs: Document the InputDevice update method
Embedding toolkits should benefit from a proper documentation of
clutter_input_device_update_from_event(): its meaning, its use and
the caveats for the "update_stage" argument.
2010-02-18 11:40:49 +00:00
Emmanuele Bassi
51a3e49c82 device: Allow updating devices from embedding toolkits
Embedding toolkits most likely will disable the event handling, so all
the input device code will not be executed. Unfortunately, the newly
added synthetic event generation of ENTER and LEAVE event pairs depends
on having input devices.

In order to unbreak things without reintroducing the madness of the
previous code we should allow embedding toolkits to just update the
state of an InputDevice by using the data contained inside the
ClutterEvent. This strategy has two obvious reasons:

  • the embedding toolkit is creating a ClutterEvent by translating
    a toolkit-native event anyway

  • this is exactly what ClutterStage does when processing events

We are, essentially, deferring input device handling to the embedding
toolkits, just like we're deferring event handling to them.
2010-02-17 18:21:50 +00:00
Emmanuele Bassi
fbcaf1e0b3 Improve LEAVE events for border actors
If an actor is lying on the border of the Stage it might miss the LEAVE
event when the pointer of a device leaves the Stage window. Since the
backend is unsetting the Stage back pointer on the InputDevice we can
queue the emission of a LEAVE event on the pointer actor as well.

http://bugzilla.moblin.org/show_bug.cgi?id=9677
2010-02-17 10:48:18 +00:00
Emmanuele Bassi
d0734bc474 input-device: Do not pick() on NULL stages
If the stage associated to the InputDevice is not set we should
short-circuit out and return NULL. This will result in a pick()
done on the event's stage - if applicable.

http://bugzilla.moblin.org/show_bug.cgi?id=9602
2010-02-10 17:13:33 +00:00
Emmanuele Bassi
cf4e05930a device: Add the :name property to InputDevice
The InputDevice should have a name, possibly user readable, coming from
the backend.
2010-01-20 00:38:09 +00:00
Emmanuele Bassi
8a579838d5 device: Unset the cursor actor when leaving the stage
When an InputDevice leaves a stage we set the stage member of
InputDevice to NULL. We should also unset the cursor_actor (as the
device is obviously not on an actor any more).

When the device re-enters the Stage the ENTER/LEAVE event generation
machinery will then be able to emit the ENTER event on the Stage.
2010-01-20 00:38:09 +00:00
Emmanuele Bassi
55e4315aa5 device: Add pointer actor getter
ClutterInputDevice should have a getter method for retrieving the
reactive actor underneath the pointer.
2010-01-20 00:38:09 +00:00
Emmanuele Bassi
cf8a06f018 device: Store the current state, not the previous
The previous state for the device is used by the click count machinery
and we should not be overwriting it at every event; instead, we should
use a parallel storage for the current state coming from the windowing
system.
2010-01-20 00:38:08 +00:00
Emmanuele Bassi
687c70dffa Rework the emission of LEAVE/ENTER event pairs
The LEAVE/ENTER event pairs should be queued during the InputDevice
update process, when we change the actor under the device pointer.

This commit cleans up the event emission code inside clutter-main.c
and the logic of the event processing.
2010-01-20 00:38:08 +00:00
Emmanuele Bassi
a056ae7164 Add docs and licensing notices 2010-01-20 00:38:08 +00:00
Emmanuele Bassi
9506510d1c Move all picking-related operations inside InputDevice
The InputDevice objects stores pointer coordinates, state, stage and
the actor under the cursor, so if the current backend provides us with
one attached to the Event structure then we want the InputDevice itself
to update its state and give us the ClutterActor underneath the
pointer's cursor.
2010-01-20 00:38:08 +00:00
Emmanuele Bassi
d23dd9af6b device: Make InputDevice an object and subclass it for X11
ClutterInputDevice should be a type that we can subclass per-backend
to add functionality.
2010-01-20 00:38:08 +00:00