Add wxWindow::EnableTouchEvents()
Don't request touch event generation for all windows by default, this has an inherent overhead and is not needed for 99% of the application windows, so require calling EnableTouchEvents() explicitly to do it instead. Note that this requires properly initializing gesture recognizers in wxOSX now that they're not always allocated, otherwise releasing them when destroying the window would crash.
This commit is contained in:
@@ -43,6 +43,13 @@ MyGesturePanel::MyGesturePanel(MyGestureFrame *parent) : wxPanel(parent, wxID_AN
|
||||
Bind(wxEVT_PAINT, &MyGesturePanel::OnPaint, this);
|
||||
}
|
||||
|
||||
if ( !EnableTouchEvents(wxTOUCH_ALL_GESTURES) )
|
||||
{
|
||||
wxLogError("Failed to enable touch events");
|
||||
|
||||
// Still bind event handlers just in case they still work?
|
||||
}
|
||||
|
||||
// Event handlers
|
||||
Bind(wxEVT_GESTURE_PAN, &MyGesturePanel::OnPan, this);
|
||||
Bind(wxEVT_GESTURE_ZOOM, &MyGesturePanel::OnZoom, this);
|
||||
|
Reference in New Issue
Block a user