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.
This commit is contained in:
Emmanuele Bassi 2008-01-18 18:08:37 +00:00
parent c9aa5f1b1a
commit 94fb3f0c6a
3 changed files with 19 additions and 2 deletions

View File

@ -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:

View 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;

View 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;