summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-03-07 02:17:49 +0200
committerTor Lillqvist <tml@iki.fi>2013-03-07 02:33:42 +0200
commit0ce2d740a2ed93a029a290fe88748ac92baff9a0 (patch)
tree3751cf456702440375fac64790df35bbf46a2dd2 /desktop/source
parent8ba203c726df97039125ad8b3223802fc80a9110 (diff)
Handle damage tracking and redrawing properly in the "desktop" Android app
In the damaged() method do a callback up to Java code in Desktop that invalidates the view. For now store the view in a static field, but need to do that in a cleaner way eventually. There might in some circumstancest be several instances of the Desktop activity present. Obviously should also run just one LO thread. Get rid of the temporary self-invalidattion in onDraw() silliness. Start the LO thread that runs soffice_main() from Java, not from native code. Apparently only threads created from Java have proper class loaders in Android. No need for an own DoReleaseYield() in AndroidSalInstance, the one in the SvpSalInstance base class does what needs to be done. Change-Id: I4cb85b352fca1f1375f726620ec8c93d2047f113
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/sofficemain.cxx26
1 files changed, 9 insertions, 17 deletions
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 7ae12fb8ae71..8a0f6985c47e 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -91,27 +91,19 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
}
#ifdef ANDROID
-class MainThread : public salhelper::Thread
-{
-public:
- MainThread() : salhelper::Thread("vcl-mainloop") { launch(); }
- virtual void execute()
- {
- int nRet;
- do {
- nRet = soffice_main();
- LOGI("soffice_main returned %d", nRet );
- } while (nRet == 81 || nRet == 79); // pretend to re-start.
- exit (nRet);
- }
-};
extern "C" SAL_JNI_EXPORT void JNICALL
-Java_org_libreoffice_experimental_desktop_Desktop_spawnMain(JNIEnv* /* env */,
- jobject /* dummy */)
+Java_org_libreoffice_experimental_desktop_Desktop_runMain(JNIEnv* /* env */,
+ jobject /* clazz */)
{
- new MainThread();
+ int nRet;
+ do {
+ nRet = soffice_main();
+ LOGI("soffice_main returned %d", nRet );
+ } while (nRet == 81 || nRet == 79); // pretend to re-start.
+
}
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */