summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/release' into stableSergio Ahumada2013-08-284-21/+43
|\ | | | | | | Change-Id: I815757e33b6c0b1e702c8e386e8e30307f78e318
| * Android: Fix orientation change on Android 4.3Eskil Abrahamsen Blomfeldt2013-08-194-21/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Android 4.3, we will get a new native window pointer for the same surface (the old surface has not been destroyed), whereas before we would get the same pointer, thus hitting the "sameNativeWindow" branch. This revealed some bugs in the surfaceChanged code path when the old surface had not been destroyed. This path is now taken both when there's no old surface (the app has been suspended in the mean time) and when the orientation changes. To handle the second case, we need to make sure: 1. We update the static pointer 2. We update the pointers in the platform windows 3. We don't add a second reference to the static data for windows 4. We schedule an update of the window size Task-number: QTBUG-32878 Change-Id: I47257615f9ba820315fc98d7a804e52223f430bf Reviewed-by: Christian Stromme <christian.stromme@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Android: Remove EGL_BAD_SURFACE warning on suspensionEskil Abrahamsen Blomfeldt2013-08-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | When suspending the app we would destroy the surface twice, causing libEGL to output a warning on the second attempt. We would also destroy the surface before all references were released which is not 100% nice. We don't need to call the super class implementation at all, since we are managing the EGL surface ourselves. Change-Id: Ie1ab2ea8561d0018b5f16ac8cdf3296313a0a92c Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* | Add workaround for GL on Android emulatorEskil Abrahamsen Blomfeldt2013-07-292-0/+16
|/ | | | | | | | | | | | On the Android Emulator, the shaders will be compiled by a desktop GL driver, since the GL driver in the emulator is just a thin wrapper. The GL driver does not necessarily support the precision qualifiers, which can cause applications to break. We detect this at runtime in the platform plugin and set a workaround flag to Task-number: QTBUG-32557 Change-Id: Ied00cfe8e804d1f7862697dd379a14f3bed3d980 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Android: Fix initial window size for raster backendPaul Olav Tvete2013-06-262-0/+12
| | | | | | | | | | | We forgot to set the ShowIsFullScreen property for the raster engine case. OpenGL windows already did the right thing, since the GL backend is based on eglFS. The iOS backend also has this logic. Task-number: QTBUG-31984 Change-Id: I1cf5df32d79f441768126f00632107a7971eb5ad Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android Mute and FastForward keys mapped wrongAllan Sandfeld Jensen2013-06-171-4/+7
| | | | | | | | | | | | | | KEYCODE_MEDIA_FAST_FORWARD is mapped to Qt::Key_Forward, which undoes Back. I believe the best match in Qt would be Qt::Key_AudioForward which is also mapped by XCB from XF86XK_AudioForward /* fast-forward audio track */ KEYCODE_MUTE is mapped to Qt::Key_Volume_Mute, but the mute button is for muting the microphone, the volume mute is called KEYCODE_VOLUME_MUTE. Change-Id: Id0b78c9bde78faef1f5d31019693e6c466941d70 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Disable long press on AndroidPaul Olav Tvete2013-06-101-0/+4
| | | | | | | | | | | | | | | | Remove the mapping from press-and-hold to right-mouse-button press. This logic was implemented in the android plugin, and there was no way to disable it for applications that needed to handle long presses in a different way. Add an environment variable to enable the mapping for those who really need it, but do not advertise it. (We want to add a proper API for this in 5.2) Task-number: QTBUG-31644 Change-Id: Ia5ae75d6147485b73c78b7c3fa88d11af5d84c06 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Never show EGLFS mouse cursor in Qt for Android platform pluginEskil Abrahamsen Blomfeldt2013-05-201-0/+7
| | | | | | | | | | | | | The hack to use the environment variable for turning off the mouse cursor is broken when running against Ministro, because Ministro does not pass the environment on. A better solution is to make it possible to turn the cursor in the EGLFS plugin off in the hooks instead. Task-number: QTBUG-30553 Change-Id: Id09b48c350d2c95de9bb174f7480cf0cd2bf8145 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Android: don't crash on exitPaul Olav Tvete2013-04-302-27/+21
| | | | | | | | | | | We have to call DetachCurrentThread() for each time we call AttachCurrentThread(). Fortunately we have this convenience class that we prepared earlier. Task-number: QTBUG-30847 Change-Id: I5ffb94b336d3787a3bae197bab22b91770d58848 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: fix crash on exitPaul Olav Tvete2013-04-261-1/+0
| | | | | | | | QTouchDevice is already automatically deleted at shutdown. Task-number: QTBUG-30847 Change-Id: Id6a407083efed849a34ccb1caa315204fc5a5891 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Don't crash when displaying multiple top-levelsEskil Abrahamsen Blomfeldt2013-04-187-33/+108
| | | | | | | | | | | | | | | | | | | | | | While the raster platform plugin supports multiple top level windows, this is not supported on the GL plugin, so if you use GL or QtQuick2 in your app and use several top levels, the app would crash with an error message. A problem is that the top-level SurfaceView is a special overlay View and does not support being stacked in a layout. So instead, we let all windows share the same GL surface and draw on top of each other. This works fine for simple use cases. We implement a new platform capability to make sure no top level windows (even combobox popups and dialogs) get non-fullscreen geometries. That has never worked properly with the eglfs plugin. Task-number: QTBUG-30473 Change-Id: Ia1438019638fc739cc93ffe79b46b81631254df2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Remove code for Android API level < 9Eskil Abrahamsen Blomfeldt2013-04-151-35/+2
| | | | | | | | We don't support API levels < 9, so we can simplify this code a little. Change-Id: I9823d4c5a44d265e03dec0ceedeeb3c34a1e1eab Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: set logicalDpi based on DisplayMetrics.scaledDensityPaul Olav Tvete2013-04-055-2/+24
| | | | | | | | | | | | | | The mathematically correct way would be to set logicalDPi to 160*scaledDensity, but then a 12 pt font would be gigantic. On iOS, we use a factor of 72 to be compatible with the native APIs, but that means that a 12 pt font is very small. A factor of 100 means that desktop apps look reasonable by default. Task-number: QTBUG-29674 Change-Id: I607f110150fb95685a6980b92f6f92f2b489f959 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Don't show '&' character in menusPaul Olav Tvete2013-04-041-6/+23
| | | | | | | | | Strip out shortcut indicator before showing the text. Task-number: QTBUG-30507 Change-Id: I8fa2ef8a2052f4c43d14b3babfd5aca0a08e29d5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Inform android input method when cursor is movedPaul Olav Tvete2013-03-222-0/+11
| | | | | | | | | | Google Japanese Input Beta keeps track of the cursor position, and bails out if the cursor is not where it thinks it should be. We have to tell the IM every time we move the cursor, not only when we are composing. Change-Id: I9cdb28f81c76e76d3b0125d08bf0595616ca443f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Remove QtWidgets dependency from Android platform pluginEskil Abrahamsen Blomfeldt2013-03-222-25/+4
| | | | | | | | | | | The setFullScreen() function was never called from anywhere, so it was just removed. The update() loop for top level widgets has been replaced by a loop sending expose events to top level windows. Task-number: QTBUG-29313 Change-Id: Ic31a05ad3a0693f1d3f61457cee9d78f6b334b4d Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix multi-touch input on AndroidEskil Abrahamsen Blomfeldt2013-03-125-3/+35
| | | | | | | | | The touch events were collected but then thrown away because of a missing port of he handleTouchEvent() function call. Task-number: QTBUG-29126 Change-Id: I02f7380945be04a36da14a89f2f3ff9429b17cbc Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Introducing the Qt Android portPaul Olav Tvete2013-03-0544-0/+5837
Based on the Necessitas project by Bogdan Vatra. Contributors to the Qt5 project: BogDan Vatra <bogdan@kde.org> Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> hjk <hjk121@nokiamail.com> Oswald Buddenhagen <oswald.buddenhagen@digia.com> Paul Olav Tvete <paul.tvete@digia.com> Robin Burchell <robin+qt@viroteck.net> Samuel Rødal <samuel.rodal@digia.com> Yoann Lopes <yoann.lopes@digia.com> The full history of the Qt5 port can be found in refs/old-heads/android, SHA-1 249ca9ca2c7d876b91b31df9434dde47f9065d0d Change-Id: Iff1a7b2dbb707c986f2639e65e39ed8f22430120 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>