diff --git a/escher/src/button_row_controller.cpp b/escher/src/button_row_controller.cpp index c7212b850..e58df4c90 100644 --- a/escher/src/button_row_controller.cpp +++ b/escher/src/button_row_controller.cpp @@ -49,10 +49,15 @@ int ButtonRowController::ContentView::numberOfSubviews() const { } View * ButtonRowController::ContentView::subviewAtIndex(int index) { - if (index == 0) { + /* Warning: the order of the subviews is important for drity tracking. + * Indeed, when a child is redrawn, the redrawn area is the smallest + * rectangle unioniong the dirty rectangle and the previous redrawn area. + * As the main view is more likely to be bigger, we prefer to set it as the + * last child. */ + if (index == numberOfSubviews() - 1) { return m_mainViewController->view(); } else { - return buttonAtIndex(index - 1); + return buttonAtIndex(index); } }