From 8ace56a84e4584ae259ec5b034e6b7292b40232d Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 11 Oct 2018 08:43:12 +0200 Subject: [PATCH] Adjust NSOpenGLView subclass use for glcanvas on macOS makes this not fully a user pane, leave default handling for most things, but indicate that we can have the focus, fixes #18237 --- src/osx/cocoa/glcanvas.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index cc889507e7..de9ff18901 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -135,6 +135,11 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs, return YES; } +- (BOOL) acceptsFirstResponder +{ + return YES; +} + @end bool wxGLCanvas::DoCreate(wxWindow *parent, @@ -154,7 +159,7 @@ bool wxGLCanvas::DoCreate(wxWindow *parent, NSRect r = wxOSXGetFrameForControl( this, pos , size ) ; wxNSCustomOpenGLView* v = [[wxNSCustomOpenGLView alloc] initWithFrame:r]; - wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v, false, true ); + wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v ); SetPeer(c); MacPostControlCreate(pos, size) ; return true;