[clutter/deprecate-default-stage: 13/14] evdev: don't even process events without a default stage
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/deprecate-default-stage: 13/14] evdev: don't even process events without a default stage
- Date: Thu, 10 Nov 2011 15:53:11 +0000 (UTC)
commit 5705d08b5d50901e2f752a505e7daab3e98696ae
Author: Lionel Landwerlin <lionel g landwerlin linux intel com>
Date: Fri Jun 17 11:31:34 2011 +0100
evdev: don't even process events without a default stage
The evdev system is a bit different from other input systems in
Clutter because it's completly decorrelated from anything graphic.
In the case of embedded devices with no proper windowing system, you
might want to not implicitly create a default stage when you're
receiving the first input event.
This patch changes this behavior by not forwarding any event if you
don't have a default stage.
Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>
https://bugzilla.gnome.org/show_bug.cgi?id=651718
clutter/evdev/clutter-device-manager-evdev.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c
index 26079f1..80c0698 100644
--- a/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/evdev/clutter-device-manager-evdev.c
@@ -44,6 +44,7 @@
#include "clutter-input-device-evdev.h"
#include "clutter-main.h"
#include "clutter-private.h"
+#include "clutter-stage-manager.h"
#include "clutter-xkb-utils.h"
#include "clutter-device-manager-evdev.h"
@@ -268,9 +269,14 @@ clutter_event_dispatch (GSource *g_source,
ClutterEvent *event;
gint len, i, dx = 0, dy = 0;
uint32_t _time;
+ ClutterStageManager *stage_manager;
+ ClutterStage *default_stage;
clutter_threads_enter ();
+ stage_manager = clutter_stage_manager_get_default ();
+ default_stage = clutter_stage_manager_get_default_stage (stage_manager);
+
/* Don't queue more events if we haven't finished handling the previous batch
*/
if (!clutter_events_pending ())
@@ -303,6 +309,10 @@ clutter_event_dispatch (GSource *g_source,
goto out;
}
+ /* Drop events if we don't have any stage to forward them to */
+ if (!default_stage)
+ goto out;
+
for (i = 0; i < len / sizeof (ev[0]); i++)
{
struct input_event *e = &ev[i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]