migrate refresh requests into core api

This commit is contained in:
David Rose 2009-07-17 18:46:10 +00:00
parent 5448505f3a
commit b01400ff97
2 changed files with 8 additions and 17 deletions

View File

@ -483,6 +483,13 @@ handle_event(P3D_event_data event) {
switch (er->what) {
case nullEvent:
// We appear to get this event pretty frequently when nothing else
// is going on. Great; we'll take advantage of it to request a
// refresh, which will cause updateEvt to be triggered (if the
// instance is still onscreen).
if (_instance_window_opened && _swbuffer != NULL && _swbuffer->ready_for_read()) {
request_refresh();
}
break;
case mouseDown:

View File

@ -479,24 +479,8 @@ handle_event(void *event) {
}
#ifdef __APPLE__
EventRecord *er = (EventRecord *)event;
switch (er->what) {
case nullEvent:
// We appear to get this event pretty frequently when nothing else
// is going on. Great; we'll take advantage of it to invalidate
// the instance rectangle, which will cause updateEvt to be
// triggered (if the instance is still onscreen).
if (_got_window && _python_window_open) {
NPRect rect = { 0, 0, _window.height, _window.width };
browser->invalidaterect(_npp_instance, &rect);
}
break;
}
// All other events we feed down to the plugin for processing.
P3D_event_data edata;
edata._event = er;
edata._event = (EventRecord *)event;
P3D_instance_handle_event(_p3d_inst, edata);
#endif // __APPLE__