summaryrefslogtreecommitdiff
path: root/src/client/qwaylanddisplay.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-08-28Merge remote-tracking branch 'origin/5.5' into 5.6v5.5.90+alpha1upstreamLiang Qi1-10/+4
Conflicts: src/client/qwaylandwindow.cpp Change-Id: I80ead87f3e1f36299b1bf9cc9c7db6cd48c0e86f
2015-07-22Use standard wl_subsurface interface to set a window as a child of another oneGiulio Camuffo1-3/+12
Change-Id: I52628f87dbea5383db06468f9748a9bacdec3179 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-07-06Fix possible race condition leading to a dead lockGiulio Camuffo1-10/+4
It is a bit dangerous to call wl_display_dispatch() in the event thread, since it may race with the dispatch called e.g. in QWaylandDisplay's blockingReadEvents() and lead to a dead lock. Instead, use wl_display_prepare_read() and wl_display_read_events() in the event thread, which doesn't block, and only dispatch in QWaylandDisplay. As a result we don't need the additional wayland queue anymore, so remove it. Change-Id: I9fbbe5d2f38d06773beb7847df1a0212cca92c37 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-06-29Merge remote-tracking branch 'origin/5.5' into devLiang Qi1-0/+3
Conflicts: .qmake.conf Change-Id: Ic75157b11eee188608c3ac7ed6fb1a033bb72750
2015-06-12Fix input devices leak in clientOlivier Blin1-0/+3
Change-Id: I28200698706168308e450b2cd3cfa99df517f9b7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-03Merge remote-tracking branch 'origin/5.5' into devLiang Qi1-0/+6
Conflicts: src/compositor/wayland_wrapper/qwloutput.cpp Change-Id: I05f7431aca46760f90632dfa7ef9c4d0abf392ec
2015-05-28Fix crash when the wl_shm global comes after a wl_output oneGiulio Camuffo1-0/+1
Task-number: QTBUG-44503 Change-Id: I6932df57bb4560b6dceb72a5cb7c536cd090e92a Reviewed-by: Martin Gräßlin <mgraesslin@kde.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-05-07Track last input window with a QPointer in case it is destroyedArnaud Vrac1-0/+5
Change-Id: I61d7aa4b6a37922eb3beefd983154ee267cae0ef Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-05-06Remove output extensionPier Luigi Fiorini1-6/+0
This protocol is empty now and is no longer used. Change-Id: I45e79fb86a67b4cebdc307170218fa039b2aa27f Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-02-20Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn1-2/+9
Change-Id: I03fd08fc0576ffac813f64905c23de4d65e67433
2015-02-17Update copyright headersJani Heikkinen1-22/+14
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. Change-Id: I5a74d32515c3f1fe7aa1916f4241c92832510f8c Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
2015-02-17Fix buildGiulio Camuffo1-0/+2
Change-Id: I790e9bfbcffc7458e2a46f2da32dcbde0c6bffe8 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-02-17Run eventDispatcher in QWaylandDisplay::forceRoundTripMartin Gräßlin1-2/+9
If the application uses QCoreApplication::setEventDispatcher before the QGuiApplication is created the blocking roundtrip might block the application indefinitely. This can happen if the application starts a Wayland server in the same process before the QGuiApplication is created. And the QtWayland plugin connects to this server. In this case a roundtrip blocks as the Wayland server cannot process the events the QWaylandDisplay is waiting for. By running the event dispatcher manually and using the pending variant for dispatching the Wayland event queue, the application can be kept alive. Change-Id: I9c36fccbae8921e1ae9a0a8b7f460520b1b65d5c Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-02-16Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn1-0/+8
Conflicts: src/client/qwaylanddataoffer.cpp src/client/qwaylanddisplay.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandwindow.cpp src/compositor/compositor_api/qwaylandsurfaceitem.cpp Change-Id: I2eae0fd43a71fbfd7c907ca715707a26f3c134c5
2015-02-13Sanitize popup behavior.Laszlo Agocs1-0/+10
Popups are pretty important for widget apps. Menus, combobox dropdows and such are all popups. Currently they are completely borked when activated via keyboard or touch. This is because of the bizarre set_popup request in the protocol, and Weston's current implementation, that ignore the fact that a popup can be opened as a result of a keyboard event too or may not originate from an input event at all. Pass the last input device and serial we have seen, regardless of the type, by tracking it globally in the QWaylandDisplay. With this patch menus and such will not freeze the application anymore when activated with keyboard or touch without sending a mouse event to the window first. The behavior is still broken in some ways, especially with keyboard due to immediately getting a popup_done, but at least applications remain usable. Task-number: QTBUG-41142 Task-number: QTBUG-41147 Change-Id: I18de501004ae8a62ff8667e72225d08c2d3ba491 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-01-29Namespace the platform pluginsGiulio Camuffo1-0/+4
There currently is a QWaylandInputDevice class both in the wayland QPA plugin and in the QtCompositor API. This causes the qwindow-compositor example to crash when running nested in a wayland session due to a mismatch between the two classes. By namespacing all the plugin code we make sure that name clashes will not happen anymore. Change-Id: I17497cff697599200bea68bf01dfde474526390f Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-29Make use of the new QPlatformIntegration::destroyScreenGiulio Camuffo1-2/+4
Task-number: QTBUG-41141 Change-Id: I0bd789cc1090f7e0e7615b47c33a4e4179677398 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-11-15Merge branch '5.4' into devGiulio Camuffo1-7/+18
Merge done by Giulio Camuffo Conflicts: src/client/client.pro src/client/qwaylanddisplay.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandinputdevice_p.h src/client/qwaylandwindow.cpp src/compositor/compositor_api/qwaylandsurface.cpp src/compositor/compositor_api/qwaylandsurface_p.h src/compositor/wayland_wrapper/qwlsurface.cpp Change-Id: I1df878bb54f49d953c51215a2772869e261ebe81
2014-10-13Be compatible with older compositorsGiulio Camuffo1-3/+4
When binding globals take care of the version the compositor provides and don't call requests that the compositor doesn't implement. Change-Id: Iea0c534fb9e005720857e2778e380b6a9c22a6f3 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-10-06Allow client side input device customizationMikko Levonmaa1-1/+1
Introduces QWaylandInputDeviceIntegration plugins to allow customization of input device related behavior. The plugin can be activated via the environment variable QT_WAYLAND_INPUTDEVICE_INTEGRATION Change-Id: If5629737752afacb29161f51c1b7c6e171fb2758 Reviewed-by: Mikko Levonmaa <mikko.levonmaa@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2014-10-02Call ::exit() from the gui thread onlyv5.3.99+beta1Giulio Camuffo1-4/+14
::exit() is not thread safe, so make sure to not call it more than one time, once from the gui thread and once from the wayland event thread. Change-Id: I80905c6d996cb827a5101ae6d6c9bc12a267ba71 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-09-19Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn1-19/+40
Conflicts: src/compositor/wayland_wrapper/qwlcompositor.cpp Change-Id: Ica26e33eb2b77ed5be0e84e8f4256d2e85abfaf5
2014-09-06Fix window decorations for GL appsLaszlo Agocs1-0/+13
You cannot have rounded corners with an alpha-less config. To make OpenGL applications appearing with the correct decoration, alpha must be enabled. With this fix the OpenGL apps' decoration will now look identical to the SHM apps'. Change-Id: I24431ddab63146f7f697c85277f00f41e5c55e85 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-09-06Advertise new screens created after startupGiulio Camuffo1-1/+3
Change-Id: I995f49e52ec888830b478f1e1f9cc82132776725 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-04Destroy the QScreen when its wl_output is removedGiulio Camuffo1-1/+11
Change-Id: I4532d05cca44c88fe38c14eacbe90c190f272b2c Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-23Explicitly define the interface versionsGiulio Camuffo1-6/+6
Currently a global is bound with the version the interface has in the xml file. This is a problem for apps that explicitly link to libwayland-client because they may link to a newer libwayland, so the version of some interface may be higher than the one that it is actually implemented. Change-Id: Id0dbe6c0f1e05fe91954b9d8d9472d42d2053cdc Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-19QWaylandDisplay: Centralize error handling in one place.Robin Burchell1-20/+4
Change-Id: Ifba23e349a4006cea501480a7230408f0fafd1b7 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2014-08-19QWaylandDisplay: Correctly intercept all errors when dispatching.Robin Burchell1-4/+17
A connection reset isn't the only form of error we may run into, so make sure we check for other exceptional circumstances through wl_display_get_error. This fixes my case of e.g. wl_drm throwing an error but QtWayland never quitting the client. Change-Id: I8c76dd7913640e58d03bd2fe52eb054a4daa0235 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2014-08-18QWaylandDisplay: Destroy screens when destroying the display.Robin Burchell1-0/+2
Fixes a crash in tst_QApplication. Change-Id: Ibfc7aded10609cff9c7a20b7193f44d1c73bc893 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-18QWaylandDisplay: Remove unused static.Robin Burchell1-3/+0
Change-Id: I868168dee716103962217b5ceb38185090f82e09 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2014-08-13Add support for setMask to set input regionJan Arne Petersen1-0/+10
Also fix input region handling in compositor. Change-Id: If88ad6a03443526eddee045d7af54daf5057373a Done-with: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2014-08-07Add a way to have out of source shell integrationsGiulio Camuffo1-0/+17
Some platforms (especially non-desktop ones) may use a custom Wayland shell extension, more tailored to the form factor than the generic and desktoppy wl_shell or xdg_shell. Instead of stuffing N protocol implementations in the QPA plugin use a plugin architecture to allow them to live out of tree. When creating a shell surface the QT_WAYLAND_SHELL_INTEGRATION env variable will be checked, and if it points to a valid plugin that will be used to create the shell surface, falling back to wl_shell or xdg_shell if no plugin is specified. Change-Id: I05019174bb915199dd726f5fdcc0385ef846e8de Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Philippe Coval <rzr@gna.org> Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-05Wait to get wl_output's events before creating surfacesGiulio Camuffo1-0/+2
Change-Id: I2eb4b40a4b8b1de7990d06b57b0d7a7b04ee9657 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-04Make sure to have a hardware integration when creating windowsGiulio Camuffo1-4/+31
We need to do a full roundtrip and wait for the qt_hardware_integration global before returning from QWaylandDisplay constructor. Waiting for the screen is not enough, since there is no guarantee it will come after the hardware integration global. Change-Id: I34cb50b830632db7e5d5c7a502eeef778599b267 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-01Resolve build warning on client codePier Luigi Fiorini1-1/+1
QString::QString(const char*) is deprecated, wrap thread name with QStringLiteral. Change-Id: Ic914d05e7bee6e3f1c6aa0bede44a6b6b85be565 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2014-07-21Give a name to the event handling threadGiulio Camuffo1-0/+1
Change-Id: I5c6073bc1908e54bc5ae50d4b6b6044974f1ad60 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-06-27Delete data device manager while display is still alive.Gunnar Sletta1-0/+1
Change-Id: I7691e06d75866034c93020ebdfb45421275fcf9d Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2014-06-20xdg-shell: upgrade to support current version (weston-1.5.0)Philippe Coval1-3/+7
The protocol file is a raw copy of Source: http://cgit.freedesktop.org/wayland/weston/plain/protocol/xdg-shell.xml?id=1.5.0 Task-number: QTBUG-38633/related Change-Id: I41ca2f89c09a8b6348ce2fbf6d59f44b4c8134df Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Philippe Coval <rzr@gna.org>
2014-06-09Add minimize feature to QWindow using wayland's xdg-shellPhilippe Coval1-0/+5
The feature is disabled by default, and can be enabled at runtime by exporting QT_WAYLAND_USE_XDG_SHELL env variable. This patch relies on presence of protocol file which has been imported from weston-1.4.0 sources, until the xdg-shell is merge into wayland itself. Because xdg-shell is experimental, code fallback to WaylandShell if no XdgShell but keep in mind those shells are exclusive. Since xdg-shell and wayland-shell share most of the API, some factorization is done by an (empty) abstraction class to keep the code more readable. Despite xdg-shell introduces new popups concept, they're not used on this change for maitainance purpose. Notes: * This change depends on presence of xdg-shell protocol file. * You can check a demo video (qt-tizen-cinematic-experience-20140430-rzr) of the test case at : https://www.youtube.com/watch?v=pY_XXvKc_0E# * Use Super+Tab to show window again if hidden Task-number: QTBUG-38633/part/2of2 Change-Id: I2d7ed85bea1847d82439fdfc893a3dbb2581c14a Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2014-04-01Always bail out when the compositor is closedGiulio Camuffo1-2/+2
errno can both be EPIPE and ECONNRESET when reading from the connection after the server is closed. Change-Id: I03b64a382db3de66819277e9955aeca3e2d7f9a1 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-01-16Send the globals to new listenersLaszlo Agocs1-7/+21
Change-Id: I8d2a74cdc305fb086f3b5c63d0abe4c46c40bbde Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2013-12-27Make classes in client privateJorgen Lind1-20/+20
Change-Id: Ibf400b32f78a6a0fcf0991914d2d9ad684483979 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-12-27Use QScopedPointer in QWaylandDisplay for extensionsJorgen Lind1-11/+11
Change-Id: I783639fcefd36967f42f18417b0e07ec34b49dbb Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-12-27Add hardware integration protocolJorgen Lind1-1/+4
This sends to clients what HW integration is being used in the compositor. This is useful when the wayland clients are loading their buffer integrations with plugins since they then can pick the correct plugin automatically. Change-Id: Ib4eac3b855c6772ac1581b7f06aa929aeb1a1db0 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-12-27Fix compiler warningsJorgen Lind1-1/+1
Change-Id: I499c50c901bff1c496b05b628f8155376b5af267 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-12-27Remove compiler warnings in client.Jorgen Lind1-11/+11
Change-Id: Iedd2e53aa8d6c8d09272175e402e64bdb40acb36 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-12-27Rename QWaylandGLIntegration to QWaylandClientBufferIntegrationJorgen Lind1-3/+3
also add a factory to load QWaylandClientBufferIntegrationPlugins Change-Id: Ia6a03627659b0452439ae664fceef21eaf0f6de0 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-12-27Move to new hardware structure for the platform pluginsJorgen Lind1-24/+8
Change-Id: I0d383e4cdd59c4e4eae5506c814f0c80ecbf58ae Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-12-27Move wayland into a client directory not under the plugins src folderJorgen Lind1-0/+272
And make wayland common files into a library, exporting all classes. Now there is no need to do bulild hacks to make your own version of the wayland plugin. Change-Id: Ib4872863dfb5ab3f2bc0f4a94ae16fc1e7b63b88 Reviewed-by: Andy Nichols <andy.nichols@digia.com>