mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[escher/responder] Access the app directly from the shared container
This commit is contained in:
committed by
EmilieNumworks
parent
ba2a98f5e5
commit
652cbae9ac
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user