]> git.tdb.fi Git - libs/core.git/commitdiff
Expose window flags and set fullscreen mode by default
authorMikko Rasa <tdb@tdb.fi>
Thu, 13 Nov 2014 20:46:48 +0000 (22:46 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 13 Nov 2014 20:46:48 +0000 (22:46 +0200)
I'll likely change the default once I figure out a good way to add
fullscreen support to libmspgui on Android.

source/core/android/mainthread.cpp
source/core/android/mainthread.h

index d394f838bcd497495255dc14296313f546a7813f..255eaa3260b892f43ae5d69eb670340b6a487120 100644 (file)
@@ -1,5 +1,6 @@
 #include <cstring>
 #include <cstdlib>
+#include <android/window.h>
 #include <msp/fs/dir.h>
 #include <msp/fs/path.h>
 #include <msp/fs/utils.h>
@@ -32,6 +33,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,6 +51,11 @@ void MainThread::resume_startup()
        }
 }
 
+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
index 09f907f174a30862e9f970cd005590a0a9b12ece..22309eee3d3d2ca47584573210ebb7a8935f7234 100644 (file)
@@ -37,6 +37,8 @@ public:
        AAssetManager *get_asset_manager() const { return asset_manager; }
        const FS::Path &get_internal_data_path() const { return int_data_path; }
 
+       void set_window_flags(unsigned, unsigned);
+
 private:
        virtual void main();