Skip to content

Commit

Permalink
PUGL: fix to get events from the beginning in Bitwig on macOS
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Westerfeld <[email protected]>
  • Loading branch information
swesterfeld committed Jun 25, 2024
1 parent 07ea8ce commit cbbf015
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions glui/pugl/pugl_osx.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ - (id) initWithFrame:(NSRect)frame

- (void) reshape
{
[super reshape];
[[self openGLContext] update];

if (!puglview) {
Expand Down Expand Up @@ -227,6 +228,11 @@ - (void) drawRect:(NSRect)rect
#endif
}

- (BOOL) acceptsFirstMouse:(NSEvent *)event
{
return YES;
}

- (BOOL) acceptsFirstResponder
{
return YES;
Expand Down Expand Up @@ -599,6 +605,8 @@ - (void) flagsChanged:(NSEvent*)event
[pview addSubview:impl->glview];
// required to get mouse move events in Ableton Live (and possibly other hosts)
[[pview window] setAcceptsMouseMovedEvents: YES];
// focus our view (required to get events from the beginning in Bitwig)
[[pview window] makeFirstResponder:impl->glview];
[impl->glview setHidden:NO];
} else {
NSString* titleString = [[NSString alloc]
Expand Down

0 comments on commit cbbf015

Please sign in to comment.