summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddisplay.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'qt/5.6' into 5.7Paul Olav Tvete2016-08-261-7/+10
|\ | | | | | | Change-Id: I6784a53fcc2f0f68b8e916181cb8cdef263782b8
| * Client: Fix keyboard focus logic and crashJohan Klokkhammer Helsing2016-08-261-7/+10
| | | | | | | | | | | | | | | | | | | | The previous solution did not check for nullptr before dereferencing, which caused a crash. Furthermore, it checked the new ShellSurface's shellManagesActiveState before deciding whether to unfocus the old one. Task-number: QTBUG-55526 Change-Id: I410b6200a5b7b86806f70970730045a4a25f21db Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-111-27/+12
|\| | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylanddisplay.cpp src/client/qwaylanddisplay_p.h src/client/qwaylandxdgpopup_p.h Change-Id: If86ea09971773dc6c541f07819459a90e8ab73a0
| * Make wl_shell and xdg_shell use the QWaylandShellIntegration interfaceJohan Klokkhammer Helsing2016-08-091-20/+11
| | | | | | | | | | | | | | | | This simplifies the code in QWaylandDisplay and hopefully makes it easier to implement a prioritized shell selection mechanism later. Change-Id: I2bb3a13f8acedb60a6606cb3a8b5b228095eadf9 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
| * Client: Refactor window active stateJohan Klokkhammer Helsing2016-08-081-7/+1
| | | | | | | | | | | | | | | | Let shell surface implementations decide if they manage activated state. Moves the logic out of QWaylandDisplay. Change-Id: I75c86df68a1a93f9b1d2bf378b6603215d0b0128 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-0/+69
|\| | | | | | | Change-Id: I75a8ddc0652f3c6f438ef98e940c9357450d29c6
| * Use xdg_shell configure events to determine active windowJohan Klokkhammer Helsing2016-07-041-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the xdg_shell protocol, the compositor is allowed to set multiple active windows. Qt's model, however, allows only a single active window. In order to map between the models, a list of the compositor's active windows is kept in QWaylandDisplay in the order they were activated. Hence, the front of this list will always be the most recently activated window, and it will be mapped as Qt's active window. Previously keyboard focus was used to determine the active window, this method has been disabled for xdg_shell. Functionality for delaying the call to QWindowSystemInterface::handleWindowActivated has been moved from QWaylandInputDevice::Keyboard to QWaylandDisplay so the implementations can share the workaround. Task-number: QTBUG-53702 Change-Id: I878151f9c52ed09a8d6571c6208920436c3ca8fc Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-301-11/+0
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandinputcontext_p.h src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h Change-Id: Iac517e1985e4e67d7ca00ca4c10dcda9dd9079f9
| * Remove unused method QWaylandDisplay::lastKeyboardFocusInputDeviceJohan Klokkhammer Helsing2016-06-291-11/+0
| | | | | | | | | | Change-Id: Iee19b36ae2032112e0097dc6eb2e4592697c2a1c Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* | Fix text-input support for new APIJan Arne Petersen2016-04-181-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update text input support to upstream text-input protocol v2 from wayland-protocols. Remove support for input-method protocol for now. Map text-input protocol on compositor side to the Qt input method API, this allows to use any qt platform input method on compositor side (especially qtvirtualkeyboard). Add support for qtvirtualkeyboard to pure-qml example. Implement all missing functions of the text-input protocol. Change-Id: I597451ff65454a63dff86026b6a8d1ffbe07ce02 Done-with: Zeno Endemann <zeno.endemann@kdab.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Updated license headersAntti Kokko2016-01-201-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: I76ae5d3e64f096eb3163d6163a38d68c7c1ca756 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-011-19/+23
|\| | | | | | | | | | | | | Conflicts: src/client/qwaylanddisplay_p.h Change-Id: I602b90a055d1322af369fb7b77a68583154b660f
| * client: Remove the event threadGiulio Camuffo2015-11-031-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the compositor sends events to us while the main thread is blocked the socket notifier in the events thread would keep sending out the activated() signal, but no events would actually be read until the main thread starts to run again. That causes the event thread to keep queueing new events, and so allocating memory, potentially forever. This patch fixes the issue in maybe a bit radical way, that is by removing the event thread. The socket notifier now runs in the main thread so it will block if the events are not being read. Nowadays there is no real reason to keep the event thread around, as every thread that needs to receive wayland events can dispatch them on its own, we don't need a central dispatcher thread anymore. Change-Id: Ib7885e4b038b82719d78d193f465618a72cbe6af Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-151-10/+6
|\| | | | | | | | | | | | | Conflicts: src/client/qwaylandintegration.cpp Change-Id: I29120f06d33c2d383a41cf35ca4a59f5d8548ad7
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-0/+2
| |\ | | | | | | | | | Change-Id: Ib3c5bec85a09d92e37a3af8e1c749a80cb40c056
| | * Fix a segfault when the wayland connection is brokenGiulio Camuffo2015-09-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling ::exit() the socket notifier in the events thread may still fire before the process actually exits, using objects that are being destroyed and resulting in a segfault. Stop the events thread before calling ::exit(). Change-Id: I187762da2a7efa83db1e62b0e28dfab89f478c7d Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
| * | Merge remote-tracking branch 'origin/5.5' into 5.6v5.6.0-alpha1Liang Qi2015-08-281-10/+4
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow.cpp Change-Id: I80ead87f3e1f36299b1bf9cc9c7db6cd48c0e86f
| | * Fix possible race condition leading to a dead lockGiulio Camuffo2015-07-061-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>
* | | Add QWayland::shm object to clientMikko Levonmaa2015-09-251-1/+1
|/ / | | | | | | | | | | | | | | | | | | Allows more flexibility for the client to determine additional shm formats supported by the compositor in addition to the standard types. For example YUV formats. Change-Id: Ib4a47c1d5bbeed9314d5ad5f5f8e1551c1dd71e4 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Mikko Levonmaa <mikko.levonmaa@bitfactor.fi>
* | Use standard wl_subsurface interface to set a window as a child of another oneGiulio Camuffo2015-07-221-3/+12
| | | | | | | | | | Change-Id: I52628f87dbea5383db06468f9748a9bacdec3179 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-291-0/+3
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ic75157b11eee188608c3ac7ed6fb1a033bb72750
| * Fix input devices leak in clientOlivier Blin2015-06-121-0/+3
| | | | | | | | | | Change-Id: I28200698706168308e450b2cd3cfa99df517f9b7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-031-0/+6
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwloutput.cpp Change-Id: I05f7431aca46760f90632dfa7ef9c4d0abf392ec
| * Fix crash when the wl_shm global comes after a wl_output oneGiulio Camuffo2015-05-281-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>
| * Track last input window with a QPointer in case it is destroyedArnaud Vrac2015-05-071-0/+5
| | | | | | | | | | Change-Id: I61d7aa4b6a37922eb3beefd983154ee267cae0ef Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Remove output extensionPier Luigi Fiorini2015-05-061-6/+0
|/ | | | | | | This protocol is empty now and is no longer used. Change-Id: I45e79fb86a67b4cebdc307170218fa039b2aa27f Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-201-2/+9
|\ | | | | | | Change-Id: I03fd08fc0576ffac813f64905c23de4d65e67433
| * Run eventDispatcher in QWaylandDisplay::forceRoundTripMartin Gräßlin2015-02-171-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>
* | Update copyright headersJani Heikkinen2015-02-171-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>
* | Fix buildGiulio Camuffo2015-02-171-0/+2
| | | | | | | | | | Change-Id: I790e9bfbcffc7458e2a46f2da32dcbde0c6bffe8 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-161-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
| * Sanitize popup behavior.Laszlo Agocs2015-02-131-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>
* | Namespace the platform pluginsGiulio Camuffo2015-01-291-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>
* | Make use of the new QPlatformIntegration::destroyScreenGiulio Camuffo2014-12-291-2/+4
| | | | | | | | | | | | Task-number: QTBUG-41141 Change-Id: I0bd789cc1090f7e0e7615b47c33a4e4179677398 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge branch '5.4' into devGiulio Camuffo2014-11-151-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
| * Be compatible with older compositorsGiulio Camuffo2014-10-131-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>
| * Call ::exit() from the gui thread onlyGiulio Camuffo2014-10-021-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>
* | Allow client side input device customizationMikko Levonmaa2014-10-061-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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-09-191-19/+40
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwlcompositor.cpp Change-Id: Ica26e33eb2b77ed5be0e84e8f4256d2e85abfaf5
| * Fix window decorations for GL appsLaszlo Agocs2014-09-061-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>
| * Advertise new screens created after startupGiulio Camuffo2014-09-061-1/+3
| | | | | | | | | | Change-Id: I995f49e52ec888830b478f1e1f9cc82132776725 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Destroy the QScreen when its wl_output is removedGiulio Camuffo2014-09-041-1/+11
| | | | | | | | | | | | Change-Id: I4532d05cca44c88fe38c14eacbe90c190f272b2c Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Explicitly define the interface versionsGiulio Camuffo2014-08-231-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>
| * QWaylandDisplay: Centralize error handling in one place.Robin Burchell2014-08-191-20/+4
| | | | | | | | | | Change-Id: Ifba23e349a4006cea501480a7230408f0fafd1b7 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
| * QWaylandDisplay: Correctly intercept all errors when dispatching.Robin Burchell2014-08-191-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>
| * QWaylandDisplay: Destroy screens when destroying the display.Robin Burchell2014-08-181-0/+2
| | | | | | | | | | | | | | Fixes a crash in tst_QApplication. Change-Id: Ibfc7aded10609cff9c7a20b7193f44d1c73bc893 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * QWaylandDisplay: Remove unused static.Robin Burchell2014-08-181-3/+0
| | | | | | | | | | Change-Id: I868168dee716103962217b5ceb38185090f82e09 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Add support for setMask to set input regionJan Arne Petersen2014-08-131-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>
* Add a way to have out of source shell integrationsGiulio Camuffo2014-08-071-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>
* Wait to get wl_output's events before creating surfacesGiulio Camuffo2014-08-051-0/+2
| | | | | Change-Id: I2eb4b40a4b8b1de7990d06b57b0d7a7b04ee9657 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>