summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandxdgshell.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add convenience for converting wl_resource * to wrapper typesJohan Klokkhammer Helsing2018-11-211-9/+7
| | | | | Change-Id: Ieb2f9706ac707ff878165d3f9001e4a28b8ff1ce Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Fix coordinate system inconsistenciesJohan Klokkhammer Helsing2018-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Several properties were using pixel coordinates and surface coordinates without converting. [ChangeLog][Compositor] QWaylandSurface::destinationSize has been added which returns the size of the surface that will be displayed on the screen in surface coordinates. [ChangeLog][Compositor] Fixed a bug where QWaylandSurface::inputRegionContains would return true for some points outside surfaces with buffer scale > 1. [ChangeLog][Compositor] Fixed a bug which caused ShellSurfaceItems for surfaces with buffer scale > 1 to move too much when resizing interactively. It also gets rid of all calls to QWaylandSurface::size, which confusingly returns the size of the surface's buffer in pixel coordinates. Most properties now use destionationSize's surface coordinates consistently. Hopefully, QWaylandSurface::size can be renamed or removed in Qt 6. Change-Id: I007256a8df7759cf74fbfd51624fa1f90c083336 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove confusing elses after returnsJohan Klokkhammer Helsing2018-09-141-4/+2
| | | | | Change-Id: I0ba39df637f6e5ce93ba57f40f279c81532e9289 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Add XdgToplevel::xdgSurfaceJohan Klokkhammer Helsing2018-09-071-0/+17
| | | | | | | Similar to the property we already have for popups, XdgPopup::xdgSurface. Change-Id: I1a0b77b28a35597139fcf381a4b345ccaa93d626 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor xdg-decoration: Fix crash when clients disconnectJohan Klokkhammer Helsing2018-09-051-0/+13
| | | | | | | | | | | | | | | | | If clients were disconnected without shutting down nicely, e.g. if Qt clients were terminated with SIGINT, then QWaylandXdgToplevelDecorationV1 would be deleted before its Wayland resource, causing a crash in the resource destroy handler. This switches to a raw pointer in the toplevel, which is now cleared when the decoration is deleted. Deletion order is also ensured by conditionally destroying the resource in the toplevel destructor. Warnings are also printed when clients destroy objects in the wrong order (protocol errors). Change-Id: I8c24becb82e298e93cd45d70a004d8d23ead382b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Add documentation for xdg-decoration-unstable-v1Johan Klokkhammer Helsing2018-09-051-0/+28
| | | | | | | And QWaylandXdgToplevel::decorationMode Change-Id: I52146b55757b6866061c7b06d2595e233d6af1ff Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Fix nullptr dereferences in fromResource functionsJohan Klokkhammer Helsing2018-08-291-2/+6
| | | | | | | | | If there was no resource for the given wl_resource*, don't try to dereference it. Change-Id: I3a27a5805699148bb26029e8b4179042c3c1117a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Compositor xdg-shell: Respect min and max sizeJohan Klokkhammer Helsing2018-08-171-3/+8
| | | | | | | | [ChangeLog][Compositor] xdg-shell minimum and maximum sizes are now respected when resizing. Change-Id: Iaf6a2bd283117e948fda6693530e08f68f755a17 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor API: Add xdg-decoration unstable v1 supportJohan Klokkhammer Helsing2018-08-171-0/+6
| | | | | | | | And add an example with server-side window decorations. Task-number: QTBUG-69934 Change-Id: Ic3984b50cf7574cae5135dea51eb4b1c80bb45a7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Add QWaylandXdgToplevel::fromResourceJohan Klokkhammer Helsing2018-08-171-5/+8
| | | | | Change-Id: I0f388a4c4f6b765c34d115a6583982d86bc82557 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Handle conversion from xdg-shell resize edges correctlyJohan Klokkhammer Helsing2018-08-161-30/+41
| | | | | | | | | There are two different types of edges in xdg-shell. Make it more explicit which ones we are using. Change-Id: I7e18a376b359be8e06f96cae897d7ccbc62e3c3e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Compositor API: Add xdg-shell stableJohan Klokkhammer Helsing2018-08-151-0/+2020
| | | | | | | | | | | | | | | [ChangeLog][Compositor API] Added APIs for xdg-shell stable. Code copied from the V6 implementation with suffixes and prefixes removed. Otherwise a few minor edits, such as renaming xdg_shell to xdg_wm_base, and handling the anchor and gravity edges no longer being bitfields. Examples that used v6 have been updated to use stable instead, or, in some cases, to support both. Task-number: QTBUG-66784 Change-Id: Ia619b478a938fdcd9b47af8a8df2d7fcc4406204 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Rename the QWaylandXdg* classes to QWaylandXdg*V5Giulio Camuffo2016-09-051-1190/+0
| | | | | | | | This frees the QWaylandXdg name for the hopefully coming stable version of xdg-shell. Change-Id: I9beb9b035c6497fb45bee5c9104485b564ca0619 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Merge remote-tracking branch 'qt/5.7' into 5.8v5.8.0-alpha1Liang Qi2016-08-281-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compositor/compositor_api/qwaylandseat.cpp src/compositor/compositor_api/qwaylandview.cpp tests/auto/compositor/compositor.pro tests/auto/compositor/compositor/testinputdevice.cpp tests/auto/compositor/compositor/testinputdevice.h tests/auto/compositor/testinputdevice.cpp tests/auto/compositor/testinputdevice.h tests/auto/compositor/testseat.cpp tests/auto/compositor/testseat.h Change-Id: I98e045908dd964e5d4120bd35e71b8839c0d923a
| * Doc: Language editsVenugopal Shivashankar2016-08-171-2/+2
| | | | | | | | | | | | | | Task-number: QTBUG-53147 Change-Id: I353cf18b9661b5eb2371072f8091dc890fc7fcf0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
* | compositor: Add shell property to xdg-shellPier Luigi Fiorini2016-08-151-0/+36
| | | | | | | | | | | | | | | | | | Add a shell property to QWaylandXdgSurface and QWaylandXdgPopup like QWaylandWlShellSurface. Change-Id: Id321f2ba8a48284c31fe67c4600c86f5c134b68d Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor API: rename QWaylandInputDevice to QWaylandSeatJohan Klokkhammer Helsing2016-08-111-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | The name QWaylandInputDevice could be confusing and misleading: - A QWaylandInputDevice was not one input device, but a collection of many. - Classes that sounded like they should inherit from it did not, i.e: QWaylandKeyboard, QWaylandPointer and QWaylandTouch. - The Wayland protocol already has another term for this, which is seat. Change-Id: I9d9690d5b378075d9dddaeb8cf18395c7f47603e Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Merge remote-tracking branch 'qt/5.7' into devPaul Olav Tvete2016-08-041-2/+2
|\| | | | | | | Change-Id: Ib22055ac52c0bb36081242948c72332db4e5ac64
| * Doc: several minor link issues in QtWaylandNico Vertriest2016-08-021-2/+2
| | | | | | | | | | | | Change-Id: I9e656b02e1b820e2257d95948650c541656192b4 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
* | Rename createSurface and similar signalsJohan Klokkhammer Helsing2016-08-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | * createSurface -> surfaceRequested * createXdgSurface -> xdgSurfaceRequested * createXdgPopup -> xdgPopupRequested * createShellSurface -> wlShellSurfaceRequested * shellSurfaceCreated -> wlShellSurfaceCreated Change-Id: I715a927242130d7504955002a6a64a2bac516d46 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Compile with -no-openglJohan Klokkhammer Helsing2016-07-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QtWayland has not compiled without OpenGL for a while. This patch fixes the compilation issues and removes the old config variable, "QT_WAYLAND_GL_CONFIG" and instead checks for the presence of "opengl" in "QT_CONFIG". A new define is also introduced, QT_WAYLAND_COMPOSITOR_QUICK, because it may eventually be possible to use create a QtQuick compositor without OpenGL. Task-number: QTBUG-54322 Change-Id: Ica7b3b320212d4ae1f8b1053725b73c83739c73c Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Rename sendUnMaximized to sendUnmaximizedJohan Klokkhammer Helsing2016-07-121-1/+1
| | | | | | | | | | Change-Id: I20add5c8b12e1345ce50c009d8bae80fde9806e1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Emit a signal when QWaylandXdgSurface changes window typePier Luigi Fiorini2016-06-231-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | This allows compositors to track when a window changes type and act accordingly (for example do a different show animation). Compositors might also want to keep track of the window type in order to filter out windows when presenting them to the user, think of a spread windows effect that only shows top level windows. Change-Id: I13c0ed3db2bdc6318ff1f4345d065e188b7c2435 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Take buffer scale into account when calculating unset window geometryJohan Klokkhammer Helsing2016-06-231-7/+30
| | | | | | | | | | | | | | | | | | This fixes a resize issue where the window would scale to be bufferScale times the size it should have been. Change-Id: I4d3eee52d54a063c0a617a053cbe05b351f18f76 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* | Add QML popup support for xdg_shellJohan Klokkhammer Helsing2016-06-151-3/+8
| | | | | | | | | | Change-Id: I5b35ff3b1c6c2dc884b52e6f077c0f2bb2db68a2 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* | Add position property to QWaylandXdgPopupJohan Klokkhammer Helsing2016-06-071-5/+28
| | | | | | | | | | Change-Id: I29c48ae9c44fc5601200a6bb6f6a7dbd9c8baba3 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | Rename xdg surface request<state> methods send<state>Johan Klokkhammer Helsing2016-05-311-4/+4
|/ | | | | | | | It could be confusing to have methods that cause Wayland events to be named request*. Change-Id: I6567f9e8fd9370e574516e97cd49858e2bf34829 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Revert "Add position property to QWaylandXdgPopup"Johan Klokkhammer Helsing2016-05-271-28/+5
| | | | | | | | | | This commit would have broken source and binary compatibility between 5.7.0 and 5.7.1. This reverts commit 20692ad15b8ac0c24b12d30609f061a740c87f23. Change-Id: Ic4156571889ec08a708e67c55d461d3052ce0ad0 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Add position property to QWaylandXdgPopupJohan Klokkhammer Helsing2016-05-241-5/+28
| | | | | | | | Store the position relative to the parent Change-Id: Iccae120b70e98388d18e4867e21a3a8c36ddd522 Reviewed-by: Erik Larsson <erik@ortogonal.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Create a general ShellSurfaceItem to avoid duplicationJohan Klokkhammer Helsing2016-05-201-3/+9
| | | | | | | | | | | | | | | | | | XdgSurfaceItem and WlShellSurfaceItem have been removed in favor of the more general ShellSurfaceItem. An XdgSurface or a WlShellSurface can be assigned to the shellSurface property of a ShellSurfaceItem and leaves open the possibility for additional shells. A shared base class for QWaylandXdgSurface and QWaylandWlShellSurface has been added which has a factory method for creating a QWaylandQuickShellIntegration for that shell implementation. The property "shellSurface" on the ShellSurfaceItem allows QML code to attach to signals regardless of whether it's a WlShell or XdgShell client. The pure-qml example has been updated to take advantage of this. Change-Id: I9d3427586e100d6c44a24f319dd8e1486ff062ee Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Remove empty private class QWaylandExtensionTemplatePrivateJohan Klokkhammer Helsing2016-05-191-3/+3
| | | | | | | | Previous subclasses are now inheriting directly from QWaylandExtensionPrivate instead. Change-Id: I33ef88867fcf216a7b1441f69b7025bc2a4367dc Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Rename QWaylandExtension to QWaylandCompositorExtensionPaul Olav Tvete2016-05-181-14/+14
| | | | | | | | Since we have QWaylandClientExtension Change-Id: Ie8d60322c8e730bda651e06ed5db0fe1359d946e Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Add documentation for QWaylandXdgSurface::windowGeometryJohan Klokkhammer Helsing2016-05-151-2/+6
| | | | | Change-Id: I131b41a4711b2b1094871eeb44adf99906190953 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Mark the QtWaylandCompositor API as \preliminaryPaul Olav Tvete2016-05-121-0/+2
| | | | | Change-Id: I85e3a6dd98496005c63a88bc0218bc94301692ba Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
* Initial compositor support for xdg-shell wayland extensionJohan Klokkhammer Helsing2016-03-241-0/+1049
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>