separate non-native key handling from IsUserPane

NSOpenGLView is needed under 10.14 as a native view, but it doesn’t have its own native key handling, therefore use the same code we have for non-native custom views.
This commit is contained in:
Stefan Csomor
2019-01-03 13:26:50 +01:00
parent 155a19a1a2
commit a29ea16ccd
5 changed files with 51 additions and 10 deletions

View File

@@ -2223,7 +2223,7 @@ void wxWindowMac::MacRepositionScrollBars()
bool wxWindowMac::AcceptsFocus() const
{
if ( GetPeer() == NULL || GetPeer()->IsUserPane() )
if ( GetPeer() == NULL || GetPeer()->HasUserKeyHandling() )
return wxWindowBase::AcceptsFocus();
else
return GetPeer()->CanFocus();
@@ -2742,10 +2742,20 @@ void wxWidgetImpl::RemoveAssociation(WXWidget control)
wxIMPLEMENT_ABSTRACT_CLASS(wxWidgetImpl, wxObject);
wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane )
{
Init();
m_isRootControl = isRootControl;
m_wantsUserKey = m_isUserPane = isUserPane;
m_wxPeer = peer;
m_shouldSendEvents = true;
}
wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane, bool wantsUserKey )
{
Init();
m_isRootControl = isRootControl;
m_isUserPane = isUserPane;
m_wantsUserKey = wantsUserKey;
m_wxPeer = peer;
m_shouldSendEvents = true;
}