Mailing List Archive

r19299 - in projects/haf/trunk/clutter0.8: clutter debian
Author: gw
Date: 2009-09-07 18:39:27 +0300 (Mon, 07 Sep 2009)
New Revision: 19299

Modified:
projects/haf/trunk/clutter0.8/clutter/clutter-main.c
projects/haf/trunk/clutter0.8/clutter/clutter-main.h
projects/haf/trunk/clutter0.8/clutter/clutter-private.h
projects/haf/trunk/clutter0.8/debian/changelog
Log:
Gordon:
* clutter/clutter-main.c
clutter/clutter-main.h
clutter/clutter-private.h: Add extra function called
clutter_grab_pointer_without_pick. This allows input events to be received
but ensures that clutter does not do picking in order to find which actor
is under the cursor. Also removed un-needed glFinish for picking (syncing
should be done in GLES) and increased clutter motion events frequency.


Modified: projects/haf/trunk/clutter0.8/clutter/clutter-main.c
===================================================================
--- projects/haf/trunk/clutter0.8/clutter/clutter-main.c 2009-09-07 08:19:49 UTC (rev 19298)
+++ projects/haf/trunk/clutter0.8/clutter/clutter-main.c 2009-09-07 15:39:27 UTC (rev 19299)
@@ -440,9 +440,8 @@
/* Revert our changes to clipping... */
cogl_clip_unset();

- /* Below to be safe, particularly on GL ES. an EGL wait call or full
- * could be nicer. */
- glFinish();
+ /* We should *not* have to wait here as OpenGL/GLES will ensure that
+ * everything is in sync. Calling glFinish would just slow us down more. */

/* Read the color of the screen co-ords pixel */
glReadPixels (x, inv_y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
@@ -2076,9 +2075,13 @@
}

/* Map the event to a reactive actor */
- actor = _clutter_do_pick (CLUTTER_STAGE (stage),
- x, y,
- CLUTTER_PICK_REACTIVE);
+ if (context->pointer_grab_actor &&
+ !context->grab_actor_needs_pick)
+ actor = context->pointer_grab_actor;
+ else
+ actor = _clutter_do_pick (CLUTTER_STAGE (stage),
+ x, y,
+ CLUTTER_PICK_REACTIVE);

event->any.source = actor;
if (!actor)
@@ -2273,6 +2276,8 @@

context = clutter_context_get_default ();

+ context->grab_actor_needs_pick = TRUE;
+
if (context->pointer_grab_actor == actor)
return;

@@ -2294,6 +2299,20 @@
}
}

+/* Just like clutter_grab_pointer, but allows the programmer
+ * to request that Clutter does not perform the pick operation on every
+ * mouse move event. This is useful if we don't want the added delay of
+ * a pick operation. */
+void
+clutter_grab_pointer_without_pick (ClutterActor *actor)
+{
+ ClutterMainContext *context = clutter_context_get_default ();
+
+ clutter_grab_pointer(actor);
+
+ context->grab_actor_needs_pick = FALSE;
+}
+
/**
* clutter_grab_pointer_for_device:
* @actor: a #ClutterActor
@@ -2499,7 +2518,7 @@
{
guint frequency;

- frequency = clutter_default_fps / 4;
+ frequency = clutter_default_fps / 2;
frequency = CLAMP (frequency, 20, 45);

return frequency;

Modified: projects/haf/trunk/clutter0.8/clutter/clutter-main.h
===================================================================
--- projects/haf/trunk/clutter0.8/clutter/clutter-main.h 2009-09-07 08:19:49 UTC (rev 19298)
+++ projects/haf/trunk/clutter0.8/clutter/clutter-main.h 2009-09-07 15:39:27 UTC (rev 19299)
@@ -154,6 +154,7 @@
guint clutter_get_default_frame_rate (void);

void clutter_grab_pointer (ClutterActor *actor);
+void clutter_grab_pointer_without_pick (ClutterActor *actor);
void clutter_ungrab_pointer (void);
ClutterActor * clutter_get_pointer_grab (void);


Modified: projects/haf/trunk/clutter0.8/clutter/clutter-private.h
===================================================================
--- projects/haf/trunk/clutter0.8/clutter/clutter-private.h 2009-09-07 08:19:49 UTC (rev 19298)
+++ projects/haf/trunk/clutter0.8/clutter/clutter-private.h 2009-09-07 15:39:27 UTC (rev 19299)
@@ -113,6 +113,8 @@
ClutterActor *pointer_grab_actor; /* The actor having the pointer grab
* (or NULL if there is no pointer grab
*/
+ gboolean grab_actor_needs_pick; /* Whether to perform a pick for
+ the grabbed actor or not */
ClutterActor *keyboard_grab_actor; /* The actor having the pointer grab
* (or NULL if there is no pointer
* grab)

Modified: projects/haf/trunk/clutter0.8/debian/changelog
===================================================================
--- projects/haf/trunk/clutter0.8/debian/changelog 2009-09-07 08:19:49 UTC (rev 19298)
+++ projects/haf/trunk/clutter0.8/debian/changelog 2009-09-07 15:39:27 UTC (rev 19299)
@@ -1,8 +1,15 @@
clutter (0.8.2-0maemo49~unreleased) unstable; urgency=low

- * foo
+ Gordon:
+ * clutter/clutter-main.c
+ clutter/clutter-main.h
+ clutter/clutter-private.h: Add extra function called
+ clutter_grab_pointer_without_pick. This allows input events to be received
+ but ensures that clutter does not do picking in order to find which actor
+ is under the cursor. Also removed un-needed glFinish for picking (syncing
+ should be done in GLES) and increased clutter motion events frequency.

- -- Gordon Williams <gordon.williams@collabora.co.uk> Tue, 1 Sep 2009 12:43:14 +0300
+ -- Gordon Williams <gordon.williams@collabora.co.uk> Tue, 7 Sep 2009 14:34:14 +0100

clutter (0.8.2-0maemo48) unstable; urgency=low


_______________________________________________
maemo-commits mailing list
maemo-commits@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-commits