summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandsurface.h
Commit message (Collapse)AuthorAgeFilesLines
* 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 missing Q_ENUMJørgen Lind2015-09-181-0/+1
| | | | | Change-Id: Ib1af1399fb7a50ae3e97432fc7d34b1bc6956428 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Implement resize/move for pure-qmlJørgen Lind2015-09-161-0/+1
| | | | | Change-Id: I7919f7715486fa2d8cfe35c08095f6c33757a515 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>
* Make it possible to connect to a createSurface signalJørgen Lind2015-09-041-2/+6
| | | | | | | | | | | | 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
* Move ref and unref from QWaylandSurface to privateJørgen Lind2015-08-281-4/+2
| | | | | | | | | There shouldn't be a need to call these functions manually, and if there is then their available in the private implementation. Also removed some relay functions in QWaylandSurface Change-Id: I18944c5f1fe87a070baf0c19f1b48aec796774d7
* Use QWaylandClient in constructor of QWaylandSurfaceJørgen Lind2015-08-281-1/+1
| | | | | | instead of struct ::wl_client * Change-Id: I606a813e84eeec8134e6ece428f42a53e1ba0189
* Remove QtWayland::SurfaceJørgen Lind2015-08-281-27/+3
| | | | | | | | 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 output from QWaylandSurfaceJørgen Lind2015-08-281-9/+3
| | | | | | | | | | | | | | | It is the views that belong to outputs. This leads to a couple of interesting cases with enter and leave events, but the implementation says you will get enter events for the first view of a surface entering an output, and for the last view being removed from an output. Also to throttle a surface, there has to be 1 surface which takes care of this. This is because if multiple views throttle, then the client might render to quick. Change-Id: If4bba380fd4d7f506fd769606cbdea4ce58b908d
* Fixups after rebasingJørgen Lind2015-08-281-35/+2
| | | | Change-Id: Ie5d8899157d77f83f2cf65f236d534b972aa4770
* Remove excess definition of QWaylandKeymapJørgen Lind2015-08-281-11/+0
| | | | | | Also remove QWaylandUnmapLock Change-Id: I0b481224fd03032603084142f36be279351f6611
* Fix Compile errors and warningsPaul Olav Tvete2015-08-281-1/+1
| | | | Change-Id: I2caba2c9de7823214f20529437453c3df02b7b37
* Rename QWaylandSurfaceView to QWaylandViewJørgen Lind2015-08-281-2/+2
| | | | | | and rename QWaylandSurfaceItem to QWaylandQuickView Change-Id: I989b482eb79df06e9f265bc2b0ef6b3dce7509d6
* Improve QWaylandExtensionJørgen Lind2015-08-281-4/+0
| | | | | | | | By using curiously recurring template pattern we can generate a getter which is very convenient, and all QWaylandExtensions should have this casting operation Change-Id: Idb5a786655f2e106cf5388b11ed71e8b6ddddec0
* Remove transient(inactive|parent|offset) from QWaylandSurfaceJørgen Lind2015-08-281-4/+0
| | | | Change-Id: I0fad382c0baa13ec72ff5e45cc1eba0bd4d5c70a
* Public input apisJørgen Lind2015-08-281-0/+4
| | | | Change-Id: I60ec2fd9f4afe54198d9c476b28f9f15a661e9ca
* Rework how we manage extensionsJørgen Lind2015-08-281-50/+2
| | | | Change-Id: If2cbf096e7419bc1bda007d5167ce39d1a5d50ae
* Introducing QWaylandOutputSpaceJørgen Lind2015-08-281-0/+2
| | | | | | | | | | 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-6/+7
| | | | | | | | | 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
* Move the texture ownership from the QWaylandSurfaceJørgen Lind2015-08-281-24/+6
| | | | | | | | | | | | | | | to the respective QWaylandSurfaceView. For all GL applications this will have no significant impact, but will cause a memory regression for shm surfaces with multiple views. This is done to simplify the creation and destruction of textures, especially in multi-threaded environments. Also the same patch removes the y_inverted property and replaces it with a origin property. Its done in the same patch as a lot of the code was overlapping. Change-Id: I4bce50c614c9ac3ba0580e0560339476eac03433
* Make it possible to set a QWaylandSurface on the QWaylandSurfaceViewJørgen Lind2015-08-281-1/+1
| | | | | | This will allow us to use QWaylandSurfaceItem from within QML Change-Id: I6ecfbf3a5de5f5a748a6a85295b9741316fef976
* make yInverted a property of qwaylandsurfaceJørgen Lind2015-08-281-0/+2
| | | | Change-Id: I4c90149e0b56df3f6718620e80443d50ac10439b
* Make the attach offset available through a signal on QWaylandSurfaceJørgen Lind2015-08-281-0/+1
| | | | | | | This can then be picked up by ie. the shell_surface which can adjusts its view accordingly Change-Id: Iee3efa243c59b259834e599312d687401528e9c4
* Make QWaylandsurface::output a propertyJørgen Lind2015-08-281-0/+2
| | | | Change-Id: I2c82466b0e3842da901449d7978683922331d05e
* Add a shellView property on QWaylandSurfaceJørgen Lind2015-08-281-0/+3
| | | | Change-Id: I68d05698b3caed11ccec39ef06ac5f912d782cf2
* LGPL v3 license change for Qt Wayland CompositorJørgen Lind2015-07-241-27/+23
| | | | Change-Id: I84ed248b471464214d935352768f300d4b90dec3
* Add a mechanism to delay unmapping of surfacesGiulio Camuffo2015-07-151-0/+12
| | | | | | | | | | When a client attachs a NULL buffer on a surface we may want to hang on to the old buffer for a bit, e.g. to do a hide animation. Add the QWaylandUnmapLock class to keep a surface mapped after an attach(0) request. Change-Id: I5d5be0b36410a76a58d2b68c1b2ac5e3b875a801 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Fix the build error in public headersBhushan Shah2015-05-171-1/+1
| | | | | | | One should always use Q_SLOTS/Q_SIGNALS in then public headers Change-Id: Ibbba0d3ff402bd320049bcd58ced07ad1342ef3b Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Move surfaces to outputsPier Luigi Fiorini2015-04-211-2/+38
| | | | | | | | | Moving surfaces to belong to a specific output. Surfaces can be viewed on a different output anyway. Change-Id: I9ef76300f85190d84b83431374e76e581786e4e7 Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com> 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-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch '5.4' into devGiulio Camuffo2014-11-151-3/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 more careful when destroying wl_resourcesv5.4.0-rc1v5.4.0Giulio Camuffo2014-10-281-1/+0
| | | | | | | | | | | | | | | | The compositor must not destroy wl_resources when it wants to, else it breaks the contract with the client. Change-Id: Ic0d298072cdf0954d2504c04bff2bcc99733e621 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Fix the compositor's wayland versioningGiulio Camuffo2014-10-091-1/+1
| | | | | | | | | | | | | | | | | | We cannot just assume all clients implement the same version of the various interfaces as the compositor does. Keep track of them, and react accordingly when creating a resource or sending an event. Change-Id: I9792433a14d49c5c4df0c892fc1349ce0dfb0d43 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| * Remove duplicate size property declarationMikko Levonmaa2014-10-061-1/+0
| | | | | | | | | | | | Change-Id: I9700c15066c030436dbe2f9a09b0851b7f4350ae Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-09-191-1/+1
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwlcompositor.cpp Change-Id: Ica26e33eb2b77ed5be0e84e8f4256d2e85abfaf5
| * Replace signals with Q_SIGNALS.Robin Burchell2014-08-191-1/+1
| | | | | | | | | | | | | | Fixes tst_headers on QtWayland. Change-Id: I14ba4a58c257d03d10c63f0413460e2bf52793fc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Expose surface's client to QMLPier Luigi Fiorini2014-08-171-2/+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>
* | Add support for setMask to set input regionJan Arne Petersen2014-08-131-0/+2
|/ | | | | | | | 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 transient parent and offset to QWaylandSurfacePier Luigi Fiorini2014-08-011-0/+4
| | | | | | | | | Compositors now know more about transient surfaces. With the parent and offset information, compositors can place transient surfaces relative to their parent. Change-Id: I73e08aad7bb1d8a7d40b2006208eb48e2a1a8455 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Add more API to change QWaylandSurface propertiesGiulio Camuffo2014-07-301-1/+1
| | | | | | | | | | | | | | The previous patch allows for QWaylandSurface to call into custom protocol implementations, but the other way around is needed too. Instead of adding many public setters to QWaylandSurface this makes QWaylandSurfaceInterface the way to set them, through protected functions. This avoids calling the setters from other code paths, which would bring the server and client states of the same surface out of sync. Change-Id: I9836c38835f10f6e63007b13d27a62884065f837 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Introduce QWaylandSurfaceInterfaceGiulio Camuffo2014-07-301-0/+12
| | | | | | | | | | | | | | | | | | | | | Wayland is designed to be easily extensible with new protocol, unfortunately it currently isn't possible with QtCompositor. A QtWayland compositor has two ends: the Wayland end and the shell/wm end, which may be implemented in QML. These two ends communicate mainly through the QWaylandSurface and the QWaylandSurfaceView classes, but the Wayland end is currently unable to hook into custom protocol extensions. This is the purpose of the new QWaylandSurfaceInterface class, and of QWaylandSurfaceOp and its subclasses: based on the QEvent model, QWaylandSurfaceOp has only a type member, and its type specific subclasses have additional data if needed. A custom protocol implementation, such as xdg_surface or my_fancy_surface, will use a QWaylandSurfaceInterface subclass which will call its specific protocol functions when it gets the relative operation requests from the parent surface. The QWaylandShellSurface class is now redundant so it is removed. Change-Id: I37a86157a251626215f57ce030c77a26bfd65126 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Split QWaylandSurface in a model and view fashionGiulio Camuffo2014-04-291-7/+5
| | | | | | | | | | QtQuick compositors already use a view class (QWaylandSurfaceItem), so add a new QWaylandSurfaceView, which is subclassed by QWaylandSurfaceItem, and move the view related methods of QWaylandSurface there. A QWaylandSurface can have many views. Change-Id: I7e92fe1f7e9d252f5f40a3097feabb5f3318b03a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Let the ShellSurface send the mapped and unmapped signals.Giulio Camuffo2014-04-291-2/+1
| | | | | | | | A surface without any attached shell surface should never be mapped, so make the latter set the mapped state on the surface. Change-Id: If09bd9eebecd6e0a52f862cb866d85aec403c3a0 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Rework the way buffers are used and renderedGiulio Camuffo2014-04-291-28/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | The current way buffers are handled is sub-optimal. They are hidden inside QtWayland::Surface and the actual renderer, be it QtQuick or anything else, cannot get a direct hold of them, nor it can directly control when the underlying textures are created or deleted. The main additions in this commit are the splitting of the QtQuick code path and the new QWaylandBufferRef and QWaylandBufferAttacher classes. QWaylandBufferRef allows a renderer to retain a reference to a wl_buffer even after the underlying Surface discarded it. That allows the renderer to directly decide when to destroy the texture of the buffer. QWaylandBufferAttacher is a pure virtual class which must be implemented by the renderer. Instances of it will be assigned to the QWaylandSurfaces, created. Its attach() virtual method will then be called when a new buffer is committed to the surface. The renderer can then choose to immediately create a texture or wait for some later time. It is its responsibility to create and destroy the GL texture, it will not happen automatically. This functionality is implemented for QtQuick in the new QWaylandQuickCompositor and QWaylandQuickSurface classes. Change-Id: I674b4e5fb8c65c3b1c582e33ff3a0b0e45f2acc9 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Merge branch 'stable' into devGunnar Sletta2014-03-251-4/+3
|\ | | | | | | | | | | | | | | Conflicts: src/compositor/compositor_api/qwaylandsurfaceitem.cpp src/compositor/wayland_wrapper/qwlcompositor.cpp Change-Id: Ibbed140c7694ea7fd1882ebb0139b376546b8b50
| * Make the compositor redraw when a surface gets a commit().Giulio Camuffo2014-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | It must redraw, even if it doesn't actually redraw anything, irrespective of the fact that a attach/damage has come or not. Just calling frame();commit() is perfectly valid. Change-Id: If298654b8a7cb7c954cfbad8618f23134731cb9f Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| * Remove the buffer queue.Giulio Camuffo2014-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | A client calling attach(A);commit();attach(B);commit() should result in its back buffer be set to B, and A be discarded. If the client wants to have a queue it should keep it client side or a protocol extension tailored for that purpose should be developed. Change-Id: Ia0048f311504d85821df9f5b9225887801efec71 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| * Improve the frame callbacks handlingGiulio Camuffo2014-02-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the way wl_surface's frame callbacks are handled. The sooner they are sent the better is for the clients, as they have more time to render the next frame, but reducing the time for the compositor to render its frame. The best compromise is probably to send them out after the compositor has issued its GL calls but before calling eglSwapBuffers(), and before the GPU actually draws anything. Rename the function to send the callbacks to only reflect its purpose, leaving the compositors free to choose when they want to send them. Change-Id: Ifcdfcad9e54b4d07d5c087898123ac724395a194 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Dont use a separate mapped state of QWaylandSurfaceItemJorgen Lind2014-03-031-0/+1
|/ | | | | | | | | Use the isMapped value of the QWaylandSurface Change-Id: I7a44fa2d8d58f698cd6994e8bc8c8acf86a57775 Reviewed-by: Andy Nichols <andy.nichols@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>