Don't send mouse events to disabled windows in wxOSX

Disabled controls are not supposed to accept any input, so don't send any
mouse events to them.

This fixes the behaviour of wxSlider which could be moved (and generated the
corresponding events) even when it was disabled.

Closes #17194.
This commit is contained in:
Vadim Zeitlin
2016-11-22 02:07:44 +01:00
parent 27ca9ad556
commit dcb1229f41
2 changed files with 4 additions and 1 deletions

View File

@@ -165,6 +165,7 @@ wxOSX:
- Implement wxDataViewCtrl::SetRowHeight(). - Implement wxDataViewCtrl::SetRowHeight().
- Add OSXEnableAutomaticQuoteSubstitution(), OSXEnableAutomaticDashSubstitution() - Add OSXEnableAutomaticQuoteSubstitution(), OSXEnableAutomaticDashSubstitution()
and OSXDisableAllSmartSubstitutions() to control wxTextCtrl smart behavior. and OSXDisableAllSmartSubstitutions() to control wxTextCtrl smart behavior.
- Don't allow interacting with disabled wxSlider (Andreas Falkenhahn).
Unix: Unix:

View File

@@ -985,7 +985,9 @@ void wxOSX_mouseEvent(NSView* self, SEL _cmd, NSEvent *event)
if (impl == NULL) if (impl == NULL)
return; return;
impl->mouseEvent(event, self, _cmd); // We shouldn't let disabled windows get mouse events.
if (impl->GetWXPeer()->IsEnabled())
impl->mouseEvent(event, self, _cmd);
} }
void wxOSX_cursorUpdate(NSView* self, SEL _cmd, NSEvent *event) void wxOSX_cursorUpdate(NSView* self, SEL _cmd, NSEvent *event)