1. 07 Apr, 2016 1 commit
    • Martin Flöser's avatar
      [server] Pass keyboard focus to child surface on pointer click · 55f3a295
      Martin Flöser authored
      If the focused pointer and keyboard surface is the same we use pointer
      clicks as a hint to which child surface should have keyboard focus.
      Keyboard focus handling for sub surfaces is rather limited overall.
      We just don't have a good model on how to determine which child surface
      should get the keyboard focus. When passing focus to a surface there
      is no way to know which of the sub-surfaces should get the focus.
      Ideally the client should handle this, but that's just not the case.
      The best we have is a reference through the pointer. But that's of
      course also limited. Keyboard focus passed to the surface for another
      reason (Alt+Tab) cannot select the proper sub-surface without interaction
      from another input device.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1330
  2. 06 Apr, 2016 3 commits
    • Martin Flöser's avatar
    • Martin Flöser's avatar
    • Martin Flöser's avatar
      [server] Support sub-surfaces from PointerInterface · 14653e63
      Martin Flöser authored
      The idea behind this change is to make the existance of sub-surfaces
      an implementation detail for pointer events. The user of the library
      does not need to care about on which sub-surface the pointer is on.
      It only needs to care about the main surface and passes the focus to
      the main surface.
      Internally the PointerInterface takes care of sending the enter to
      the sub-surface at the current pointer position. Also whenever the
      pointer position changes, the PointerInterface evaluates whether it
      triggered a change for the focused sub-surface and sends enter/leave
      events accordingly. If the focused sub-surface does not change, it
      sends motion events as normally, but of course under consideration
      of the sub-surface position.
      Overall this means that from pointer usage perspective a user of the
      library doesn't need to care about the fact that there are sub-surfaces
      at all. The library does the correct thing for it.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1329
  3. 05 Apr, 2016 1 commit
  4. 04 Apr, 2016 4 commits
    • Martin Flöser's avatar
      [server] Add damage tracking feature to SurfaceInterface · 506bf3a3
      Martin Flöser authored
      This change introduces a damage tracking feature in SurfaceInterface.
      So far the SurfaceInterface only exposes the damage compared to the
      last attached buffer. But this is not always usefull for the user of
      the library. E.g. if:
      * server renders
      * client damages buffer and commits
      * client damages buffer and commits
      * server wants render
      In this situation the last damage information is not helpful to the
      user of the library. It would need the combined damage information over
      all attached buffers.
      The new API combines the damage of the two commits in the example above.
      The user of the library can then call resetTrackedDamage once it
      processed the current damage (e.g. by updating the OpenGL texture).
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1281
    • Martin Flöser's avatar
      [server] Workaround for QtWayland bug https://bugreports.qt.io/browse/QTBUG-52192 · 85209f3d
      Martin Flöser authored
      QtWayland doesn't map the parent sub-surfaces in a sub-surface tree.
      According to the spec this would mean also the child sub-surface is not
      mapped. But being strict according to the spec will make applications
      like SystemSettings fail badly. Embedded child windows will not be
      rendered and QtWayland is going to hard freeze. This is not acceptable,
      thus we need to workaround this QtWayland bug till it's fixed.
      It's worth mentioning that Weston as the reference compositor also
      doesn't handle this situation according to spec and renders the
      sub-surface. See https://bugs.freedesktop.org/show_bug.cgi?id=94735
      The difficult part for the workaround is to determine whether a surface
      should be considered unmapped. E.g. when the parent gets unmapped we need
      to really unmap it. But what's the difference between an unmapped parent
      surface which should be considered mapped and an unmapped parent surface
      which should be considered unmapped?
      The implementation goes with considering a new sub-surface always as
      mapped - independently of whether it ever got a buffer attached. As soon
      as it had a buffer attached and it gets unmapped again, it will go back
      to a standard conform way.
      The behavior now is not standard conform, thus the autotest is adjusted
      to have QEXPECT_FAIL for the now no longer standard conform areas.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1250
    • Martin Flöser's avatar
      [server] Don't emit unmapped if the Surface wasn't mapped · 62a43f0c
      Martin Flöser authored
      If a Surface doesn't have a buffer attached and a null buffer gets
      attached the buffer state doesn't really change. Thus neither the
      unmapped signal nor the damaged signal should not be emitted.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1261
    • Martin Flöser's avatar
      [autotest] Add test case for mapping/unmapping surfaces in a sub-surface tree · 6e956066
      Martin Flöser authored
      New test case which verifies the behavior when a surface is considered
      mapped or unmapped in a sub-surface tree.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1248
  5. 29 Mar, 2016 2 commits
  6. 24 Mar, 2016 3 commits
  7. 23 Mar, 2016 6 commits
    • Martin Flöser's avatar
      [server] Add a workaround for a freeze in QtWayland · 1934ea48
      Martin Flöser authored
      See: https://bugreports.qt.io/browse/QTBUG-52092
      Freeze happens if a sub-surface is rendered to before the main surface
      is rendered. The compositor has no chance to know that this is a window
      which needs to be rendered, thus the application might freeze without
      ever becoming visible.
      Famous example applications being affected: all kcms with a nested
      QQuickView. E.g.: kcmshell5 kwineffects
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1208
    • Martin Flöser's avatar
      [server] Add method to get to the main surface from a sub surface · 1304585f
      Martin Flöser authored
      Recursively go up to the main surface, that is the top level surface
      which doesn't have a parent.
      This is useful to know to which surface tree a sub-surface belongs to.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1207
    • Martin Flöser's avatar
      [server] Improve variable naming · 7ee80632
      Martin Flöser authored
      transformFactorChanged -> transforChanged. It's not a factor.
      Reviewed-By: sebas
    • Martin Flöser's avatar
      [server] Don't double buffer adding/removing of sub-surfaces · 92ca73a1
      Martin Flöser authored
      QtWayland doesn't commit the parent surface when creating a sub-surface.
      This results in a QtWayland application to freeze as it renders to the
      surface and waits for the frame rendered, which it will never get as the
      Compositor waits for the commit on the parent prior to mapping the
      To work around this behavior, we apply the adding/removing directly.
      The behavior around this is actually not fully documented, so QtWayland
      is not wrong per se. See:
      Once this is properly clarified and implemented in the Client, we should
      revert this change.
      Differential Revision: https://phabricator.kde.org/D1191
    • Martin Flöser's avatar
      [server] Add a subSurfaceTreeChanged signal to SurfaceInterface · 0ed3c438
      Martin Flöser authored
      The idea behind this signal is to notify whenever the tree of sub
      surfaces changes in a way that a repaint of the Surface is required.
      Possible situations are:
      * surface damaged
      * surface unmapped
      * subsurface added/removed
      * subsurface moved (position changed)
      * subsurface stacking changed
      Ideally it would be possible to provide the actual area which needs
      repainting, but due to the possible complexity of the tree, synced
      and desynced changes this doesn't look worth the effort. A user of
      the signal might trigger too many repaints with it, but if it really
      wants to be only notified about the actual changes, it can just track
      the individual sub-surfaces.
    • Martin Flöser's avatar
      [server] Cache the state of synchronized sub surfaces · a9331504
      Martin Flöser authored
      When committing the state of a sub-surface, the state should not
      be immediately applied if the sub-surface is in synchronized mode.
      Instead it should be cached and only applied after the parent surface's
      state is applied.
      To implement this the Surface::Private has now a third cached state
      buffer. When committing the state is either swapped between pending and
      current or pending and subSurfacePending. Once the parent state is
      applied the state is swapped between subSurfacePending and current.
      The logic for applying state changes is changed. Instead of copying the
      complete state object, the individual state changes are now copied and the
      source gets completely reset to default values. Only the children tree is
      copied back, as that list needs to be modified.
  8. 21 Mar, 2016 4 commits
    • Martin Flöser's avatar
      [server] Add a bool SubSurfaceInterface::isSynchronized() const · 43b7e10e
      Martin Flöser authored
      The mode is not sufficient to determine whether a SubSurface is in
      synchronized mode.
      Quoting spec:
      "Even if a sub-surface is in desynchronized mode, it will behave as in
      synchronized mode, if its parent surface behaves as in synchronized mode.
      This rule is applied recursively throughout the tree of surfaces.
      This means, that one can set a sub-surface into synchronized mode, and
      then assume that all its child and grand-child sub-surfaces are
      synchronized, too, without explicitly setting them."
    • Martin Flöser's avatar
      [server] Send frameRendered to all sub-surfaces · c1db900a
      Martin Flöser authored
      If a surface got rendered it implies that all sub-surfaces also got
      rendered. So pass the frameRendered to the complete sub-surface tree.
    • Martin Flöser's avatar
      [tests] Add a sub-surface test application · 710f9eaf
      Martin Flöser authored
      The test application creates a sub-surface tree consisting of overall
      three surfaces:
      * blue main surface
      * red sub surface
      * green sub surface to the red sub surface
      All surfaces are in synchronized mode. There is a timer to turn the
      green surface into yellow after five seconds.
    • Martin Flöser's avatar
      [client] Add setScale to Surface · c734cd5c
      Martin Flöser authored
      The wrapper for wl_surface::set_buffer_scale was still missing.
      Main reason for implementation is the need for the added auto-test.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1188
  9. 17 Mar, 2016 1 commit
  10. 16 Mar, 2016 2 commits
    • Martin Flöser's avatar
      Merge branch 'Plasma/5.6' · ad14280f
      Martin Flöser authored
    • Martin Flöser's avatar
      [client] Perform ConnectionThread::roundtrip through QPA interface · 36c5291b
      Martin Flöser authored
      In case the ConnectionThread is created from the QGuiApplication the
      roundtrip is performed through a function provided by the QPA plugin.
      If the QPA plugin does not provide such a function, the normal
      wl_display_roundtrip is used.
      This is mostly a helper for KWin. Plugins might call roundtrip from the
      main gui thread which results in a dead freeze of KWin. By providing this
      function through the native interface KWin can ensure it doesn't freeze
      and the plugin still gets the functionality of the roundtrip.
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1152
  11. 15 Mar, 2016 2 commits
  12. 12 Mar, 2016 2 commits
  13. 09 Mar, 2016 5 commits
  14. 03 Mar, 2016 1 commit
    • Martin Flöser's avatar
      [client] Add support for drag'n'drop · 8711453a
      Martin Flöser authored
      DataDevice exposes new methods to get the DataOffer provided through
      drag'n'drop and also signals to indicate the various changes on the
      DataDevice during drag'n'drop.
      This allows to add a first basic auto test for the drag'n'drop
      functionality covering both server and client side.
  15. 02 Mar, 2016 3 commits
    • Jonathan Riddell's avatar
      Update version number for 5.6.90 · 21f38b56
      Jonathan Riddell authored
    • Jonathan Riddell's avatar
      Update version number for 5.5.95 · 53832a14
      Jonathan Riddell authored
    • Martin Flöser's avatar
      [server] Implement support for drag'n'drop through pointer device · 413025c2
      Martin Flöser authored
      How drag'n'drop works on Wayland:
      When a surface has a pointer grab and a button pressed on the surface
      (implicit grab) the client can initiate a drag'n'drop operation on the
      data device. For this the client needs to provide a data source
      describing the data to be transmitted with the drag'n'drop operation.
      When a drag'n'drop operation is active all pointer events are interpreted
      as part of the drag'n'drop operation, the pointer device is grabbed.
      Pointer events are no longer sent to the focused pointer but to the
      focused data device. When the pointer moves to another surface an
      enter event is sent to a data device for that surface and a leave
      event is sent to the data device previously focused. An enter event
      carries a data offer which is created from the data source for the
      During pointer motion there is a feedback mechanism. The data offer
      can signal to the data source that it can or cannot accept the data
      at the current pointer position. This can be used by the client being
      dragged from to update the cursor.
      The drag'n'drop operation ends with the implicit grab being removed,
      that is the pressed pointer button which triggered the operation gets
      released. The server sends a drop event to the focused data device.
      The data transfer can now be started. For that the receiving client
      creates a pipe and passes the file descriptor through the data offer
      to the sending data source. The sending client will write into the
      file descriptor and close it to finish the transfer.
      Drag'n'drop could also be initiated through a touch device grab, but
      this is not yet implemented.
      The implementation in this change focuses on the adjustments for pointer.
      For the user of the library drag'n'drop is implemented in the
      SeatInterface. Signals are emitted whenever drag is started or ended.
      The interaction for pointer events hardly changes. Motion, button press
      and button release can still be indicated in the same way. If a button
      release removes the implicit grab the drop is automatically performed,
      without the user of the library having to do anything.
      The only change during drag and drop for the library user is that
      setFocusedPointerSurface is blocked. To update the current drag target
      the library user should use setDragTarget. Sending the enter/leave to the
      data device gets performed automatically.
      The data device which triggered the drag and drop operation is exposed
      in the SeatInterface. The user of the library should make sure to render
      the additional drag icon provided on the data device. At least QtWayland
      based applications will freeze during drag and drop if the icon doesn't
      get rendered.
      The implementation is currently still lacking the client side and due to
      that also auto test. It's currently only tested with QtWayland clients.
      Reviewers: #plasma, sebas
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1046