diff --git a/direct/src/plugin/p3dInstance.cxx b/direct/src/plugin/p3dInstance.cxx index abc2736e4f..775b06ee8f 100644 --- a/direct/src/plugin/p3dInstance.cxx +++ b/direct/src/plugin/p3dInstance.cxx @@ -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: diff --git a/direct/src/plugin_npapi/ppInstance.cxx b/direct/src/plugin_npapi/ppInstance.cxx index d5c2bde44e..06cc3d5564 100644 --- a/direct/src/plugin_npapi/ppInstance.cxx +++ b/direct/src/plugin_npapi/ppInstance.cxx @@ -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__