X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fandroid%2Fmainthread.cpp;h=6441c2059b8179066fc61336801940320dedad9a;hp=d394f838bcd497495255dc14296313f546a7813f;hb=41363aed34382386f915f17c1a961750b4fdcb14;hpb=264195348a606f22f9d50348cd03b93b49175acc diff --git a/source/core/android/mainthread.cpp b/source/core/android/mainthread.cpp index d394f83..6441c20 100644 --- a/source/core/android/mainthread.cpp +++ b/source/core/android/mainthread.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -14,8 +15,7 @@ namespace Android { MainThread::MainThread(ANativeActivity *a): asset_manager(a->assetManager), - int_data_path(a->internalDataPath), - starting_up(true) + int_data_path(a->internalDataPath) { attach_to_activity(a); startup_mutex.lock(); @@ -32,6 +32,8 @@ void MainThread::attach_to_activity(ANativeActivity *a) activity->callbacks->onInputQueueCreated = &input_queue_created; activity->callbacks->onInputQueueDestroyed = &input_queue_destroyed; activity->instance = this; + + set_window_flags(AWINDOW_FLAG_FULLSCREEN, 0); } void MainThread::wait_for_app_created() @@ -48,12 +50,25 @@ void MainThread::resume_startup() } } +JavaVM *MainThread::get_java_vm() const +{ + if(!activity) + return nullptr; + + return activity->vm; +} + +void MainThread::set_window_flags(unsigned set, unsigned clear) +{ + ANativeActivity_setWindowFlags(activity, set, clear); +} + void MainThread::main() { /* I have no idea how dependable this is, but it seems to be the only way to get the package name aside from making a Java call through JNI */ char *appname = strdup(int_data_path[-2].c_str()); - char *argv[] = { appname, 0 }; + char *argv[] = { appname, nullptr }; Msp::Android::ErrorLogger err_logger; FS::chdir(FS::dirname(int_data_path)); Msp::Application::run(1, argv, this, &app_created);