Browse Source

MacOS pugl fixing

tags/1.9.4
falkTX 12 years ago
parent
commit
8ad17643d4
1 changed files with 22 additions and 1 deletions
  1. +22
    -1
      source/libs/distrho/dgl/src/pugl/pugl_osx.m

+ 22
- 1
source/libs/distrho/dgl/src/pugl/pugl_osx.m View File

@@ -359,9 +359,12 @@ puglCreate(PuglNativeWindow parent,
[window setContentView:impl->glview];
[NSApp activateIgnoringOtherApps:YES];
[window makeFirstResponder:impl->glview];

[window makeKeyAndOrderFront:window];

if (! addToDesktop) {
[window setIsVisible:NO];
}

return view;
}

@@ -381,6 +384,24 @@ puglProcessEvents(PuglView* view)
{
[view->impl->glview setNeedsDisplay: YES];

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSEvent* event;

for (;;) {
event = [view->impl->window
nextEventMatchingMask:NSAnyEventMask
untilDate:[NSDate distantPast]
inMode:NSDefaultRunLoopMode
dequeue:YES];

if (event == nil)
break;

[view->impl->window sendEvent: event];
}
[pool release];

return PUGL_SUCCESS;
}



Loading…
Cancel
Save