+static void mac_suspendresume(EventRecord *event)
+{
+ WindowPtr front;
+ EventRecord fakeevent;
+
+ /*
+ * We're called either before we're suspended or after we're
+ * resumed, so we're the front application at this point.
+ */
+ front = FrontWindow();
+ if (front != NULL) {
+ fakeevent.what = activateEvt;
+ fakeevent.message = (UInt32)front;
+ fakeevent.when = event->when;
+ fakeevent.where = event->where;
+ fakeevent.modifiers =
+ (event->message & resumeFlag) ? activeFlag : 0;
+ mac_activatewindow(front, &fakeevent);
+ }
+}
+