1. 18 Aug, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Revert "Don't flush in SurfaceInterface::frameRendered()" · 8f5cc410
      Vlad Zahorodnii authored
      This reverts commit 0069d881.
      
      Unfortunately, 0069d881 broke a couple of tests in kwin due to Qt not
      emitting QAbstractEventDispatcher::aboutToBlock() signal when macros
      such as QTRY_VERIFY() or QTRY_COMPARE() spin the event loop.
      8f5cc410
    • Vlad Zahorodnii's avatar
      Don't flush in SurfaceInterface::frameRendered() · 0069d881
      Vlad Zahorodnii authored
      Frame callbacks only indicate when the client can start rendering a new
      frame, it's not meant to be precise. If the client wants to do some
      black magic with frame scheduling and so on, it needs to use a protocol
      such as presentation_time. This change removes the pointless flush to
      prevent over-flushing client connections.
      0069d881
  2. 28 Jul, 2020 1 commit
  3. 16 Jul, 2020 1 commit
  4. 15 Jul, 2020 4 commits
  5. 30 Jun, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Provide an easy way to monitor buffer size changes · fd995084
      Vlad Zahorodnii authored
      The main purpose behind the kwaylandserver library is to provide a set
      of re-usable wayland compositor extension implementations. However, it's
      worth noting that the design of kwaylandserver is far from perfect at
      the moment.
      
      KWaylandServer tries to hide all low level wayland details from the
      compositor. But it's not the case with buffers, which diminishes the
      whole point behind the library.
      
      Creating OpenGL textures from Wayland buffers is the responsibility of
      the compositor. So, when it comes to client buffers, we are one foot in
      KWaylandServer, and the other foot in the compositor.
      
      Since the surface size is a logical size, the compositor can't use it
      for allocating memory for OpenGL textures. This change adds the buffer
      size property in SurfaceInterface that can be used for allocating memory
      for textures as well as monitoring buffer size changes.
      
      I must say that the introduction of the buffer size property is a crude
      hack because BufferInterface just needs to provide an OpenGL texture for
      each plane. The main blocker for that is that it would involve moving
      the backend, the compositor, and the wayland bits in the same place, for
      example kwayland-server or ultimately kwin.
      fd995084
  6. 24 Jun, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Rename buffer-specific surface properties · 47f80b99
      Vlad Zahorodnii authored
      The buffer scale and the buffer transform property specify transforms
      that had been applied to the buffer's contents. Neither one of those
      properties apply to the surface, in other words the buffer transform
      property doesn't indicate that the surface was rotated or flipped or both.
      
      This change doesn't gain anything in terms of new features, etc. It just
      attempts to make things more clear.
      47f80b99
  7. 19 Jun, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Drop SurfaceInterface::inputIsInfitine · 832f5bdd
      Vlad Zahorodnii authored
      Since we don't guarantee SC and BC in KWaylandServer, we can drop
      SurfaceInterface::inputIsInfitine().
      832f5bdd
    • Vlad Zahorodnii's avatar
      Introduce surface-to-buffer and buffer-to-surface matrices · 4d210a94
      Vlad Zahorodnii authored
      The compositor needs to monitor changes in the mapping between the
      surface local coordinates and the buffer coordinates because texture
      coordinates correspond to the latter. One way to do it is to monitor
      things such as the surface size, the buffer size, the buffer scale,
      etc. The main problem with doing so is that there are so many factors
      that contribute to how mapping between the surface local coordinate
      space and the buffer coordinate space is performed.
      
      In order to provide a generic way for monitoring changes in the mapping
      between the surface local coordinate space and the buffer coordinate
      space, this patch introduces two new matrices. The first one specifies
      how the surface-local coordinates are mapped to buffer coordinates, and
      the other one specifies how to map the buffer coordinates to surface
      local coordinates.
      
      With the new two matrices, the compositor has a generic way to get
      notified when it has to re-compute texture coordinates.
      4d210a94
  8. 17 Jun, 2020 1 commit
  9. 02 Jun, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Add support for the wp_viewporter protocol · b9381012
      Vlad Zahorodnii authored
      The wp_viewporter compositor extension allows clients to crop and scale
      their surface. It can be useful for applications such as video players
      because it may potentially reduce their power usage.
      b9381012
  10. 01 Jun, 2020 3 commits
  11. 04 May, 2020 1 commit
  12. 29 Apr, 2020 1 commit
  13. 22 Apr, 2020 1 commit
  14. 19 Mar, 2020 1 commit
  15. 18 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      [server] Introduce SurfaceInterface::boundingRect() · deb476e4
      Vlad Zahorodnii authored
      Summary:
      The new method provides a convenient way for determining the rectangle
      that bounds the given surface and all of its sub-surfaces. This can be
      very handy when determining the effective window geometry.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: apol, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D27828
      deb476e4
  16. 16 Mar, 2020 1 commit
  17. 06 Feb, 2020 1 commit
  18. 23 Jan, 2020 1 commit
  19. 26 Nov, 2019 1 commit
    • Vlad Zahorodnii's avatar
      [server] Make double-buffered properties in xdg-shell double-buffered · d0b3eab8
      Vlad Zahorodnii authored
      Summary:
      So far all double-buffered properties in our implementation of xdg-shell
      weren't actually double-buffered. When a property setter is invoked, we
      pray to the God hoping that the client committed associated surface.
      
      This change introduces private SurfaceRole class. The new class provides
      a way for SurfaceInterface to commit pending state of associated shell
      surface.
      
      The chosen architecture allows us to do more in the future. For example,
      we could use SurfaceRole to prevent associating several roles to a single
      wl_surface object, e.g. xdg-toplevel to a pointer surface, etc.
      
      Test Plan: This change breaks support for client-side decorated clients in KWin.
      
      Reviewers: #kwin
      
      Subscribers: kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D23745
      d0b3eab8
  20. 08 May, 2019 1 commit
    • Roman Gilg's avatar
      Implement wl_surface::damage_buffer · b71e1035
      Roman Gilg authored
      Summary:
      Missing from our surface handling was the damage_buffer call introduced in
      version 4 of the wl_compositor interface.
      
      Its only difference to a normal damage call is that the damaged region is
      supposed to be defined by the client in buffer coordinates instead of
      surface coordinates. This damage must be tracked separately in KWayland
      and on commit with the buffer transformation united with the normal damage.
      
      Test Plan: Autotest updated.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, zzag, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D15910
      b71e1035
  21. 12 Feb, 2019 1 commit
    • David Edmundson's avatar
      Add explicit SurfaceInterface::commited signal · b2f67e1d
      David Edmundson authored
      Summary:
      Whilst some interfaces that are double-buffered against the wl_surface
      are proxied through SurfaceInterface, some are not, most notably
      XdgShell.
      
      We need some low level signal to know when the surface has been
      committed which doesn't rely on their being a damaged buffer.
      
      Test Plan:
      Unit test
      Used in kwin
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D18582
      b2f67e1d
  22. 06 Feb, 2019 1 commit
    • Roman Gilg's avatar
      [server] Add surface data proxy mechanism · 0b33f078
      Roman Gilg authored
      Summary:
      Allows a compositor to set a proxy surface to handle drag and drop
      operations place of the actual surface the drag originated from.
      
      One proxy surface can handle multiple origin surfaces at the same time. These
      need to get registered once. The active remote surface gets set when a pointer
      button is pressed on the surface.
      
      Test Plan: Manually with KWin's Xwayland DnD patches.
      
      Reviewers: #kwin
      
      Subscribers: davidedmundson, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D15421
      0b33f078
  23. 24 Oct, 2018 1 commit
    • Roman Gilg's avatar
      [server] Respect input region of sub-surfaces on pointer surface focus · 24bdc067
      Roman Gilg authored
      Summary:
      KWayland takes always the top-most child surface at a given position for its
      pointer input. But if a sub-surface sets its input region, it should not select
      this one when the position is out of its input region, but rather try the
      surface below.
      
      Test Plan:
      My testing was only on my Xwayland branch. Supposed to also fix a problem
      with Firefox native Wayland port.
      
      Reviewers: #frameworks, graesslin, davidedmundson
      
      Reviewed By: davidedmundson
      
      Subscribers: davidedmundson, zzag, kde-frameworks-devel, graesslin, plasma-devel
      
      Tags: #frameworks, #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D7038
      24bdc067
  24. 08 Oct, 2018 1 commit
    • David Edmundson's avatar
      Don't silently error if damage is sent before buffer · b4cd89ea
      David Edmundson authored
      Summary:
      Firefox sends
      
      wl_surface@37.damage(0, 0, 808, 622)
      wl_surface@37.attach(wl_buffer@34, 0, 0)
      
      Which we silently treat as an error.
      
      There's nothing in the spec to forbid this. The only thing that matters
      is the state on commit. This moves a check there.
      
      CCBUG: 397834
      
      Test Plan:
      Had a debug in there which was being activated
      Gets firefox slightly further (but not complete)
      
      Reviewers: #kwin
      
      Subscribers: kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D15912
      b4cd89ea
  25. 10 Jun, 2018 1 commit
    • Roman Gilg's avatar
      [server] Small code cleanup in SurfaceInterface · 31b1c144
      Roman Gilg authored
      Summary:
      Use lambda function to reduce code duplication and put
      function definitions in the same order as in the header file.
      
      Test Plan: All autotests succeed.
      
      Reviewers: #plasma, davidedmundson
      
      Reviewed By: #plasma, davidedmundson
      
      Subscribers: davidedmundson, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D13191
      31b1c144
  26. 07 Feb, 2018 1 commit
    • Martin Flöser's avatar
      [server] Don't crash when a subsurface gets commited whose parent surface got destroyed · d38825d9
      Martin Flöser authored
      Summary:
      Qt seems to damage and commit child subsurfaces although their parent
      got destroyed. This actually doesn't make any sense as without a parent
      surface they cannot be shown. But nevertheless we should not crash in
      such a situation.
      
      This change guards the places in the commit handling code where the
      parent gets accessed.
      
      BUG: 389231
      
      Test Plan: New test case which exposes the problem
      
      Reviewers: #frameworks, #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D10300
      d38825d9
  27. 23 Jan, 2018 1 commit
    • Roman Gilg's avatar
      Fix typo · 6ad30db9
      Roman Gilg authored
      Summary: Fix a typo
      
      Reviewers: #plasma, davidedmundson
      
      Reviewed By: #plasma, davidedmundson
      
      Subscribers: plasma-devel, #frameworks
      
      Tags: #frameworks, #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D10053
      6ad30db9
  28. 16 Nov, 2017 1 commit
    • Martin Flöser's avatar
      Add support for zwp_idle_inhibit_manager_v1 · 9520c2f2
      Martin Flöser authored
      Summary:
      This protocol allows to indicate that a wl_surface should inhibit idle
      actions such as DPMS, screen locking if the surface is visible.
      
      The protocol is quite simple: it just creates an IdleInhibitor for a
      Surface. If such an IdleInhibitor exists the Surface is considered to
      inhibit idle.
      
      On the server side it is also exposed like that through the API. The
      IdleInhibitorInterface is private to the library and only
      SurfaceInterface is extended to expose whether it currently inhibits
      idle.
      
      CCBUG: 385956
      
      Test Plan: New test case added
      
      Reviewers: #frameworks, #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D8396
      9520c2f2
  29. 26 Aug, 2017 1 commit
    • David Edmundson's avatar
      Update SurfaceInterface outputs when an output global gets destroyed · 16f4486c
      David Edmundson authored
      Summary:
      As per existing TODO.
      
      A new signal is added on Global to emit so we can process the result
      whist we still have a valid object. The name is overly explicit to try
      and logically separate it from QObject::destroyed().
      
      Test Plan: Updated existing unit test.
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: graesslin, anthonyfieroni, plasma-devel, #frameworks
      
      Tags: #frameworks, #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D7531
      16f4486c
  30. 24 Nov, 2016 1 commit
    • Martin Flöser's avatar
      Implementation of PointerConstraints protcol · a6825301
      Martin Flöser authored
      Summary:
      The pointer constraints protocol is an unstable protocol and thus
      the implementation follows the semantics of unstable protocols.
      
      The protocol allows to create a constraint on the pointer - either a
      lock or a confinement on a surface. Those are not activated at once, but
      when the compositor actively grants it.
      
      During lock no further pointer motion is emitted, during confinement the
      pointer is kept in a certain area.
      
      This implements T4451.
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D3466
      a6825301
  31. 16 Nov, 2016 1 commit
  32. 13 Sep, 2016 1 commit
    • Martin Flöser's avatar
      Add support for Surface enter/leave events · 4f9dae46
      Martin Flöser authored
      Summary:
      This change implements support for the wl_surface events enter and
      leave. Those events are emitted whenever a surface becomes visible on
      an output by e.g. mapping the surface, moving or resizing it. Similar
      the leave is sent whenever the surface is no longer on an output.
      
      The server side is not yet fully complete yet. It also needs to emit
      when the client binds the output another time and needs to send a
      leave before destroying the output.
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D2528
      4f9dae46
  33. 30 May, 2016 1 commit
    • Martin Flöser's avatar
      [server] Standardize the destructor request handling for Resources · 03594de1
      Martin Flöser authored
      Summary:
      This change standardizes the behavior regarding the destructor request.
      
      The destructor should destroy the resource and nothing else. The
      Wayland library invokes the static unbind method once the resource is
      destroyed. The implementation provided by Resource::Private::unbind
      triggers a delete later on the Resource. So there is no need to trigger
      a deleteLater from the destructor request callback.
      
      This change adds a generic implementation to Resource::Private which is
      now used by all inheriting classes replacing the custom implementations.
      
      Test Plan:
      For a few Resources the test is extended to ensure that the Resource
      gets deleted on server side.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1679
      03594de1