summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandcompositor.h
Commit message (Collapse)AuthorAgeFilesLines
* Add API to grab a surface's contentGiulio Camuffo2016-04-181-0/+4
| | | | | | | | This patch adds a new QWaylandSurfaceGrabber class. The user can use it to grab a surface's content, and get a QImage with the data. Change-Id: I25dd72a8ba39201cd91addbfc976b93ca1e05112 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Initial compositor support for xdg-shell wayland extensionJohan Klokkhammer Helsing2016-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xdg-shell is an extension to the wayland protocol providing functionality suited towards traditional desktop environments. Most of the examples from Weston now require xdg-shell, ivi-shell or some other custom extension. In order for our compositor-api to support those examples and many real-world applications, we needed a compositor implementation of xdg-shell. This commit adds a class QWaylandXdgShell, along with QWaylandXdgSurface and QWaylandXdgPopup. These clases are used almost exactly like the corresponding QWaylandShell* variants. qwindow-compositor has been updated to use the new functionality. qwindow-compositor now only sets focus on surfaces that have a role. weston-terminal was crashing because we set keyboard focus on the cursor surface. Keyboard focus handling has been slightly changed. Most of the functionality has been moved from QWaylandKeyboard::setFocus to QWaylandInputDevice::setKeyboardFocus. This is done in order to track where the keyboard focus should have been, in case the input device (seat) does not currently have a keyboard capability. If a keyboard capability is later set on the input device, its focus will automatically be set to the value stored in QWaylandInputDevice. The reason for the change in keyboard focus handling is that we need to know if an xdgSurface has keyboard focus in order to know whether to send the Activated state in configure events. The Activated state tells the client to draw itself as having focus (i.e. title bar not grayed out). Change-Id: I1b1ca9a4223e87f5ade1e0f4c975979a400c38cb Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Use WaylandCompositor module name for export macroPaul Olav Tvete2016-02-151-1/+1
| | | | | | | Change-Id: Ieb65b66f28986845f50647ae338678f0a1e7a153 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>
* Subsurface implementation, with C++ APIPaul Olav Tvete2016-02-041-0/+1
| | | | | | | | | This adds support for subsurfaces to QWaylandCompositor and QWaylandSurface. Task-number: QTBUG-49809 Change-Id: I2fa9ee4dcd1f48a2a28dab536f9cd6edc716e42b Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
* Rename QWaylandExtensionContainer to QWaylandObjectPaul Olav Tvete2015-10-231-1/+1
| | | | | | | | | | Change the name, and make QWaylandExtension a subclass of QWaylandObject. This way, all extensions can have extensions of their own, without multiply inheriting. Change-Id: Ie06e764412d113f7a62399caa605a48b015c7d24 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Add a setDefaultOutput function to QWaylandCompositorJørgen Lind2015-09-181-1/+2
| | | | | | | | | Have to remove the assert in QWaylandCompositorPrivate::addOutput since setDefault output can also add outputs now, and it might be called by both Change-Id: Ic2a321fde37917427dfb68b38dd3e6af2ed20368 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Simplify the construction of pure-qmlJørgen Lind2015-09-181-1/+2
| | | | | | | | | Make it possible that an WaylandOutput item is declared as a child of a WaylandCompositor item. This is mostly usefull for examples, since output handling will likely be event driven in a propper compositor Change-Id: I3238b079e41a49f69cbd9255818588674b364fb2 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Remove the QWaylandOutputSpaceJørgen Lind2015-09-181-10/+2
| | | | | | | | We don't need this abstraction anymore since we don't have global coordinates in the core api anymore Change-Id: I553a736a0e71026447d6a0af3f8a64607b8c8f06 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* New API for drag and dropPaul Olav Tvete2015-09-171-7/+0
| | | | | | | Let the compositor implementation keep all the GUI state. Change-Id: I73a865fa3407340276d6765e10378b8e23a76fe2 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Remove QWaylandCompositor::cleanupGraphicsResources()Jørgen Lind2015-09-151-1/+0
| | | | | | | | it is not needed anymore since the QWaylandView holds a reference to the buffer and the QWaylandQuickItem owns the texture Change-Id: I0a4da028cf1cecf4b0710b96737dfc1035e5f1f9 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Rename QtCompositor to QtWaylandCompositorJørgen Lind2015-09-101-3/+3
| | | | | | | enable building QtWaylandCompositor by default Change-Id: I7cf34052b304ca9fef55b7e30ef6a6367b5d75f1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Move the createDefaultSurface function to QWaylandCompositorPrivateJørgen Lind2015-09-101-4/+1
| | | | | | | | | | Its really not meant to be reimplemented by other classes than QWaylandCompositor or QWaylandQuickCompositor because of the createSurface signal. If someone really wants to use the virtual function then they can subclass the private Change-Id: Iad88fde3fc999ac18bdc57bd37864884865a962a Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Make it possible to connect to a createSurface signalJørgen Lind2015-09-041-1/+4
| | | | | | | | | | | | Remove the QWaylandSurface factory function from QWaylandCompositor. Add a default constructor to QWaylandSurface and a initialize function. Add som housekeeping code in debug builds that ensures the user calls initialize. Add a fallback factory function on the compositor if the user is fine with getting the default implementation of QWaylandSurface or QWaylandQuickSurface Change-Id: Ib9289c323b6723f0d1119a484cf9e0c26c95b549
* Rename primary(Output|OutputSpace) to default(Output|OutputSpace)Jørgen Lind2015-09-041-7/+8
| | | | Change-Id: I0bbe6dd6bd8e9f6972cc88b832029ac98aa2af49
* Make it possible to construct QWaylandOutputJørgen Lind2015-09-041-4/+3
| | | | | | | | | | | | | | | This requires QWaylandOutput to be initialized. This will happend when the QWaylandCompositor of the QWaylandOutputSpace that is set on the QWaylandOutput is created. QWaylandCompositor will send or post a Polish event to the QWaylandOutput which again will call QWaylandOutput::initialize. This function will create the global that will be put on the wl_displays registry This makes it possible to Create WaylandOutputs in QML (see the pure-qml example) and also gives a better programming model in C++ Change-Id: Iaf907ae18a283678eda6d04390dc9790ae0bced8
* Move the curser surface signal to QWaylandInputDeviceJørgen Lind2015-09-041-2/+1
| | | | Change-Id: Ib2b1ee81a5216e348e6014927c1cc818f848384b
* Make Manufacturer & Model modifiable properties of QWaylandOutputJørgen Lind2015-09-021-3/+1
| | | | | | This to make construction look nicer and make them modifyable from QML Change-Id: I5f5ffffb34f664914cdb531736c42a6873bfe18c
* Enable the HW integration extension by default againJørgen Lind2015-08-311-0/+4
| | | | Change-Id: I8b0f5bd6e8ec179ab3de87228fa7569870778a8f
* Remove automatic initialisation of extensionsJørgen Lind2015-08-281-19/+0
| | | | | | | | | | It is the specific compositor application responsibillity to create the specific extensions. Some of the extensions are picked up with the QWaylandExtension::findIn(QWaylandExtensionContainer *) function to work around missing events/apis. It should be a goal not to have these calles in the base implementation of QWayland[Compositor|Surface|Input..]. Change-Id: Iacd576f2e8a79ca0165b858b1e8f44cddad48d93
* Remove QtWayland::Compositor and add QWaylandCompositorPrivateJørgen Lind2015-08-281-15/+8
| | | | | | Embrace PIMPL Change-Id: I8c8b5971e15c208317ff33231bda1513e7b8d489
* Move some virtual functions into protected scoping.Jørgen Lind2015-08-281-4/+4
| | | | | | | Users should not call these functions, but they should be able to sub-class QWaylandCompositor to reimplement them Change-Id: I35888fec67bec085820733135f201bab1df268a3
* Remove QtWayland::SurfaceJørgen Lind2015-08-281-0/+1
| | | | | | | | Its enough to have QWaylandSurface and QWaylandSurfacePrivate. Also don't pass QWaylandSurfacePrivate around, but pass QWaylandSurface and then use the QWaylandSurfacePrivate::get function. Change-Id: I915cc9d7b4497ad1c6f1f2dee61d9d0db069ba6b
* Remove some deprecated apisJørgen Lind2015-08-281-14/+0
| | | | Change-Id: I6a0f68fa6c8fb79cd81daf1315c2b3b041a25de2
* Remove the default shell functionalityJørgen Lind2015-08-281-1/+0
| | | | | | | | This will be readded in a different way. Also, remove the WaylandSurfaceChrome since it is no longer needed, and just use WaylandView directly Change-Id: I8d4a7b2135d9fdaea7dd3fcd729e55cceebf48fb
* Remove the QWaylandCompositor::createView virtual functionJørgen Lind2015-08-281-1/+0
| | | | | | | | | Views are just a representation of the QWaylandSurface, and many different types of view "sub-classes" will exist depending on its perticular use. Dont enforce just one view implementation for one compositor. Change-Id: Ie237a73e63638e70713f89b479fb1b248426c9ac
* Fix Compile errors and warningsPaul Olav Tvete2015-08-281-1/+1
| | | | Change-Id: I2caba2c9de7823214f20529437453c3df02b7b37
* Rename QWaylandSurfaceView to QWaylandViewJørgen Lind2015-08-281-3/+3
| | | | | | and rename QWaylandSurfaceItem to QWaylandQuickView Change-Id: I989b482eb79df06e9f265bc2b0ef6b3dce7509d6
* Make it possible to subclass QWayland(Pointer|Keyboard|Touch)Jørgen Lind2015-08-281-3/+4
| | | | | | | by having factory functions on QWaylandCompositor and use them from QWaylandInputDevicePrivate Change-Id: Id5e0413ca1fb40e2f7eba571dda361b2809fe313
* Use Q_SIGNALS and Q_SLOTS instead of signals: slots:Jørgen Lind2015-08-281-1/+1
| | | | | | in the compositor apis Change-Id: I0b90843647cbea3e3db22386bfba769db5602d86
* Public input apisJørgen Lind2015-08-281-3/+9
| | | | Change-Id: I60ec2fd9f4afe54198d9c476b28f9f15a661e9ca
* Rework how we manage extensionsJørgen Lind2015-08-281-13/+3
| | | | Change-Id: If2cbf096e7419bc1bda007d5167ce39d1a5d50ae
* Introducing QWaylandOutputSpaceJørgen Lind2015-08-281-18/+15
| | | | | | | | | | Its purpose is to make it possible to have multiscreen environments, and also multiple multioutput environments It is also an abstraction to make it clear that outputs are arranged in a 2d space Change-Id: I418509996a03b2ca1a12aec9c9e25e143a15a10f
* Move the output from QWaylandSurface to the QWaylandSurfaceViewJørgen Lind2015-08-281-1/+4
| | | | | | | | | and add a property called primaryOutput on the QWaylandSurface. Also add some bookkeeping in QtWayland::Output so it knows what surfaces and views it currently holds, sending the enter and leave events automatically. Change-Id: Ib6efbc6f8157657fb4451b751bba1cb5345b7906
* Make it possible to set a QWaylandSurface on the QWaylandSurfaceViewJørgen Lind2015-08-281-1/+2
| | | | | | This will allow us to use QWaylandSurfaceItem from within QML Change-Id: I6ecfbf3a5de5f5a748a6a85295b9741316fef976
* Deprecate the cursor change request and make it a signalJørgen Lind2015-08-281-1/+5
| | | | Change-Id: Icafab695071259e2112e9742ba46a19c1dc74586
* QWaylandCompositor make some functionality available from qmlJørgen Lind2015-08-281-6/+7
| | | | Change-Id: Idb84b75da2374ecd8c72e14857018d4965f0a927
* Make QWaylandCompositor::primaryOutput a Q_PROPERTYJørgen Lind2015-08-281-0/+3
| | | | Change-Id: I2a5c9556549fa3dbc4ad8b399a32266acbcc712b
* Make QWaylandCompositor inherit QObjectJørgen Lind2015-08-281-8/+21
| | | | | | | | | | | | | | | | | And remove the constructor arguments, and just having parent as a constructor argument. This requires QWaylandCompositor to have a create semantic familiar from QWindow and QOpenGLContext. On create the native wayland socket is created and initialized. Also the virtual functions surfaceCreated and surfaceAboutToBeDestroyed have been converted to signals, removing the need to subclass QWaylandCompositor Examples have been changed to avoid having two super classes inheriting QObject. This is done by either making the QWindow subclass a member or making the QWaylandCompositor a member. Change-Id: I317d37e2adca15bfe4e1904e20ab0d83943b2d45
* Add createSurface factory function on QWaylandCompositorJørgen Lind2015-08-281-1/+1
| | | | | | This simplifies subclassing the compositor getting Change-Id: I392b84febae62df042b23fa806360bc068bf984f
* Move surface management to outputsJørgen Lind2015-08-281-5/+7
| | | | Change-Id: I427e576a4e0834d6266af2670f7ff47e078153d4
* LGPL v3 license change for Qt Wayland CompositorJørgen Lind2015-07-241-27/+23
| | | | Change-Id: I84ed248b471464214d935352768f300d4b90dec3
* Remove output extensionPier Luigi Fiorini2015-05-061-9/+8
| | | | | | | This protocol is empty now and is no longer used. Change-Id: I45e79fb86a67b4cebdc307170218fa039b2aa27f Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Update copyright headersJani Heikkinen2015-02-171-4/+4
| | | | | | | | | 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>
* Add QWaylandOutput to support multiple outputsPier Luigi Fiorini2015-02-081-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a new QWaylandOutput class to support multiple outputs. Each QWaylandOutput need a window for rendering. Rename OutputGlobal to Output and Output to OutputResource. Add support for physical size, mode and available geometry. Use better defaults for geometry and refreshRate from the QWindow if available. A window is no longer passed to QWaylandCompositor constructor and all output related methods are removed, however one or more outputs are required for hardware integration. QWaylandCompositor returns a list of outputs and offers an API to add or remove outputs. Hardware integrations can run headless. Change-Id: I742996571ddb78328f7bfa4f79b25a81995279e1 Done-with: Jan Arne Petersen <jan.petersen@kdab.com> Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Support for multiple input devicesMikko Levonmaa2014-10-201-0/+4
| | | | | | | | | | | | | | | | | | Allows the registration of multiple input devices for the compositor via private APIs. Since the Qt stack does not support separate input devices via the QPA, the identification of each device (wl_seat) is left up to the implementor. The compositor will identify input event via the QWaylandInputDevice::isOwner method. Usually this will happen when an item on the UI has received an event and would like to send it to the client surface. See QWaylandSurfaceItem for more details. Includes basic unit tests Change-Id: I7ee1db49388713bf3076c23cf8f8a165aefc2fe0 Reviewed-by: Mikko Levonmaa <mikko.levonmaa@lge.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Expose surface's client to QMLPier Luigi Fiorini2014-08-171-3/+4
| | | | | | | | | | | | | | | Introduce QWaylandClient class that wraps wl_client credentials and has a method to destroy the client. Add QWaylandClient object as a QWaylandSurface property. This come in handy for example when the compositor wants to kill the process of an unresponsive surface or wants to know client credentails. WaylandClient typedef is now useless thus is replaced by QWaylandClient. Change-Id: I997ec459af0f19baef67e7420c90937b197b2e1d Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Fix namespaced buildGiulio Camuffo2014-08-071-1/+3
| | | | | Change-Id: Id73f8ddffe00359f38c634fc88b1f81ac5638653 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Add a boolean return value to QWaylandCompositor::openUrl()Vesa Halttunen2014-07-231-1/+1
| | | | | | Change-Id: I46639a306461ac38c05a0a4459b56d49d7708ab5 Reviewed-by: Vesa Halttunen Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix creation of custom shellsGiulio Camuffo2014-07-081-1/+1
| | | | | | | | | | The previous virtual method initShell() was not working because it was called from QWaylandCompositor constructor. Replace that with a mthod to create the default shell to be manually called by the compositors if they so choose. Change-Id: I35a1dc0edfaf4237ca47b532645ac0d95752311c Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Make it possible to have custom shell implementationsGiulio Camuffo2014-04-291-0/+3
| | | | | | | | | | | | | | | | Different compositors may need different shell behaviors, or even different shell protocols. A smartphone compositor, for example, may want to make wl_shell_surface::set_popup or other requests noop, because they don't make sense in the formfactor, or it may even want to not implement wl_shell_surface at all, but some smartphone_shell_surface. A compositor may define its own shell implementation by overriding QWaylandCompositor::initShell(), and creating there its interface instance. The default implementation still creates the built-in wl_shell_surface implementation. Change-Id: I143b0cd4e30e31d4051ada6e562d486d9bf1a751 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>