summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandsurface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add documentation to Qt Wayland CompositorEskil Abrahamsen Blomfeldt2015-10-261-4/+193
| | | | | | | | | | | This adds some preliminary documentation for the Qt Wayland Compositor. There are a few classes which remain undocumented. The documentation in some areas may be a bit minimal, but this can be expanded gradually with code examples and more details. Change-Id: I5d285a5a25e8602ac2fdddc84c3fd217e7b77c95 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Rename QWaylandExtensionContainer to QWaylandObjectPaul Olav Tvete2015-10-231-3/+3
| | | | | | | | | | 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>
* Fix missing #ifndef for housekeeping code.Erik Larsson2015-10-121-0/+2
| | | | | Change-Id: Iad74c37917ef2cb61565c88dc3de12bd0fb7fbcb Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Improve notification at surface destructionPaul Olav Tvete2015-09-291-5/+5
| | | | | Change-Id: I7e9cb1a0ed728f21af4f1e00ee66dfe86f0dd6a4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Make sure QWaylandQuickItem paints the first frameJørgen Lind2015-09-181-0/+2
| | | | | | | when a Surface containing a frame is being set on it Change-Id: Ie19f017f0f28e225ffc29edf9a88fa21e6988d02 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Rename QtCompositor to QtWaylandCompositorJørgen Lind2015-09-101-8/+8
| | | | | | | 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-8/+59
| | | | | | | | | | | | 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
* Use QWaylandBufferRef in QWaylandSurfacePrivate::setBackBufferJørgen Lind2015-08-281-10/+2
| | | | | | simplifies the logic Change-Id: I918e014c56ceeea8e6c5f93c49d84f9ffe8e27b2
* Remove the qt_sub_surface extensionJørgen Lind2015-08-281-1/+0
| | | | Change-Id: I380590722f2c95ff68972f5b3c94a7cc4cfe016f
* Move ref and unref from QWaylandSurface to privateJørgen Lind2015-08-281-45/+49
| | | | | | | | | 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
* Removed the m_ prefix for variables in QWaylandSurfacePrivateJørgen Lind2015-08-281-84/+84
| | | | | | and remove unnecessary functions Change-Id: I412e5c6e0187e55a0766eee509c02924d3e1a7c9
* Remove QtWayland::InputDeviceJørgen Lind2015-08-281-3/+3
| | | | | | | and add QWaylandInputDevicePrivate. Also make sure noone holds a reference to the private instance. Change-Id: Ic2327595d58d6308e1e2699370f53aef47061b04
* Use QWaylandClient in constructor of QWaylandSurfaceJørgen Lind2015-08-281-4/+4
| | | | | | instead of struct ::wl_client * Change-Id: I606a813e84eeec8134e6ece428f42a53e1ba0189
* Remove QtWayland::Compositor and add QWaylandCompositorPrivateJørgen Lind2015-08-281-8/+10
| | | | | | Embrace PIMPL Change-Id: I8c8b5971e15c208317ff33231bda1513e7b8d489
* Remove QtWayland::SurfaceJørgen Lind2015-08-281-75/+285
| | | | | | | | 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-31/+25
| | | | | | | | | | | | | | | 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-67/+3
| | | | Change-Id: Ie5d8899157d77f83f2cf65f236d534b972aa4770
* Remove excess definition of QWaylandKeymapJørgen Lind2015-08-281-27/+0
| | | | | | Also remove QWaylandUnmapLock Change-Id: I0b481224fd03032603084142f36be279351f6611
* make sure that views don't have a surfaceJørgen Lind2015-08-281-0/+8
| | | | | | | when the surface is deleted. Also, don't access the surface in the destructor of the view Change-Id: I4dac3d8e8f77cd0d83b9bc5c3fb948f3172b95a3
* Rename QWaylandSurfaceView to QWaylandViewJørgen Lind2015-08-281-3/+3
| | | | | | and rename QWaylandSurfaceItem to QWaylandQuickView Change-Id: I989b482eb79df06e9f265bc2b0ef6b3dce7509d6
* Remove transient(inactive|parent|offset) from QWaylandSurfaceJørgen Lind2015-08-281-21/+0
| | | | Change-Id: I0fad382c0baa13ec72ff5e45cc1eba0bd4d5c70a
* Remove the static instance of a compositor.Jørgen Lind2015-08-281-1/+1
| | | | | | | All classes that needs to access the compositor instance needs to keep a reference to it Change-Id: Ia0d4b04b460200ad3c7907b94c032afe90c18771
* Public input apisJørgen Lind2015-08-281-2/+20
| | | | Change-Id: I60ec2fd9f4afe54198d9c476b28f9f15a661e9ca
* Rework how we manage extensionsJørgen Lind2015-08-281-142/+5
| | | | Change-Id: If2cbf096e7419bc1bda007d5167ce39d1a5d50ae
* Introducing QWaylandOutputSpaceJørgen Lind2015-08-281-0/+6
| | | | | | | | | | 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-22/+25
| | | | | | | | | 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-27/+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-3/+31
| | | | | | This will allow us to use QWaylandSurfaceItem from within QML Change-Id: I6ecfbf3a5de5f5a748a6a85295b9741316fef976
* Add a shellView property on QWaylandSurfaceJørgen Lind2015-08-281-0/+6
| | | | Change-Id: I68d05698b3caed11ccec39ef06ac5f912d782cf2
* LGPL v3 license change for Qt Wayland CompositorJørgen Lind2015-07-241-27/+23
| | | | Change-Id: I84ed248b471464214d935352768f300d4b90dec3
* Remove scoped enums to fix builds without C++11 support.Julien Brianceau2015-07-221-1/+1
| | | | | Change-Id: Ibe1811ee0b7057d082a55c4ae62e5932f7e10b84 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Add a mechanism to delay unmapping of surfacesGiulio Camuffo2015-07-151-0/+26
| | | | | | | | | | 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>
* Add 3 QList::reserve() callsSergio Martins2015-06-081-1/+3
| | | | | Change-Id: Ic89d25a4497ffaffb3f6b688f4c5ecc5128e9642 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Move surfaces to outputsPier Luigi Fiorini2015-04-211-5/+85
| | | | | | | | | 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/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-291-2/+1
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/compositor/compositor_api/qwaylandsurface.cpp Change-Id: I3ee40153c959dbe31ea685571c5a8bb1ae36606e
| * Don't access a dangling pointerGiulio Camuffo2014-11-201-0/+2
| | | | | | | | | | | | | | | | The surface's resource may have been destroyed, return a null client in that case. Change-Id: I3d7e0f0e94008e003e43f1987e6560dd73f5c5db Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge branch '5.4' into devGiulio Camuffo2014-11-151-12/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+1
| | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-09-191-1/+1
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwlcompositor.cpp Change-Id: Ica26e33eb2b77ed5be0e84e8f4256d2e85abfaf5
| * Do not crash when querying transientParent() and there's noneLaszlo Agocs2014-08-221-1/+1
| | | | | | | | | | Change-Id: I47cddffd7859df2548dacb6aee13beb15a222451 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Expose surface's client to QMLPier Luigi Fiorini2014-08-171-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+6
|/ | | | | | | | 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/+12
| | | | | | | | | 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>
* Make Surface own its visibility propertyGiulio Camuffo2014-08-011-6/+10
| | | | | Change-Id: I5eb8ab7bfb16505c8a14c4d77c5ff55aa0e22cfc Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Use wl_surface.set_buffer_transform to signal surface rotationGiulio Camuffo2014-07-311-3/+1
| | | | | | | | Drop the custom request in the surface extension, and use the wayland core mechanism. Change-Id: I580f56c90bcd3b2c5a6da08d1a033b10790ac330 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Use wayland core interfaces to signal output rotationGiulio Camuffo2014-07-311-1/+3
| | | | | | | | The wl_output interface has an event for signaling the rotation of the display, so use that instead of our own thing. Change-Id: I8a017d575ee456a7a81649e19a015085fb784805 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Add more API to change QWaylandSurface propertiesGiulio Camuffo2014-07-301-9/+27
| | | | | | | | | | | | | | 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>