1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 01:18:38 -05:00

Fix for Android Qt6

This commit is contained in:
Jon Beniston 2024-10-21 17:05:19 +01:00
parent de37c031b5
commit b6146caf36
2 changed files with 33 additions and 1 deletions

View File

@ -95,6 +95,38 @@ void Android::moveTaskToBack()
}
}
void Android::acquireWakeLock()
{
QJniObject activity = QJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;");
if (activity.isValid()) {
activity.callMethod<void>("acquireWakeLock");
}
}
void Android::releaseWakeLock()
{
QJniObject activity = QJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;");
if (activity.isValid()) {
activity.callMethod<void>("releaseWakeLock");
}
}
void Android::acquireScreenLock()
{
QJniObject activity = QJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;");
if (activity.isValid()) {
activity.callMethod<void>("acquireScreenLock");
}
}
void Android::releaseScreenLock()
{
QJniObject activity = QJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;");
if (activity.isValid()) {
activity.callMethod<void>("releaseScreenLock");
}
}
#else // QT_VERSION
#include <QtAndroid>

View File

@ -1143,7 +1143,7 @@ void LoadConfigurationFSM::restoreGeometry()
m_mainWindow->m_workspaces[i]->adjustSubWindowsAfterRestore();
#ifdef ANDROID
// On Android, workspaces seem to be restored to 0,20, rather than 0,0
m_mainWindow->m_workspaces[i]->move(m_workspaces[i]->pos().x(), 0);
m_mainWindow->m_workspaces[i]->move(m_mainWindow->m_workspaces[i]->pos().x(), 0);
// Need to call updateGeometry, otherwise sometimes the layout is corrupted
m_mainWindow->m_workspaces[i]->updateGeometry();
#endif