1. 24 Nov, 2016 1 commit
    • Martin Flöser's avatar
      [server] Reduce overhead of pointersForSurface · 1c6c2ee2
      Martin Flöser authored
      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
  2. 23 Nov, 2016 1 commit
  3. 16 Nov, 2016 1 commit
  4. 15 Nov, 2016 1 commit
  5. 10 Nov, 2016 1 commit
    • Martin Flöser's avatar
      [tools/generator] Generate enum FooInterfaceVersion on server side · 7e45316b
      Martin Flöser authored
      With this change the generator is able to detect whether an interface
      follows the unstable semantics. In that case the header file on server
      side looks different. An enum needs to be generated containing the
      interface version. Each of the generated classes has a new method
      interfaceVersion returning that enum. The ctor of the class is protected
      instead of private.
      So far only the header side is adjusted. The implementation currently
      generates not matching code.
  6. 08 Nov, 2016 6 commits
  7. 07 Nov, 2016 3 commits
    • Martin Flöser's avatar
      Fix build - KWayland_SOURCE_DIR instead of KWAYLAND_SOURCE_DIR · 600e7216
      Martin Flöser authored
      Change was prepared prior to project name change. Sorry about breaking.
    • Martin Flöser's avatar
      Implementation of PointerGestures protocol · 75acb783
      Martin Flöser authored
      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
    • Tobias C. Berner's avatar
      Include <errno.h> to fix build on FreeBSD · 70ba7718
      Tobias C. Berner authored
      /wrkdirs/usr/ports/x11/kf5-kwayland/work/kwayland-5.28.0/src/client/plasmawindowmanagement.cpp:489:25: error: use of undeclared identifier 'errno'
              if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) {
      /wrkdirs/usr/ports/x11/kf5-kwayland/work/kwayland-5.28.0/src/client/plasmawindowmanagement.cpp:489:34: error: use of undeclared identifier 'EAGAIN'
              if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) {
      Reviewers: graesslin, bshah
      Reviewed By: bshah
      Subscribers: plasma-devel
      Tags: #plasma_on_wayland
      Differential Revision: https://phabricator.kde.org/D3289
  8. 05 Nov, 2016 1 commit
  9. 03 Nov, 2016 2 commits
  10. 28 Oct, 2016 5 commits
    • Harald Sitter's avatar
      Remove /KF5 include directory injection · 07ebc586
      Harald Sitter authored
      This is ancient code that is outright wrong most of the time and at best
      just incredibly unnecessary.
      It is also not present in the great majority of frameworks due to this.
      Its wrongness comes from the fact that it hardcodes the installation path,
      which breaks relocatability of the KF5 tree as it will always attempt to
      find the include dir $PREFIX/KF5 (e.g. /usr/include/KF5), which may or may
      not exist given that the tree was relocated.
      Worse yet, in a cross-building scenario we maybe for example
      build on ARM and install to /usr but for cross building take the entire ARM
      tree and shift it into /arm/usr/. If we then crossbuild on that tree the
      bogus include list in this framework will make sure that we always search
      in /usr/include/KF5 and thus potentially load a !ARM header simply because
      the relevant ARM header was not installed etc.. Similarly of course a
      build in $HOME can pick up /usr/include/KF5 headers because the home ones
      are missing, causing unexpected results.
      This happens whenever the KDE_INSTALL_INCLUDEDIR_KF5 var is absolute, which
      it usually is.
      On top of all that the premise of the code in question is flawed. It seeks
      to add $PREFIX/$KF5INCLUDES to the search paths (e.g. /usr/include/KF5).
      This is unnecessary because the target itself is properly installed via
      cmake's install(TARGETS ... EXPORT ...) function [1]. This function has
      smart functionality built in which will add the passed INCLUDES destination
      to the INTERFACE_INCLUDE_DIRECTORIES property of the targets (i.e. what
      the useless code wants to do) [2].
      So what happens is that we install the target to the
      KF5 locations, which has "include/KF5" as INCLUDES location,
      thus causing the correct path to be added to the includes list of the
      Targets.cmake file.
      In particular thanks to more internal magic in cmake it will do so with
      automatically resolved root paths such that the installed tree is
      relocatable and able to relatively find the other KF5/* headers. So it
      does what the code in question wants to do, just correctly.
      Since cmake automatically takes care of injecting $prefix/include/KF5 we
      can simply get rid of the wrong custom inejection code. This makes the
      generated cmake file find the correct include/KF5/ directory and stops it
      from always expecting a /usr/include/KF5/ directory to be present.
      [1] https://cmake.org/cmake/help/v3.0/command/install.html
      [2] https://cmake.org/cmake/help/v3.0/command/install.html
      > The INCLUDES DESTINATION specifies a list of directories which will be
      > added to the INTERFACE_INCLUDE_DIRECTORIES target property of the
      > <targets> when exported by the install(EXPORT) command.
      REVIEW: 129273
      CHANGELOG: Improved relocatability of CMake export
    • Martin Flöser's avatar
      [autotests] Fix TestWaylandConnectionThread::testConnectFdNoSocketName · fa167587
      Martin Flöser authored
      Same as e2be6200 for the next test
    • Martin Flöser's avatar
      [autotest] fix WaylandConnectionThread::testConnectFd · e2be6200
      Martin Flöser authored
      The test destroyed the connection prior to destroying registry and event
      queue. Thus causing problems. Hopefully this change fixes the segfault
      on build.kde.org.
    • Martin Flöser's avatar
      [autotests] Try fixing TestWaylandOutputManagement · 24bce577
      Martin Flöser authored
      The test has KWayland::Client objects like Registry as member variables
      of the test object. This causes the objects to be destroyed with the
      dtor after cleanupTestCase is run which destroys the connection and
      Wayland server. At least on the CI system this seems to cause problem.
      In general our tests do not keep any state around, especially not
      KWayland::Client objects. The normal way is to have a new dedicated
      client connection for every test method. This test doesn't follow this
      approach at all.
      In case that this change does not fix the test and still crashes on
      build.kde.org the only option is to drop the test and replace it by a
      new variant which follows the approach of other tests.
    • Martin Flöser's avatar
      [autotests] Improve TestWaylandOutputManagement::cleanupTestCase · 35a7a1de
      Martin Flöser authored
      Reorder the cleanup code. It doesn't make sense to delete the client
      side objects after deleting the server side objects. This might be a
      reason for the failing tests on build.kde.org.
  11. 26 Oct, 2016 1 commit
  12. 25 Oct, 2016 2 commits
  13. 24 Oct, 2016 3 commits
    • Martin Flöser's avatar
      [server] Fix crash on updating focused keyboard surface · 4f100d2a
      Martin Flöser authored
      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
      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
    • Martin Flöser's avatar
      [server] Fix possible crash on creation of DataDevice · b03cda2b
      Martin Flöser authored
      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
    • Martin Flöser's avatar
      [server] Ensure we have a DataSource on the DataDevice in setSelection · e99cc6da
      Martin Flöser authored
      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
  14. 20 Oct, 2016 1 commit
    • Martin Flöser's avatar
      [tools/generator] Improve resource destruction on server side · efbd11b8
      Martin Flöser authored
      The generator misdetected the destructor Requests by looking at the
      arguments instead of the type of the request.
      In addition the destructor handling changed in KWayland::Server since
      the generator got created. There is now a shared implementation for the
      Resource destruction. The generator is adjusted to generate the code for
      that and implements the destruction for the Global resource destruction.
  15. 18 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Add request to have focus in a PlasmaShellSurface of Role Panel · ee3f47a5
      Martin Flöser authored
      By default a panel does not take focus. But there are panels which
      should get keyboard focus. Examples in a Plasma session are the widget
      This change adds a new request to PlasmaShell interface to specify
      whether a panel should get focus. The compositor can use this request to
      decide whether to pass focus to a panel.
      Reviewers: #plasma_on_wayland
      Subscribers: plasma-devel
      Tags: #plasma_on_wayland
      Differential Revision: https://phabricator.kde.org/D3035
  16. 17 Oct, 2016 6 commits
    • Martin Flöser's avatar
      Add auto-hiding panel support to PlasmaShellSurface interface · e772a3e9
      Martin Flöser authored
      This change adds support for auto-hiding panels. A PlasmaShellSurface
      with Role Panel and PanelBehavior AutoHide can request to get
      auto-hidden at a screen edge. The compositor will then not show the
      surface although it is still mapped and will show it again once the
      screen edge gets triggered.
      The interface is extended by one new request to allow the client to
      request the hiding of the surface. In addition two events are added to
      inform the client when the surface got hidden and when it got shown
      Reviewers: #plasma_on_wayland
      Subscribers: plasma-devel
      Tags: #plasma_on_wayland
      Differential Revision: https://phabricator.kde.org/D3007
    • Martin Flöser's avatar
      Fix build (try 1) · 7d59e91f
      Martin Flöser authored
      Sorry, it compiled on my system. Trying to fix.
    • Martin Flöser's avatar
      Support passing generic QIcon through PlasmaWindow interface · bd2b9665
      Martin Flöser authored
      Especially for Xwayland windows the compositor might not have a themed
      icon name. Resulting in a task manager not having dedicated icons for
      Xwayland windows.
      This change deprecates the way how a compositor is supposed to set the
      window icon. Instead of passing the themed icon name, it is now supposed to
      pass the QIcon. In case it's a themed icon the existing way to pass to
      the client is used.
      Otherwise a new event is used to inform the client that there is an icon
      - no data is transmitted at this point. The client can then create a
      file descriptor and pass it to the compositor. The compositor serializes
      the icon into the file descriptor and the client can read from it. This
      all happens transparently on client side there is no api change at all.
      The writing and reading of the icon is done in a thread. Due to that
      Qt5::Concurrent is now a required dependency instead of an optional
      Reviewers: #plasma_on_wayland, hein
      Subscribers: plasma-devel
      Tags: #plasma_on_wayland
      Differential Revision: https://phabricator.kde.org/D3049
    • Martin Flöser's avatar
      [server] Implement the generic window property in QtSurfaceExtension · fe95610a
      Martin Flöser authored
      Qt supports setting generic data on a QWindow. This change implements
      the callback properly and forwards the property to the surface extension
      instance. This allows the compositor to e.g. listen to
      DynamicPropertyChangeEvents and get access to all additional set
      Reviewers: #plasma_on_wayland
      Subscribers: plasma-devel
      Tags: #plasma_on_wayland
      Differential Revision: https://phabricator.kde.org/D3045
    • Martin Flöser's avatar
      [client] Add methods to get ShellSurface from a QWindow · 75478ec7
      Martin Flöser authored
      This is similar to what already exists for Surface. With this methods
      it's possible to get a ShellSurface from an existing QWindow and to
      perform low level native calls directly for the ShellSurface.
      Similar calls will also be needed for XdgShellSurface, though the
      xdg_shell_surface is not yet available through the native interface.
      Test Plan: Used in breeze to trigger window moving
      Reviewers: #plasma_on_wayland
      Subscribers: plasma-devel
      Tags: #plasma_on_wayland
      Differential Revision: https://phabricator.kde.org/D3018
    • Martin Flöser's avatar
      [server] Send pointer events to all wl_pointer resources of a client · 79cf85cf
      Martin Flöser authored
      This is what Weston does. With this change clients can create
      multiple wl_pointer instances and thus get events reported to all of them.
      This will be needed to e.g. support drag on empty area in Breeze on Wayland.
      A similar change was done for wl_keyboard already in 862bb68e.
      Test Plan: Seat auto test still passes
      Reviewers: #plasma_on_wayland
      Subscribers: plasma-devel
      Tags: #plasma_on_wayland
      Differential Revision: https://phabricator.kde.org/D3016
  17. 12 Oct, 2016 1 commit
  18. 11 Oct, 2016 3 commits