summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddisplay_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Client: Remove windows from keyboard focus list when destroyedJohan Klokkhammer Helsing2016-10-241-1/+2
| | | | | | | | | | | | | This fixes the undefined behavior in tst_WaylandClient::touchDrag and mouseDrag Note: The test still fails if run twice in a row, but it appears to be deterministic. Task-number: QTBUG-56187 Change-Id: Ib45d82224f004d1324f2ce4d6b7df05ee36c04f5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 0049240a2b7d8691f09224e1542919ddbbb0d864) Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Make wl_shell and xdg_shell use the QWaylandShellIntegration interfaceJohan Klokkhammer Helsing2016-08-091-5/+1
| | | | | | | | 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-1/+0
| | | | | | | | 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>
* Use xdg_shell configure events to determine active windowJohan Klokkhammer Helsing2016-07-041-0/+13
| | | | | | | | | | | | | | | | | | | | | | 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>
* Remove unused method QWaylandDisplay::lastKeyboardFocusInputDeviceJohan Klokkhammer Helsing2016-06-291-4/+0
| | | | | Change-Id: Iee19b36ae2032112e0097dc6eb2e4592697c2a1c Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* Add support for bitmap cursorsMartin Gräßlin2016-03-171-0/+1
| | | | | | | | | | | | | | | | | So far QtWayland did not support custom bitmap/pixmap QCursors. This change adds support for them by creating a QWaylandShmBuffer and copying the pixmap data into that buffer. The internal API to set cursors images is changed to not only rely on wl_cursor_image, but also allow to just set the buffer with a specific size and a hot spot. The created WaylandShmBuffer is passed around as a shared pointer, so that it can be automatically cleaned up once the cursor image is no longer used on any seat. Task-number: QTBUG-51604 Change-Id: I1f1ee87f03186c3d564468d3e8ea2a3141d7e2fb Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>
* client: Remove the event threadGiulio Camuffo2015-11-031-2/+1
| | | | | | | | | | | | | | | | | 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>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-051-0/+11
| | | | | Change-Id: I70c01453b3939d1d645d626ae84c21ab4c9d267a Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6v5.6.0-alpha1Liang Qi2015-08-281-2/+0
|\ | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow.cpp Change-Id: I80ead87f3e1f36299b1bf9cc9c7db6cd48c0e86f
| * Fix possible race condition leading to a dead lockGiulio Camuffo2015-07-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Use standard wl_subsurface interface to set a window as a child of another oneGiulio Camuffo2015-07-221-2/+2
| | | | | | | | | | Change-Id: I52628f87dbea5383db06468f9748a9bacdec3179 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-031-2/+3
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwloutput.cpp Change-Id: I05f7431aca46760f90632dfa7ef9c4d0abf392ec
| * Track last input window with a QPointer in case it is destroyedArnaud Vrac2015-05-071-2/+3
| | | | | | | | | | Change-Id: I61d7aa4b6a37922eb3beefd983154ee267cae0ef Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Remove output extensionPier Luigi Fiorini2015-05-061-2/+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.5Liang Qi2015-04-151-1/+0
|\ | | | | | | | | | | | | | | Conflicts: src/client/qwaylandshmbackingstore.cpp src/client/qwaylandwindow.cpp Change-Id: I795fd08f0fc5d3cb5ed55bf16e724f66b7567723
| * Drop unused mScreensInitialized variable in QWaylandDisplayOlivier Blin2015-03-291-1/+0
| | | | | | | | | | | | | | | | | | Unused since commit 78a701272e68d4f0ab95df4062374b8d34ef2919: Made wayland plugin single-threaded, yay :) Change-Id: I1fae78d77179feaac79f5dba6dcad8084e3e97fa Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> 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>
* | 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/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch '5.4' into devGiulio Camuffo2014-11-151-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+2
| | | | | | | | | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | | | ::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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-09-191-2/+4
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwlcompositor.cpp Change-Id: Ica26e33eb2b77ed5be0e84e8f4256d2e85abfaf5
| * Fix window decorations for GL appsLaszlo Agocs2014-09-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Destroy the QScreen when its wl_output is removedGiulio Camuffo2014-09-041-2/+2
| | | | | | | | | | | | Change-Id: I4532d05cca44c88fe38c14eacbe90c190f272b2c Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Add support for setMask to set input regionJan Arne Petersen2014-08-131-0/+1
|/ | | | | | | | 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/+3
| | | | | | | | | | | | | | | | | | 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>
* xdg-shell: upgrade to support current version (weston-1.5.0)Philippe Coval2014-06-201-2/+3
| | | | | | | | | | | 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>
* Add minimize feature to QWindow using wayland's xdg-shellPhilippe Coval2014-06-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Send the globals to new listenersLaszlo Agocs2014-01-161-1/+11
| | | | | Change-Id: I8d2a74cdc305fb086f3b5c63d0abe4c46c40bbde Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Make classes in client privateJorgen Lind2013-12-271-0/+192
Change-Id: Ibf400b32f78a6a0fcf0991914d2d9ad684483979 Reviewed-by: Andy Nichols <andy.nichols@digia.com>