DEV-49389 (SNOW-571 / VWR-18279): Replacing another deprecated WaitNextEvent() for the OS X 10.6 SDK
Replaced the deprecated WaitNextEvent() call with ReceiveNextEvent() and SendEventToEventTarget() as a basic event loop in slplugin.cppmaster
parent
f758852266
commit
0cdaca2b46
|
|
@ -255,6 +255,9 @@ int main(int argc, char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if LL_DARWIN
|
||||
EventTargetRef event_target = GetEventDispatcherTarget();
|
||||
#endif
|
||||
while(!plugin->isDone())
|
||||
{
|
||||
timer.reset();
|
||||
|
|
@ -262,8 +265,12 @@ int main(int argc, char **argv)
|
|||
#if LL_DARWIN
|
||||
{
|
||||
// Some plugins (webkit at least) will want an event loop. This qualifies.
|
||||
EventRecord evt;
|
||||
WaitNextEvent(0, &evt, 0, NULL);
|
||||
EventRef event;
|
||||
if(ReceiveNextEvent(0, 0, kEventDurationNoWait, true, &event) == noErr)
|
||||
{
|
||||
SendEventToEventTarget (event, event_target);
|
||||
ReleaseEvent(event);
|
||||
}
|
||||
|
||||
// Check for a change in this process's frontmost window.
|
||||
if(FrontWindow() != front_window)
|
||||
|
|
|
|||
Loading…
Reference in New Issue