2008-01-18 Emmanuele Bassi <ebassi@openedhand.com>
authorEmmanuele Bassi <ebassi@openedhand.com>
Fri, 18 Jan 2008 18:08:37 +0000 (18:08 +0000)
committerEmmanuele Bassi <ebassi@openedhand.com>
Fri, 18 Jan 2008 18:08:37 +0000 (18:08 +0000)
* clutter/clutter-main.c (clutter_do_event): Check the
return value of the ::event signal for the CLUTTER_DELETE
event type.

* clutter/clutter-stage.c (clutter_stage_event): Emit the
::event signal when receiving the CLUTTER_DELETE event; this
allows to intercept the user's closing of the stage window.

ChangeLog
clutter/clutter-main.c
clutter/clutter-stage.c

index 6044137..5cacc86 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-01-18  Emmanuele Bassi  <ebassi@openedhand.com>
+
+       * clutter/clutter-main.c (clutter_do_event): Check the
+       return value of the ::event signal for the CLUTTER_DELETE
+       event type.
+
+       * clutter/clutter-stage.c (clutter_stage_event): Emit the
+       ::event signal when receiving the CLUTTER_DELETE event; this
+       allows to intercept the user's closing of the stage window.
+
 2007-01-18  Tomas Frydrych  <tf@openedhand.com>
 
        * clutter/clutter-fixed.h:
index 2f2d77d..a67ba57 100644 (file)
@@ -1376,7 +1376,8 @@ clutter_do_event (ClutterEvent *event)
       case CLUTTER_DESTROY_NOTIFY:
       case CLUTTER_DELETE:
         event->any.source = stage;
-        if (clutter_stage_event (CLUTTER_STAGE (stage), event))
+        /* the stage did not handle the event, so we just quit */
+        if (!clutter_stage_event (CLUTTER_STAGE (stage), event))
           clutter_main_quit ();
         break;
 
index a1644da..83cf2fb 100644 (file)
@@ -874,7 +874,13 @@ clutter_stage_event (ClutterStage *stage,
   priv = stage->priv;
 
   if (event->type == CLUTTER_DELETE)
-    return TRUE;
+    {
+      gboolean retval = FALSE;
+
+      g_signal_emit_by_name (stage, "event", event, &retval);
+
+      return retval;
+    }
 
   if (event->type != CLUTTER_STAGE_STATE)
     return FALSE;