1. 16 Jul, 2020 1 commit
  2. 15 Jul, 2020 1 commit
  3. 23 Jun, 2020 1 commit
  4. 03 Jun, 2020 1 commit
  5. 28 May, 2020 1 commit
  6. 26 May, 2020 3 commits
    • David Edmundson's avatar
      Add DataControl iface · d8b553e7
      David Edmundson authored
      Summary:
      This patch makes use of wlroot's DataControl interface to support
      clipboard management.
      
      Unlike wl_data_device clipboards are sent on every change to all
      watchers.
      If the data device has a selection set it updates immediately.
      
      Because it was started a year ago it uses the existing style of
      wrapping objects. The unit test uses the new approach.
      
      Test Plan:
      Updated kwin
      used wlroot's wl-copy, wl-paste which are xclip replacements to
      show that the clipboard updated correctly
      
      Reviewers: #kwin
      
      Differential Revision: https://phabricator.kde.org/D29330
      d8b553e7
    • David Edmundson's avatar
      Introduce AbstractDataSource round the DataSourceInterface · e08b201b
      David Edmundson authored
      Summary:
      Clipboard managers and middle click paste are new protocols.
      
      We want to be able to copy from a clipboard manager to a regular
      clipboard and vice versa without duplicating loads of code.
      
      If we support kliper's "syncronise contents of the clipboard and
      selection" inside the compositor that would become an unmanageable amount
      of combinations.
      
      It also potentially allows the idea of our XWayland bridge not being a
      wayland client and simplifying that code.
      
      Test Plan: Unit test passes
      
      Reviewers: #kwin
      
      Subscribers: zzag
      
      Differential Revision: https://phabricator.kde.org/D29329
      e08b201b
    • David Edmundson's avatar
      Manage active selection as active DataSource than DataDevice · f9da1809
      David Edmundson authored
      Summary:
      A DataDevice will have zero or one active DataSource as the seclection.
      
      In the existing code we track the current data device then update it to
      the newest data device
      when the source inside a data device changes.
      
      If we store the active data source inside Seat instead of the device
      everything becomes
      somewhat simpler and safer.
      
      An entire unit test vanishes as that case of an externally set
      DataDevice with no source
      can no longer happen.
      
      There's also a lot of duplication that's been merged in this patch so we
      have one path.
      
      There are some technical behavioural changes in particular we do cleanup
      when the
      source vanishes rather than the data device, but if anything that seems
      safer and more correct.
      
      It's a precursor for introducing an abstraction class round the source
      without needing to meddle
      with too much code.
      
      Test Plan: Relevant unit tests passed, ran with it for a while with no
      issue.
      
      Reviewers: #kwin
      
      Differential Revision: https://phabricator.kde.org/D29328
      f9da1809
  7. 18 May, 2020 2 commits
    • David Edmundson's avatar
      Support mulitple data devices on a single client · 379b72d4
      David Edmundson authored
      Summary:
      Firefox has two wl_data_devices. One in firefox code one in GTK code.
      Both need to get data offers.
      
      I've left handling the case for multiple data devices and drags to make
      this patch feasible to put into 5.19 and I didn't want to make this
      patch invasive.
      
      Test Plan:
      Firefox in wayland
      WAYLAND_DEBUG=1 firefox |& grep data
      Shows now both created devices get offers
      Also I can paste
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: meven, ngraham, zzag
      
      Differential Revision: https://phabricator.kde.org/D29720
      379b72d4
    • David Edmundson's avatar
      Support mulitple data devices on a single client · 31ea954b
      David Edmundson authored
      Summary:
      Firefox has two wl_data_devices. One in firefox code one in GTK code.
      Both need to get data offers.
      
      I've left handling the case for multiple data devices and drags to make
      this patch feasible to put into 5.19 and I didn't want to make this
      patch invasive.
      
      Test Plan:
      Firefox in wayland
      WAYLAND_DEBUG=1 firefox |& grep data
      Shows now both created devices get offers
      Also I can paste
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: ngraham, zzag
      
      Differential Revision: https://phabricator.kde.org/D29720
      31ea954b
  8. 29 Apr, 2020 2 commits
  9. 19 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Pass a dedicated fd to each keyboard for the xkb keymap · 6bfa71d8
      Vlad Zahorodnii authored
      Summary:
      To better isolate the clients from each other eachh KeyboardInterface
      creates it's own dedicated temporary file and sends the fd for this
      temporary file to the client. This means the memory for the keymap is no
      longer shared between all clients, every client has an own copy.
      
      To support this the existing API to set the keymap is deprecated and
      replaced by a new method setKeymapData which takes the content of the
      keymap as a byte array. The now deprecated method which takes a file
      descriptor is changed to use the new setKeymapData method. For that it
      reads the content of the file.
      
      The implementation in KeyboardInterface to create the file descriptor is
      based on the implementation of KWin. As I implemented the change in KWin
      (see 3b4c508ee36ac74c37e77fcaa14d106397ad2994) it is not a problem from
      GPL vs LGPL perspective.
      
      The change includes test cases to verify that the content of the keymap
      is properly passed to the client and that the memory is no longer shared.
      
      BUG: 381674
      
      Reviewers: #kwin, #frameworks, davidedmundson, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: plasma-devel, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D14910
      6bfa71d8
  10. 16 Mar, 2020 1 commit
  11. 23 Jan, 2020 1 commit
  12. 14 Sep, 2019 1 commit
  13. 12 Sep, 2019 1 commit
  14. 17 May, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Allow compositors to send discrete axis values · ddff2c06
      Vlad Zahorodnii authored
      Summary:
      So far not all v5 features were implemented because most of them are
      optional. But given that XWayland needs axis_discrete event maybe it's
      time to implement them.
      
      CCBUG: 404152
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, mthw, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D18933
      ddff2c06
  15. 06 Feb, 2019 2 commits
    • 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
    • Roman Gilg's avatar
      [server] Add selectionChanged signal · 8caff837
      Roman Gilg authored
      Summary: This signal notifies a compositor about selection changes on a seat.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D15023
      8caff837
  16. 31 Jan, 2019 1 commit
  17. 02 Dec, 2018 2 commits
    • Roman Gilg's avatar
      [server] Touch drag support · 09b5adee
      Roman Gilg authored
      Summary: Adds functionality to do drag and drop with touch screens.
      
      Test Plan: Manually. Autotest planned.
      
      Reviewers: #kwin, #frameworks, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D15464
      09b5adee
    • Roman Gilg's avatar
      [server] Allow multiple touch interfaces per client · 7bb2a225
      Roman Gilg authored
      Summary:
      The touch related code in the seat interface class has been for no apparent
      reason very different to pointer and keyboard code.
      
      This patch makes touch related code more similar and by that allows a client
      to receive touch events through multiple interfaces.
      
      Test Plan: Manually and auto tests still pass.
      
      Reviewers: #kwin, #frameworks, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D15443
      7bb2a225
  18. 18 Sep, 2018 1 commit
  19. 04 Mar, 2018 1 commit
    • Martin Flöser's avatar
      [server] Add support for the frame semantics of Pointer version 5 · b6bd28ab
      Martin Flöser authored
      Summary:
      This change implements the required changes for wl_seat version 5.
      There seem to be applications which require version 5 and refuse to
      start if the server doesn't provide it. Thus we need to provide it.
      
      The main difference with version 5 is that pointer need to send a
      frame event after each logical group of events. As we don't support the
      new events from version 5 yet, we just emit the frame after each event
      and implement the suggested semantics for the enter/leave behavior.
      
      To really make use of this, we will have to implement additions in the
      API and then in KWin to expose the new API elements. But to just support
      the semantics we don't need it.
      
      BUG: 389189
      FIXED-IN: 5.45
      
      Test Plan: Extended autotest
      
      Reviewers: #kwin, #plasma, #frameworks
      
      Subscribers: plasma-devel
      
      Tags: #frameworks, #plasma
      
      Differential Revision: https://phabricator.kde.org/D10235
      b6bd28ab
  20. 25 Feb, 2018 1 commit
    • Martin Flöser's avatar
      [server] Properly handle the situation when the DataSource for a drag gets destroyed · 2dfe16d7
      Martin Flöser authored
      Summary:
      This addresses the following situation:
      1. Start drag on a QtWayland based window
      2. Press escape
      3. Release mouse
      
      -> this results in a crash. The main reason for this is that QtWayland
      destroys the DataSource in step 2 and KWayland did not expect this at
      all. The drag and drop operation continued and results in step 3 in the
      drag target to request data from the no longer existing DataSource.
      
      This change addresses the root of the problem by cancelling the drag
      operation when the DataSource gets destroyed.
      
      BUG: 389221
      FIXED-IN: 5.44
      
      Test Plan:
      New test case exposing the problem and manual testing with
      kwin_wayland and dolphin (based on bug report)
      
      Reviewers: #frameworks, #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #frameworks, #plasma
      
      Differential Revision: https://phabricator.kde.org/D10142
      2dfe16d7
  21. 26 Dec, 2017 1 commit
    • Martin Flöser's avatar
      Add support for version 3 of data device manager interface · a715a6cd
      Martin Flöser authored
      Summary:
      The main difference compared to version 2 is additional drag and drop
      actions. The source and destination can negotiate whether the data
      should be copied or moved or the user should be asked for either or.
      This seems to be important for GTK, but is not yet implemented in Qt.
      
      The main motivation for adding support is that it is required by SDL to
      launch on Wayland.
      
      BUG: 386993
      
      Test Plan: Extended test case, sdl apps now start
      
      Reviewers: #frameworks, #plasma, #kwin
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D9136
      a715a6cd
  22. 19 Jul, 2017 1 commit
  23. 24 Nov, 2016 2 commits
    • Martin Flöser's avatar
      [server] Fix regression in SeatInterface::end/cancelPointerPinchGesture · 0232a493
      Martin Flöser authored
      Regression with 1c6c2ee2 which removed a
      needed source code line.
      
      Thanks build.kde.org!
      0232a493
    • Martin Flöser's avatar
      [server] Reduce overhead of pointersForSurface · 1c6c2ee2
      Martin Flöser authored
      Summary:
      In SeatInterface we need to get all PointerInterfaces related to a given
      Surface (Client) and call a method on it. The implementation we had so
      far went through all Pointers and put all PointerInterfaces into a new
      temporary QVector. In most cases all we did then was iterating over the
      returned vector.
      
      Which means we created a temporary vector for nothing.
      
      This change implements a kind of std::for_each with the constraints of
      the previously used pointersForSurface which does the check that Surface
      is not null and that the client matches. If a PointerInterface is found
      for that, the passed in method is invoked on it.
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D3295
      1c6c2ee2
  24. 07 Nov, 2016 1 commit
    • Martin Flöser's avatar
      Implementation of PointerGestures protocol · 75acb783
      Martin Flöser authored
      Summary:
      Pointer gestures are created for a pointer and there are two types of
      gestures: swipe and pinch.
      
      At a given time there can only be one active gesture. The implementation
      in SeatInterface ensures that there can only be one active gesture.
      
      Each gesture consists of a start event, 0 to multiple update events and
      an end event. The end can also be a cancel. To better support this the
      implementation doesn't follow the protocol and splits end and cancel
      into dedicated methods in the server side and into dedicated signals in
      the client side.
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D3169
      75acb783
  25. 24 Oct, 2016 3 commits
    • Martin Flöser's avatar
      [server] Fix crash on updating focused keyboard surface · 4f100d2a
      Martin Flöser authored
      Summary:
      In case the current selection does not have a DataSourceInterface
      updating the focused keyboard surface resulted in a crash. The current
      selection is sent to the DataDeviceInterface of the newly focused
      client and thus a DataOfferInterface would be created for a null
      DataSourceInterface.
      
      This is a similar fix as D3148 and D3149.
      
      Test Plan: Test case added which used to crash before
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D3150
      4f100d2a
    • Martin Flöser's avatar
      [server] Fix possible crash on creation of DataDevice · b03cda2b
      Martin Flöser authored
      Summary:
      This is a similar condition as D3148. If a DataDeviceInterface is
      created for the currently focused keyboard Surface the current selection
      is sent to the new DataDeviceInterface. If the current selection does
      not have a DataSourceInterface a DataOfferInterface for a null
      DataSourceInterface would be created and result in a crash.
      
      This change verifies that there is a DataSourcInterface on the current
      selection prior to sending out the selection.
      
      Test Plan:
      A test case is added which simulates the condition by
      using two clients.
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D3149
      b03cda2b
    • Martin Flöser's avatar
      [server] Ensure we have a DataSource on the DataDevice in setSelection · e99cc6da
      Martin Flöser authored
      Summary:
      SeatInterface provides a way to set the current selection. This method
      did not verify whether the new DataDeviceInterface actually has a
      DataSourceInterface. If there is no DataSourceInterface on that
      DataDeviceInterface the selection should not be sent to the current
      selection owner. This results in a crash as DataOfferInterface
      (correctly) doesn't expect the passed in DataSourceInterface to be null.
      
      To ensure we don't hit this again the DataOfferInterface ctor gained an
      Q_ASSERT to validate the DataSourceInterface.
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D3148
      e99cc6da
  26. 17 Oct, 2016 1 commit
  27. 11 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Implement support for the relative pointer protocol · 6dd6729f
      Martin Flöser authored
      Summary:
      This change implements the zwp_relative_pointer_v1 protocol which allows
      to send relative motion events.
      
      The (unstable) protocol consists of a RelativePointerManager which
      creates RelativePointers for a given Pointer. This interface currently
      only has one event to report the relative motion. It carries the delta,
      the non-accelerated-delta and a timestamp in microsends granularity.
      
      On the server side the implementation is mostly internal. Once a
      RelativePointerManagerInterface is created one can send relative motion
      events through the SeatInterface. The SeatInterface takes care of
      sending it to the responding RelativePointerInterface. The protocol does
      not restrict the sending of "normal" and relative motion events. Thus it
      can be combined in any way one wants. This allows to have a rather
      simple implementation. A user of the SeatInterface can just start to
      feed the relative motion events (if the information is available) to the
      SeatInterface together with the pointer events.
      
      On client side a new RelativePointerManager and RelativePointer class
      are added. The RelativePointerManager creates the RelativePointer for a
      given Pointer. The event sent to RelativePointer is transformed in a
      normal signal.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D2978
      6dd6729f
  28. 10 Oct, 2016 1 commit
    • Martin Flöser's avatar
      [server] Cancel previous selection from SeatInterface::setSelection · 5d6ab2c2
      Martin Flöser authored
      Summary:
      When changing the selection the previous selection needs to be
      cancelled. This is already done in the "normal" updating of the
      selection. If the previous selection doesn't get cancelled QtWayland is
      not able to accept anything new from the clipboard. The setSelection
      didn't cancel it yet, due to that copy from Xwayland to QtWayland
      windows doesn't work in KWin as KWin uses the setSelection call for the
      Xwayland clipboard.
      
      With this change the cancelling of previous selection is moved into a
      dedicated method and called from the normal way and the setSelection
      way.
      
      Reviewers: #plasma_on_wayland, bshah
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D2997
      5d6ab2c2
  29. 06 Oct, 2016 1 commit
    • Martin Flöser's avatar
      [server] Send key events to all wl_keyboard resources of a client · 862bb68e
      Martin Flöser authored
      Summary:
      This is what Weston does. With this change clients can create multiple
      wl_keyboard instances and thus get events reported to all of them. This
      will be needed to e.g. support KModifierKeyInfo on Wayland.
      
      Similar changes are probably also needed for pointer and touch.
      
      Test Plan:
      Auto test for seat still passes. A custom change to kscreenlocker
      is able to report whether caps lock is on with this change.
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D2963
      862bb68e
  30. 15 Sep, 2016 1 commit
    • Martin Flöser's avatar
      [server] Don't send key release for not pressed keys and no double key press · 98628f93
      Martin Flöser authored
      Summary:
      This change makes use of the internal key state in better way. If a
      key is not considered pressed, no key release is sent. This can happen
      for example if the compositor grabs a key press (global shortcut) but not
      the release. The Wayland client cannot do anything with the release as it
      never got the press. Thus it doesn't make sense to send the release.
      
      Similar if a key is already pressed, it doesn't make sense to send
      another press event. This ensures that if the server sends in repeating
      key presses they are filtered out. Key repeat is handled on client side.
      Also if several physical keys send the same key code, pressing them at
      the same time won't send double press/release event.
      
      This change might cause regressions in KWin in case KWin does not handle
      the situation correctly. But that would be a bug in KWin which needs to
      be fixed there. If it causes regressions the bug might have shown in
      other situations as well.
      
      BUG: 366625
      FIXED-IN: 5.27
      
      Reviewers: #plasma_on_wayland, #kwin
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2786
      98628f93
  31. 14 Sep, 2016 1 commit
    • Martin Flöser's avatar
      [server] When replacing the clipboard selection previous DataSource needs to be cancelled · 81635159
      Martin Flöser authored
      Summary:
      According to the Wayland documentation a data source needs to be
      cancelled whenever it is no longer valid. A reason for no longer being
      valid is that the data source has been replaced by another data source.
      
      So far KWayland did not implement this aspect which resulted in clipboard
      breaking in QtWayland applications. As soon as one copied once from an
      application it was no longer possible to paste to it from another
      application.
      
      With this change the data source gets properly cancelled and also
      ensured that the server code doesn't run into a possible crash condition
      when trying to cancel an already unbound data source.
      
      BUG: 368391
      
      Reviewers: #plasma_on_wayland
      
      Subscribers: plasma-devel
      
      Tags: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D2743
      81635159