summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfsintegration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* eglfs: Move remaining sources to under apiLaszlo Agocs2016-09-221-439/+0
| | | | | | | | | | | | | | Move platform integration, context and offscreensurface to under 'api'. This allows accessing these from out-of-tree eglfs backends as well. For instance, the upcoming eglfs_emu backend for the Qt Simulator may need access to QEglFSIntegration. Clean up the project files and remove out-of-date comments (the private module QtEglFSDeviceIntegration is not really header-less since 5.7). Change-Id: If96dd5780a6bd33a1cf29164364df9bf921c4d01 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Rework privateFeatureLars Knoll2016-08-191-9/+9
| | | | | | | | | | | | | | | | | | privateFeature would add QT_NO_FEATURE to the DEFINES in the private .pri file, which was somewhat inelegant. Additionally, it would add the feature to the _public_ QT_CONFIG variable, which was plain wrong. Replace the implementation with the one just introduced for publicFeature, with the difference that the features are written to the private files instead. As this entirely disposes of the old system, all usages in the project files need to be replaced atomically as well. Change-Id: I506b5d41054410659ea503bc6901736cd5edec6e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Install some eglfsdeviceintegration headers, as a private moduleGiulio Camuffo2016-06-031-22/+4
| | | | | | | | This allows external integrations to be developed against it. Also uniforms all class names as QEglFSFoo. Change-Id: I72ff37c0fcdf1ccd37110b4c36874d6c99b2e743 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-2/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| * egl: Reshuffle headers to help less fortunate systems with X11Laszlo Agocs2016-05-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EGL headers including X headers has traditionally been problematic due to getting macros for Status, None, etc. In most cases this is not an issue anymore because on embedded one will almost always use a driver targeting the framebuffer or DRM/KMS and therefore the EGL headers do not pull in X dependencies. Furthermore, Mesa supports MESA_EGL_NO_X11_HEADERS which we set, avoiding the problem altogether with Mesa regardless of targeting X11 or KMS. However, other drivers do not have this option. On i.MX6 for instance, targeting X11 is problematic due to not having EGL_API_FB defined, which in turn means the EGL headers pulls in X headers in order to be able to define the native display and window types as Display and Window. Try to play nice with this use case by reshuffling the includes and undefining the problematic names. This restores patch set 2 from the previously merged, and then reverted commit. This here is safe since the egl.h include and the following undefs are only done internally for eglfs and can have therefore no effect on other code. Task-number: QTBUG-52928 Change-Id: I383e783d5064dc8fb41f3ef56d2a4f4fcd31a6cf Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
| * Revert "egl: Reshuffle headers to help less fortunate systems with X11"Liang Qi2016-05-041-0/+2
| | | | | | | | | | | | | | | | | | This reverts commit ecf127505effbbf4dbfd1e7cb9561de5dae51bf2. ecf12750 breaks the build of qtwayland. Change-Id: If8bf04f035aa47e4e867d201ec7d95b0d3e18317 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * egl: Reshuffle headers to help less fortunate systems with X11Laszlo Agocs2016-05-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EGL headers including X headers has traditionally been problematic due to getting macros for Status, None, etc. In most cases this is not an issue anymore because on embedded one will almost always use a driver targeting the framebuffer or DRM/KMS and therefore the EGL headers do not pull in X dependencies. Furthermore, Mesa supports MESA_EGL_NO_X11_HEADERS which we set, avoiding the problem altogether with Mesa regardless of targeting X11 or KMS. However, other drivers do not have this option. On i.MX6 for instance, targeting X11 is problematic due to not having EGL_API_FB defined, which in turn means the EGL headers pulls in X headers in order to be able to define the native display and window types as Display and Window. Try to play nice with this use case by reshuffling the includes and undefining the problematic names. Task-number: QTBUG-52928 Change-Id: I059f26b340b6e442e7296055915d18f5a1ce7a7f Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* | Remove the traces of the discontinued android-no-sdk platformEirik Aavitsland2016-03-301-5/+5
| | | | | | | | | | | | | | | | | | Cleaning out the workarounds for the discontinued "Embedded Android" platform of Boot2Qt. Change-Id: I0ff9d770e82a43457fb7e5da0428f4597ead4038 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-4/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * eglfs: Sanitize the widget compositor's context handlingLaszlo Agocs2016-01-291-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | createPlatformOpenGLContext() used to silently set the widget compositor's context as the context to share resources with. This works mostly, but is the wrong level to enforce the resource sharing. For example, QOpenGLContext::shareGroup() becomes inconsistent since from QOpenGLContext's view there was no shareContext specified. The inability to test via shareGroup() is the reason eglfs started to show warnings when exiting applications. The resource sharing was in place on EGL level but QOpenGLContext knew nothing about it. Therefore, let's switch over to the way other components, f.ex. Web Engine use: set the internal global share context pointer to the widget compositor's context. This way everything remains consistent: the widget compositor's context is stored upon creating the main QEGLFSWindow, QWidget::shareContext() picks this up then, and as a result we have sharing set up on QOpenGLContext's level instead of sneaking it in in the QPlatformOpenGLContext implementation. Task-number: QTBUG-50707 Change-Id: I5fc1dec58c69c46aa83c7b4cab1eadce6fa633ce Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | eglfs: use QGenericUnixTheme if requestedShawn Rutledge2016-01-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to have reasonable paths for loading icons and such things, just as in any other Unix GUI environment. However there is some concern that it would be too much of a behavior change if there was a theme by default, so for now it's required to set the env var: QT_QPA_PLATFORMTHEME=generic That works because QGuiApplicationPrivate::createPlatformIntegration() reads the env variable and passes platformThemeName to init_platform(). Step 3 in init_platform() does not find a theme plugin by that name (because QGenericUnixTheme is statically linked via libQt5PlatformSupport.a). Then in step 4 it iterates the given platformThemeName plus any which were returned from QPlatformIntegration::themeNames() (which in our case will be an empty list) and calls createPlatformTheme() with each of those, until something is returned. So, QEglFSIntegration::createPlatformTheme() will be called with the value of the QT_QPA_PLATFORMTHEME env var, and QGenericUnixTheme::createUnixTheme() will create the generic, KDE or Gnome theme depending on that value. Change-Id: Id16b881819ba872830b019ab147b32fbc2156520 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-2/+2
|/ | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Rename "wl_display" native resourcePaul Olav Tvete2015-11-031-1/+1
| | | | | | | | | | | There is already a "wl_display" resource used by the client-side Wayland plugin. This is confusing, and would cause horrible bugs if ever a Wayland server was run as a client (the nested compositor usecase). Therefore, use "server_wl_display" for the name of the resource to be used on the server side. Change-Id: I30455177a154e89b98ad3620b6a14626b821e54c Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Support for Wayland servers on i.MX6Paul Olav Tvete2015-11-021-2/+7
| | | | | | | | | A wayland compositor on i.MX6 needs to create the wl_display before creating the EGL display. This wl_display then needs to be exposed so that QWaylandCompositor can use it. Change-Id: Id60f6dd2fbba05140ca0671da6f17dbc2ecce3a3 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* eglfs: Handle custom platform window implementations betterLaszlo Agocs2015-10-141-5/+10
| | | | | | | | | | | | | | Backends may want to subclass QEglFSWindow and reimplement resetSurface() and similar. Make it possible to do this by moving window creation to the device integration interface, similarly to screens. In addition to customizing the windows, some backends may want to disable the dependency on surfaceless contexts when using offscreen windows (i.e. pbuffer surfaces). Make this possible too. Change-Id: Ic5a426e07f821c7a800217b8799f91770ba6a6d8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* eglfs: Create input handlers only when screens are availableLaszlo Agocs2015-09-221-3/+4
| | | | | | | | Some code may rely on the primary screen geometry for example. Task-number: QTBUG-47002 Change-Id: I42fc1ccf0c1d91beb5d8e9691ac6ec4e7400e567 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* eglfs: Use libinput by default when availableLaszlo Agocs2015-08-181-0/+12
| | | | | | | | | | Can be overridden by setting QT_QPA_EGLFS_NO_LIBINPUT. On systems where libinput is present it is usually a better choice to rely on it instead of evdev*. Change-Id: I78857ff91c837f58fdc7d1e119260bd6819fbf4e Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Move eglfs-only parts back from eglconvenienceLaszlo Agocs2015-07-161-36/+289
| | | | | | | | | | | | | | The integration, screen, window and cursor classes were split in Qt 5.3 under a plan of sharing these between eglfs, the Android port and potentially other future plugins. This never materialized. Maintaining the artificial split is getting difficult and is prone to errors. Therefore it is time to merge back these base classes into eglfs. The result is cleaner, smaller, and potentially better performing code. eglconvenience is now restored to be a collection of convenience classes instead of platform plugin bits. Change-Id: I75c6ad876ef66a1a0c5b39c1c307f928d2ed47d4 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* eglfs: Destroy screens after windowsPier Luigi Fiorini2015-06-301-1/+4
| | | | | | | | Screens must be destroyed after windows otherwise the application will crash on QEglFSWindow::destroy() because the screen is NULL. Change-Id: I315ddc267dd0d2dd2a1c4f3a0c319c8f2c11ec28 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* eglfs: don't build the cursor atlas when QT_NO_CURSOR is definedAndrew Knight2015-03-121-0/+2
| | | | | | Change-Id: I675bc127296c016a40ec2edfdb6602908fec4c2f Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-101-10/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Fix build of egl integrationStephan Binner2015-02-021-10/+10
| | | | | | | | | | | | | | Add missing includes and reorder includes to avoid X defines breakage Change-Id: Iaf95ae2488df3d3301436262ed79f7091b4be0a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | eglfs: Update screen destruction to follow the new approachLaszlo Agocs2015-01-091-0/+5
| | | | | | | | | | | | | | | | Call destroyScreen(), like other platform plugins do since 9b4fbe85d2e00c625c3d4abd975faf555000f685. Change-Id: Idbddb026d7a964f15c00acfacf70064405dc3f16 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Pluginize the eglfs hooksLaszlo Agocs2014-12-081-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the principle of device integrations in QtWayland and soon xcb, a plugin interface is being introduced to gradually replace the statically compiled-in hooks. The interface is same as before for the time being, for compatibility with the existing device-specific hooks. QEglFSHooks is now just a dummy subclass for QEGLDeviceIntegration to support the legacy, compiled-in, device-specific hooks. When -device is not used with configure and so there is no hook active, the new plugin-based approach kicks in. The environment variable QT_QPA_EGLFS_INTEGRATION can be set to indicate the preferred integration name (e.g. eglfs_x11, eglfs_kms). It can also be set to "none", indicating that no plugins should be considered and the default, non-specialized integration is to be used. (this is for devices, like Beagleboard|bone, that do not need any special code to set up EGL) Device makespecs can set EGLFS_DEVICE_INTEGRATION. The value is then used as the default, preferred plugin name when QT_QPA_EGLFS_INTEGRATION is not set. In the future device makespecs are expected to set a plugin name instead of relying on the traditional EGLFS_PLATFORM_HOOKS_*. When neither the QT_QPA_EGLFS_INTEGRATION nor EGLFS_DEVICE_INTEGRATION are set, all plugins will be tried in an unspecified order. The first one that succeeds to load is used. If all fails or there are no plugins, the built-in, non-specialized integration is used. To debug what integration is being used, enable the logging category qt.qpa.egldeviceintegration. There is some built-in logic for desktop/Mesa based systems: Under X, eglfs_x11 is preferred, otherwise eglfs_kms is prioritized. This, assuming sufficient permissions to video and input devices, allows simply launching apps with -platform eglfs. No more editing of eglfs.pri. [ChangeLog][QtGui] Added support for device-specific backend plugins in eglfs. Change-Id: Ia2ddcddac014c25817171dc140cd8cf913784ac6 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | EGLFS: Add support for multiple displaysLouai Al-Khanji2014-10-101-16/+8
| | | | | | | | | | Change-Id: Id039e0ed2d99562eb2a5cfe1e7b34013c75ff3ac Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | eglfs: Add support for systems without pbuffer supportLaszlo Agocs2014-10-101-3/+10
| | | | | | | | | | | | | | | | | | Use a small native window and window surface in case the hooks indicate that pbuffer support is not available. Change-Id: I6515309041f0e1e2f5321d59941f35d6ee16dca7 Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | EGLFS: Fix plugin destruction (again)Louai Al-Khanji2014-10-031-0/+1
| | | | | | | | | | | | | | | | | | The previous patch was flawed since by the time the QEglPlatformIntegration destructor was called the virtual function table did not point to the methods in QEglFsPlatformIntegration any more. Change-Id: I310e5e3e734a22b44645ba912b579f193bcfae86 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | EGLFS: Fix plugin destructionLouai Al-Khanji2014-10-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The proper init/destruction order is as follows: QEglFsHooks::platformInit() eglInitialize() eglTerminate() QEglFsHooks::platformDestroy() Prior to this patch platformDestroy() was called before eglTerminate(), leading to a crash on some platforms. Additionally we need to destroy the native windows before deleting the screen, otherwise the QEglFSWindow destructor ends up calling into the deallocated screen. Change-Id: Id08ccbac9bb44a778bcf1a55f73c0057e0a7b3af Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-19/+11
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | eglfs: use qEnvironmentVariableIntValue()Marc Mutz2014-09-121-1/+1
|/ | | | | | | | It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: I4c43809954ed720de95b3056c13bf520577e3280 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* eglfs: Fix regression in config selectionLaszlo Agocs2014-09-031-5/+4
| | | | | | | | | | During the introduction of context adoption support the config choosing got broken for context creation, at least for hooks that return a customized format in surfaceFormatFor(). The returned format is the one that needs to be passed to chooseConfig(), not the original. Change-Id: Iae203cbbf7b39c462386611dd3744f048116df13 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Support adopting an existing EGLContext in eglfs and xcbLaszlo Agocs2014-05-091-2/+14
| | | | | | | | | | | Add also a manual test application. For GLX there is an autotest since that is likely to be run on one of the CIs. For EGL and especially eglfs this is likely not the case so a manual test is better. Task-number: QTBUG-37552 Change-Id: Ib09db5d909befb68d16f69abd401a56abe55f28a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* QOpenGLWidget and new-style compositing on eglfsLaszlo Agocs2014-02-131-11/+14
| | | | | | | | | Integrate with QOpenGLTextureBlitter, QOpenGLWidget and friends. Change-Id: Ic2867b713a21a3d2820d546174fc9164b3dd220c Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* eglfs: Mouse hotplugging supportLaszlo Agocs2014-01-311-17/+1
| | | | | | | | | | | | | | On Embedded Linux with libudev support hotplugging was already working, except that the mouse cursor was not shown and hidden. This is now corrected so that the cursor disappears when all mice become disconnected and reappears if a mouse gets plugged in later on. [ChangeLog][QtGui] Mouse hotplugging is now fully supported in eglfs when running on Embedded Linux systems with libudev support enabled. Task-number: QTBUG-36374 Change-Id: Iec7c1557ba6085e3958dd357460cc032896fb174 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* eglfs: Move reusable functionality to eglconvenienceLaszlo Agocs2014-01-171-174/+15
| | | | | | | | | | | | | | | | | | | | | | | | The cursor implementation is generic GL(ES) code that should be shared by all the present and future egl-based embedded platform plugins. Follow the pattern of QEGLPlatformContext and move this class into eglconvenience as QEGLPlatformCursor. Similarly, the common bits from the context implementation context are moved back to EGLPlatformContext. eglconvenience has now base classes for integration, screen, window, etc. too. By using these, eglfs becomes much smaller and cleaner. This also paves the way for creating new, separate EGL-based platform plugins for Android, embedded Linux, etc. Also added some documentation to each of the base classes. devicediscovery is now fixed to be usable on any platform. The implementation in this case is naturally a dummy one. This finally allows using it from anywhere without myriads of ugly ifdefs. Change-Id: I02946e360c04e02de7fe234a23a08320eff4ccf5 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Disable the eglfs input handlers by Environment variableDominik Holland2013-12-101-1/+4
| | | | | | | | | | | Added a Enironment variable to make it possible to disable the automatic installation of EVDEV input handlers. This is needed if you want to use your own generic plugin instead, which also uses evdev Change-Id: I17d47008c10999bf918db62a22a3b6a38d7abb80 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Add missing Q_INIT_RESOURCETor Arne Vestbø2013-11-071-0/+6
| | | | | | | | | | | The library needs to do Q_INIT_RESOURCE for all resources it uses internally, otherwise static linking will fail, and the user has no idea how to rectify it as the name of the missing resource is not known. The Q_INIT_RESOURCE needs to happen outside of any namespace, hence the use of static initResources() functions. Change-Id: I8f7d36b440b05809d97dd489cf8789f345633cec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Differ between ShowMaximized and ShowFullScreenEskil Abrahamsen Blomfeldt2013-11-011-1/+6
| | | | | | | | | | | | The default is now ShowMaximized which behaves as it did before, i.e. each window will fill the screen but the status bar will be visible. Calling showFullScreen() explicitly will now hide the status bar to maximize the amount of screen real estate occupied by the application. Task-number: QTBUG-33135 Change-Id: If0d0a2ab72f8026e76818290e2b953dbc0dec156 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* eglfs: Perform initialization in initialize() instead of the constructorLaszlo Agocs2013-10-251-22/+25
| | | | | | | | | | Move (almost) everything to initialize(). Doing so allows the QEglFSScreen constructor, the hooks' platformInit() and others to perform tasks that need the event dispatcher. Task-number: QTBUG-34208 Change-Id: If64e3d1691c41752c53968f8d4fb063b45345680 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* eglfs: Separate compositor and improve raster window supportLaszlo Agocs2013-10-091-13/+14
| | | | | | | | | | | Separating the compositor into a separate source file improves the chances of possible future reuse and paves the way to supporting multiple GL windows. Tooltips are now working too. Implemented a few window functions like raise() and lower(). Fixed the qFatal for multiple GL windows to be raised in non-SDK based Android builds too. Change-Id: Id94d2fb2a4382766f3d130eebe1e6f397a535852 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QPA: Fix event dispatcher dependent operations in platform integrationLaszlo Agocs2013-10-071-8/+16
| | | | | | | | | | | | | | | | | | 999e5162ec3e86c9cb84c3ec95dfd0ba4b21277f breaks QPlatformIntegration implementations that perform tasks in their constructor that rely on the event dispatcher. For example creating a QSocketNotifier is not possible anymore since the event dispatcher is created later on. This is fixed by introducing an additional virtual in QPlatformIntegration that gets called after createEventDispatcher(). Two broken platform plugins have been identified so far: eglfs is creating socket notifiers to read events from input devices and xcb's input context plugins may use dbus. Both are updated accordingly. Task-number: QTBUG-33768 Change-Id: I5badb623958a52ab5314ff93dd7d60061f5df70a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* QPA: Fix semantics of GUI event dispatcher ownership in platform pluginsTor Arne Vestbø2013-09-301-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The QPlatformIntegration::guiThreadEventDispatcher() function acted as an accessor to event dispatchers created in the constructor of each platform plugin, but the logic and semantics of event-dispatcher handling in Qt itself (QCoreApplication/QGuiApplication) still assumed both ownership and control over the event dispatcher, such as when to create one, which one to create, and when to delete it. This conflicted with the explicit calls in the platform plugins to QGuiApplication::setEventDispatcher(), as well as left a possibility that the event-dispatcher created by the platform plugin would never be deleted, as none of the platform plugins actually took full ownership of the dispatcher and deleted it in its destructor. The integration function has now been renamed back to its old name, createEventDispatcher(), and acts as a factory function, leaving the logic and lifetime of event dispatcher to QtCoreApplication. The only platform left with creating the event-dispatcher in the constructor is QNX, where other parts of the platform relies on having an event-dispatcher before their initialization. We then need to manually take care of the ownership transfer, so that the event-dispatcher is still destroyed at some point. Change-Id: I113db97d2545ebda39ebdefa865e488d2ce9368b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* eglfs: Unify the native resource gettersLaszlo Agocs2013-09-211-18/+52
| | | | | | | | | Similarly to how it's done in xcb. And add support for eglwindow since the WId will soon once again cease to be an EGLNativeWindowType. Change-Id: I0e3b86a21179439821550c9423f0e747ccae5897 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Add a WindowManagement capability to QPlatformIntegrationLaszlo Agocs2013-09-201-0/+1
| | | | | | | | | | | | | To be set to false by eglfs and similar platforms where no real window management is provided. When this capability is not set, some of the changes done for QTBUG-26903 will be disabled, allowing dialogs to show up at their QDialog-chosen place on platforms where no WM is present and so windows are never repositioned by the system. Change-Id: If1dac3cd11f2a856913a51277431fe3ec644b719 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* eglfs: Support multiple raster windowsLaszlo Agocs2013-09-201-7/+18
| | | | | | | | | | | | | | | | | | | | | Allow widget apps with popups and multiple top-level widgets to function on the eglfs platform. GL and Quick2 apps are not affected. Instead of trying to create a native window and EGL surface for each window, do it only for the window that is created first. This first window is forced to fullscreen as usual. Later windows however are treated differently: These will not have a native window, surface or context, and keep their normal size. All the textures belonging to the raster windows are then rendered in one step, using a stacking order maintained based on visibility changes and window activation. Note that this will only help apps that create a main window first and have everything else inside that window or on top of it as menus, dialogs, popups, etc. Change-Id: Ia435458ba81bf3c35cc8f61bcb2d2a50cf17f0e3 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* eglfs: Set swap interval only when there is a context availableLaszlo Agocs2013-09-131-10/+0
| | | | | | | Mesa does not like eglSwapInterval calls without a current context. Change-Id: I7ec2d4311586cf74da0461bc951a0e5d9399c35b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>