1. 07 Nov, 2018 1 commit
    • Martin Flöser's avatar
      Start xclipboard sync process from build dir if available · 7221864c
      Martin Flöser authored
      Summary:
      The xclipboard sync test times out on build.kde.org as KWin is not
      installed prior to running the tests. This is due to KWin not finding
      the executable for the clipboard sync helper.
      
      This change looks whether the binary exists in the same directory as
      KWin's executable. If it exists it is started instead of the hardcoded
      path in libexec.
      
      Test Plan: Run the test and verified the correct binary is loaded
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16732
      7221864c
  2. 01 Nov, 2018 1 commit
    • David Edmundson's avatar
      [wayland] Use the new plasma virtual desktop protocol · 7e8facc3
      David Edmundson authored
      Summary:
      implement virtual desktop support for Wayland.
      use the new virtual desktop protocol from D12820
      The VirtualDesktopManager class needed some big change in order
      to accomodate it, which is where most changes are.
      Other than that, it's mostly connections to wire up
      VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)
      
      Depends on D12820
      Other notable detail, is the client visibility updated to reflect the presence
      of the client in the plasmavirtualdesktop.
      (and the unSetDesktop concept)
      
      Test Plan: used a bit a plasma session together with D12820, D13748 and D13746
      
      Reviewers: #plasma, #kwin, graesslin, davidedmundson
      
      Reviewed By: #plasma, #kwin, davidedmundson
      
      Subscribers: hein, zzag, davidedmundson, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T4457
      
      Differential Revision: https://phabricator.kde.org/D13887
      7e8facc3
  3. 14 Sep, 2018 1 commit
    • David Edmundson's avatar
      Add XDG WmBase support · fcf9acfe
      David Edmundson authored
      Test Plan:
      Compiled latest GTK
      Ran gtk4-demo and used WAYLAND_DEBUG to confirm it used the correct
      shell
      tested a top level and a popup
      
      Reviewers: #plasma, romangg
      
      Reviewed By: #plasma, romangg
      
      Subscribers: romangg, mart, graesslin, zzag, kwin
      
      Tags: #kwin
      BUG: 398614
      FIXED-IN: 5.15.0
      
      Differential Revision: https://phabricator.kde.org/D13530
      fcf9acfe
  4. 18 May, 2018 1 commit
    • David Edmundson's avatar
      Add XDG Output support · 1403fcf3
      David Edmundson authored
      Test Plan:
      Very minimal expansion of unit tests which uses WaylandScreens
      Wrote mini app to debug actual output of xdg-output for testing the DRM code
      
      Main relevant user of this is xwayland > 1.20 which I don't have, so that
      part remains untested
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: romangg, graesslin, bshah, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T8501
      
      Differential Revision: https://phabricator.kde.org/D12243
      1403fcf3
  5. 23 Jan, 2018 1 commit
    • Martin Flöser's avatar
      Acknowledge the server side deco mode in WaylandServer not ShellClient · 339a08de
      Martin Flöser authored
      Summary:
      With GTK applications our code showed issues. With GTK the sequence for
      a menu or dialog window is:
       1. create surface
       2. create server side decoration
       3. request csd
       4. create xdg_shell_surface
      
      Which result in KWin to have the ServerSideDecoration object being
      created before the ShellClient is created. The connect for mode changed
      happens in ShellClient, which is too late to catch that the window
      requested client side decoration. Thus KWin created a decoration about
      things such as a menu.
      
      This change moves the acknowledge of the mode to WaylandServer. As we
      anyway always acknowledge the requested mode we can also do it there and
      don't require ShellClient to be present. Thus when the ShellClient is
      created the mode is properly reflected and no decoration is created.
      
      BUG: 389117
      FIXED-IN: 5.12.0
      
      Test Plan: Played a lot with evince
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D9967
      339a08de
  6. 10 Jan, 2018 1 commit
  7. 04 Jan, 2018 1 commit
  8. 27 Dec, 2017 1 commit
  9. 22 Dec, 2017 1 commit
  10. 30 Nov, 2017 1 commit
    • Martin Flöser's avatar
      Add support for new IdleInhibition protocol · ff2e8834
      Martin Flöser authored
      Summary:
      A small helper class is added which manages inhibiting idle for the
      ShellClients. So far only very basic functionality is added. That is
      only the inhibition on the Surface is followed. It is not yet checked
      whether the ShellClient is visible at all. That needs some changes in
      ShellClient.
      
      BUG: 385956
      FIXED-IN: 5.12
      
      Test Plan: New test case passes
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8856
      ff2e8834
  11. 19 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Add physicalSize to the Screens API · 02d3daf2
      Martin Flöser authored
      Summary:
      Allows to share the implementation in a better way and is a requirement
      to get the Screen implementation in the QPA plugin to be based on
      KWin::Screens instead of KWayland::Output.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8344
      02d3daf2
  12. 16 Oct, 2017 1 commit
  13. 13 Oct, 2017 1 commit
    • Marco Martin's avatar
      Make use of foreign protocol · 735fcc6e
      Marco Martin authored
      Summary:
      not sure if that is the right "parent" that has
      to be set, set the transient for surfaces that
      have setParentOf of an imported set
      
      Test Plan:
      m_XdgForeign->transientFor(surface()) finds the surface is expected,
      not sure how to test it further
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: luebking, graesslin, davidedmundson, plasma-devel, kwin, #kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D7521
      735fcc6e
  14. 05 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Ensure internal Wayland connection is properly setup before creating LockScreen integration · 31b5b7f9
      Martin Flöser authored
      With the new Wayland only mode we start too fast and it can happen that
      the initWithWorkspace is called before the client connection is fully
      setup. This would result in a crash in the idletime plugin once it tries
      to create a seat.
      
      To prevent this problem the code is split out into a dedicated method
      and only invoked if all interfaces have been announced on the internal
      connection.
      
      BUG: 385397
      FIXED-IN: 5.11.1
      31b5b7f9
  15. 30 Sep, 2017 1 commit
    • Martin Flöser's avatar
      Ensure internal Wayland connection is properly setup before creating LockScreen integration · 4c334098
      Martin Flöser authored
      With the new Wayland only mode we start too fast and it can happen that
      the initWithWorkspace is called before the client connection is fully
      setup. This would result in a crash in the idletime plugin once it tries
      to create a seat.
      
      To prevent this problem the code is split out into a dedicated method
      and only invoked if all interfaces have been announced on the internal
      connection.
      4c334098
  16. 25 Sep, 2017 1 commit
    • David Edmundson's avatar
      XdgV6 - Kwin side · e492f9e2
      David Edmundson authored
      Summary:
      Adds XDGV6 support for the kwin side.
      
      Popup placement support is limited to the stuff v5 had,
      a simple offset, rather than the awesome new positioner.
      
      But Qt doesn't make use of it yet either.
      Also ideally we should do all the positioning before sending the first
      configure, but again Qt doesn't actually do anything with that anyway.
      
      Also integrate pinging clients
      
      Test Plan: gtk3-demo  works nicely.
      
      Reviewers: #plasma, graesslin, mart
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: mart, graesslin, kwin, plasma-devel, #kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D6591
      e492f9e2
  17. 28 Jul, 2017 1 commit
  18. 29 Mar, 2017 1 commit
    • David Edmundson's avatar
      Set wayland output scale · fd58c68b
      David Edmundson authored
      Summary:
      Provides a virtual method in Screens where backends can supply the scale
      of each screen, this is then set on each output.
      
      For the X windowed backend this value is taken from a command line
      parameter.
      
      Test Plan:
      Ran windowed mode with --scale 1 and 2
      then kate --platform=wayland from another screen.
      On the latter case UI elements were scaled up correctly
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D3159
      fd58c68b
  19. 07 Feb, 2017 1 commit
    • Martin Flöser's avatar
      Support creation of PlasmaShellSurface prior to ShellSurface · 8edd0336
      Martin Flöser authored
      Summary:
      So far KWin did not support the sequence:
      1. Create wl_shell
      2. Create PlasmaShellSurface
      3. Create wl_shell_surface
      
      KWin only supported the case that the PlasmaShellSurface is the last
      thing to get created. This is rather limiting and can be considered a
      bug. At least we had a QEXPECT_FAIL auto test for this situation. So
      it was a known issue.
      
      This change should make it easier to support the QtWayland changes in
      Qt 5.8.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D4482
      8edd0336
  20. 17 Dec, 2016 1 commit
    • Martin Flöser's avatar
      Reduce code-duplication of socketpair in WaylandServer · a7f5c167
      Martin Flöser authored
      Summary:
      WaylandServer creates a socketpair for several Wayland connections. So
      far this duplicated code quite a bit.
      
      This change introduces one method to perform the socketpair and the
      error checking plus creating the server side ClientConnection from the
      pair.
      
      Test Plan: Tests still pass
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D3576
      a7f5c167
  21. 08 Dec, 2016 1 commit
    • Martin Flöser's avatar
      Implement support for pointer constraints · 0c5ca405
      Martin Flöser authored
      Summary:
      There are two types of constraints supported:
      1. Pointer confinement
      2. Pointer locking
      
      In the case of confinement the pointer is confined to a given region of
      the surface. This is comparable to general operation where the pointer
      is confined to the screen region.
      
      In the second case the pointer gets locked. That means it cannot move at
      all. No further position updates are provided, only relative motion
      events can go to the application. There is a hint about cursor position
      update on unlock which is not yet implemented in KWayland::Server, thus
      also not in this change.
      
      The implementation in KWin grants the requests for pointer constraints
      when the pointer enters the constrained region, either by pointer
      movement or by e.g. stacking order changes. There is no confirmation
      from user required to enter that mode. But we want to show an OSD when
      the pointer gets constrained, this is not yet implemented, though.
      
      Breaking an active constraint is relatively easy. E.g. changing the
      stacking order will break the constraint if another surface is under the
      cursor. Also (in case of confinement) moving the pointer to an
      overlapping window breaks the confinement. But as soon as one moves the
      pointer back to the window a constraint might get honoured again.
      
      To properly break there is a dedicated event filter. It listens for a
      long press of the Escape key. If hold for 3sec the pointer constraint is
      broken and not activated again till the pointer got moved out of the
      window. Afterward when moving in the pointer might activate again.
      
      The escape filter ensures that the key press is forwarded to the
      application if it's a short press or if another key gets pressed during
      the three seconds. If the three seconds way fires, the later escape
      release is not sent to the application.
      
      This basic interaction is also ensured through an added auto test.
      
      This change implements T4605.
      
      Test Plan: Added auto test and nested KWin Wayland with D3488
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D3506
      0c5ca405
  22. 07 Nov, 2016 1 commit
    • Martin Flöser's avatar
      Forward pointer gestures to Wayland server · b6af7772
      Martin Flöser authored
      Summary:
      This change implements forwarding the pointer gestures to the new API in
      SeatInterface.
      
      While screen is locked no gestures are forwarded to the server. Also
      locking the screen cancels any active gesture. Similar if areas inside
      KWin would start to intercept the gestures, they need to be cancelled on
      the Wayland SeatInterface.
      
      Test Plan: Not yet
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D3174
      b6af7772
  23. 26 Aug, 2016 1 commit
  24. 24 Aug, 2016 1 commit
    • Martin Flöser's avatar
      Move implementation of iconGeometry from ShellClient to AbstractClient · 455c5c07
      Martin Flöser authored
      Summary:
      This allows Client to use the Wayland-specific implementation if there
      is no icon geometry set through the X11 way. That way Xwayland windows
      have an icon geometry even if Plasma is using Wayland and setting the
      icon geometry in the Wayland way. Which is expected as Plasma is
      ignorant about the windowing system a PlasmaWindow uses.
      
      In order to move the code from ShellClient to AbstractClient
      WaylandServer gained a new findAbstractClient(Surface*) method which
      is just like findClient(Surface*) with the difference that it returns
      an AbstractClient instead of a ShellClient*.
      
      Test Plan:
      minimized/unminimized an X client on Wayland, verified
      animation is correct (though broken in general for minimize)
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2530
      455c5c07
  25. 16 Aug, 2016 1 commit
  26. 20 Jul, 2016 1 commit
    • Martin Flöser's avatar
      Announce output changes to Wayland for platforms not handling outputs · d0c488f4
      Martin Flöser authored
      Summary:
      Most platforms like the nested and virtual do not handle the outputs
      themselves and WaylandServer announces the Outputs to Wayland.
      
      So far this was static: at startup it got announced once to Wayland
      and any changes were not catched.
      
      This change makes WaylandServer listen to changes to the Screens and
      sync them to Wayland.
      
      Unfortunately KWin's internal Screen information is not sufficient to
      properly synchronize this to Wayland and also Wayland by not supporting
      adding/removing modes does not help.
      
      Thus the solution implemented here is to add new outputs reflecting the
      changes and then removing the old ones. This creates situations with more
      outputs being present than actually there, but prevents that there are
      no outputs at all.
      
      Test Plan: Auto test added which verifies this for the virtual platform
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2233
      d0c488f4
  27. 13 Jul, 2016 3 commits
    • Martin Flöser's avatar
      Add support for xdg-shell version 5 interface · c3af4c3f
      Martin Flöser authored
      Summary:
      The WaylandServer creates the XdgShellV5 interface and hooks it up
      to create a ShellSurface whenever an xdg surface or xdg popup is created.
      
      ShellClient gains some new ctors for the different variants and is
      adjusted to delegate to xdg surface respectively.
      
      With this change KWin mostly supports xdg-shell protocol. Still missing
      is support for the "geometry" request which is rather difficult to
      implement in KWin.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2108
      c3af4c3f
    • Martin Flöser's avatar
      Merge signal connections for AbstractClient in Workspace · 445335ba
      Martin Flöser authored
      Summary:
      Have one dedicated method which performs the connection for both
      Client and ShellClient. This fixes the desktopPresenceChanged signal
      not being passed to the effects.
      
      Note that not all signals are merged. Most signals setup for Client
      don't make sense for ShellClient as ShellClient cannot block composite
      or unredirect.
      
      Test Plan:
      Test case added for ShellClient to ensure that the signal
      is correctly invoked on the ShellClient, Workspace and EffectsHandler.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2059
      445335ba
    • Martin Flöser's avatar
      Handle situation of no XDG_RUNTIME_DIR gracefully · 3c04d529
      Martin Flöser authored
      Summary:
      If KWin fails to start the Wayland server due to XDG_RUNTIME_DIR not
      being set, kwin_wayland should terminate with an error condition but
      not crash.
      
      This change makes sure that KWin detects that the Wayland server does
      not work and terminates the startup early and ensures that it doesn't
      crash while going down.
      
      An error message is shown that we could not create the Wayland server.
      
      Test Plan:
      Test case added which verifies that WaylandServer fails to
      init. Manual testing that kwin_wayland exits with error 1.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2078
      3c04d529
  28. 29 Jun, 2016 1 commit
    • Martin Flöser's avatar
      Support for syncing the clipboard from X11 to Wayland and vice versa · 3493e976
      Martin Flöser authored
      Summary:
      The clipboard sync is done by a dedicated helper binary launched by
      KWin. This helper binary is forced to xcb platform to piggy-back on
      Qt's implementation of the X11 clipboard. In addition it implements
      the Wayland clipboard - which is much simpler. Reading the Wayland
      clipboard is based on the implementation in QtWayland.
      
      KWin internally knows the DataDeviceInterface belonging to the helper
      application. Whenever an xwayland client is focussed, this DataDevice
      is allowed to set the selection and KWin manually updates the current
      selection in the SeatInterface. By that the sync from X11 to Wayland
      is implemented. When afterwards a Wayland client is selected, it's sent
      the current selection which references the X clipboard and a data
      transfer can be initiated in the normal Wayland way.
      
      For the other direction KWin sends the current selection to the helper's
      DataDevice whenever an xwayland window is focused. The helper application
      reads the Wayland clipboard and sets it on the X11 clipboard. Thus the
      Wayland clipboard is synced to X11.
      
      The approach used here will also be useful for implementing a clipboard
      manager (aka klipper).
      
      Currently the implementation is not yet fully completed. We need to
      make sure that the helper application gets restarted in case of a crash.
      
      Test Plan: See added test case
      
      Reviewers: #plasma_on_wayland, #kwin
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D1973
      3493e976
  29. 14 Jun, 2016 2 commits
  30. 02 May, 2016 3 commits
    • Sebastian Kügler's avatar
      Actually create the outputmanagement interface · a5189cc3
      Sebastian Kügler authored
      Summary: It's instantiated, but never created. This means that libkscreen's wayland backend is going to hang initializing.
      
      Test Plan: Ran libkscreen against it, works with and doesn't work without patch.
      
      Reviewers: graesslin, #plasma
      
      Reviewed By: graesslin, #plasma
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1524
      a5189cc3
    • Martin Flöser's avatar
      Connect Application::screensCreated to WaylandServer::initOutputs · 31986988
      Martin Flöser authored
      Summary:
      Instead of having the Application invoke initOutputs after creating
      the Screens, we can just connect to the signal emitted there.
      
      This allows to make initOutputs a private, WaylandServer internal
      method.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1482
      31986988
    • Martin Flöser's avatar
      Make integration with KScreenLocker optional in WaylandServer · f8f8e614
      Martin Flöser authored
      Summary:
      In order to start the WaylandServer in kwin_x11 we need to make sure
      that WaylandServer does not start the KScreenLocker integration. On
      X11 the lock screen is provided by a different application (in Plasma
      by ksmserver).
      
      A new init flag is added to WaylandServer to not integrate with
      KScreenLocker. Thus the default is still to integrate with KScreenLocker.
      
      All direct usages of KScreenLocker are guarded to not be called if
      the screenlocker integration is not present.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1481
      f8f8e614
  31. 26 Apr, 2016 1 commit
  32. 07 Apr, 2016 4 commits