[escher/responder] Access the app directly from the shared container

This commit is contained in:
Ruben Dashyan
2019-05-16 17:42:15 +02:00
committed by EmilieNumworks
parent ba2a98f5e5
commit 652cbae9ac

View File

@@ -1,6 +1,5 @@
#include <escher/responder.h>
#include <escher/app.h>
#include <escher/metric.h>
#include <escher/container.h>
#include <assert.h>
Responder::Responder(Responder * parentResponder) :
@@ -63,12 +62,6 @@ Responder * Responder::commonAncestorWith(Responder * responder) {
return s;
}
/* We assume the app is the root parent. */
App * Responder::app() const {
const Responder * rootResponder = this;
while (rootResponder->parentResponder() != nullptr) {
rootResponder = rootResponder->parentResponder();
}
App * result = (App *)rootResponder;
return result;
return Container::sharedContainer()->activeApp();
}