1. 17 Mar, 2020 2 commits
  2. 04 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Use AbstractClient instead of XdgShellClient wherever possible · be759b7d
      Vlad Zahorodnii authored
      Summary:
      Currently, we have only one shell client type - XdgShellClient. We use
      it when we are dealing with Wayland clients. But it isn't really a good
      idea because we may need to support shell surfaces other than xdg-shell
      ones, for example input panel surfaces.
      
      In order to make kwin more extensible, this change replaces all usages
      of the XdgShellClient class with the AbstractClient class.
      
      Test Plan: Existing tests pass.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27778
      be759b7d
  3. 06 Nov, 2019 1 commit
    • David Edmundson's avatar
      [wayland] Fix sha check of filtered applications · 18a4ded3
      David Edmundson authored
      Summary:
      We have a sha check rather than just readlink as an app in a mount
      namespace could have an executable with the same path as an exectuable
      on the host system that we trust.
      
      This became overly complicated to solve an issue that didn't exist.
      sha(/proc/PID/exe) does resolve to what is currently running even if
      sha(readlink(/proc/PID/exe) does not as /proc is magic.
      
      This patch compares the root file system as kwin sees it to the running
      exe.
      
      See later comments on D22571
      
      Reviewers: fvogt
      
      Reviewed By: fvogt
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D25169
      18a4ded3
  4. 29 Oct, 2019 1 commit
    • Roman Gilg's avatar
      Dmabuf recovery on EGL reset · 7459aabc
      Roman Gilg authored
      Summary:
      The EGL platform might go away at any time through reconfiguration or because
      of a graphic error. KWin then resets the graphics. The dmabuf implementation
      must respect that and recover from a graphics reset by recreating all EGL
      images for existing buffer.
      
      This assumes that we won't change our graphics API mid-session and that
      supported plane and modifier configuration stays constant.
      
      In practise we remember all current dmabufs in a single map and only remove
      them if the client did destroy the resource.
      
      BUG: 411980
      CCBUG: 413403
      FIXED-IN: 5.17.2
      
      Test Plan: Applied screenedge configuration without crash.
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: fvogt, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D24954
      7459aabc
  5. 10 Oct, 2019 1 commit
  6. 25 Sep, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Rename Client to X11Client · ffcbe24e
      Vlad Zahorodnii authored
      Summary:
      Currently each managed X11 client is represented with an instance of
      Client class, however the name of that class is very generic and the
      only reason why it's called that way is because historically kwin
      was created as an x11 window manager, so "Client" was a sensible choice.
      
      With introduction of wayland support, things had changed and therefore
      Client needs to be renamed to X11Client in order to better reflect what
      that class stands for.
      
      Renaming of Client to X11Client was agreed upon during the last KWin
      sprint.
      
      Test Plan: Compiles, the test suite is still green.
      
      Reviewers: #kwin, romangg
      
      Reviewed By: #kwin, romangg
      
      Subscribers: romangg, davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D24184
      ffcbe24e
  7. 23 Sep, 2019 4 commits
    • Vlad Zahorodnii's avatar
      Rename ShellClient to XdgShellClient · 168ea988
      Vlad Zahorodnii authored
      Summary:
      Rename ShellClient to XdgShellClient in order to reflect that it
      represents only xdg-shell clients.
      
      Test Plan: Compiles, tests still pass.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23589
      168ea988
    • Vlad Zahorodnii's avatar
      [wayland] Drop xdg-shell v5 support · 665ec0a5
      Vlad Zahorodnii authored
      Summary:
      Drop xdg-shell v5 support since this protocol is obsolete and all popular
      wayland compositors already did that.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23573
      665ec0a5
    • Vlad Zahorodnii's avatar
      [wayland] Drop wl-shell support · 7a5447bd
      Vlad Zahorodnii authored
      Summary: wl-shell is deprecated, and pretty much no one uses it.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23562
      7a5447bd
    • Vlad Zahorodnii's avatar
      Port QPA away from Wayland · bebe8120
      Vlad Zahorodnii authored
      Summary:
      So far wayland was used by internal clients to submit raster buffers
      and position themselves on the screen. While we didn't have issues with
      submitting raster buffers, there were some problems with positioning
      task switchers. Mostly, because we had effectively two paths that may
      alter geometry.
      
      A better approach to deal with internal clients is to let our QPA use
      kwin core api directly. This way we can eliminate unnecessary roundtrips
      as well make geometry handling much easier and comprehensible.
      
      The last missing piece is shadows. Both Plasma::Dialog and Breeze widget
      style use platform-specific APIs to set and unset shadows. We need to
      add shadows API to KWindowSystem. Even though some internal clients lack
      drop-shadows at the moment, I don't consider it to be a blocker. We can
      add shadows back later on.
      
      CCBUG: 386304
      
      Reviewers: #kwin, davidedmundson, romangg
      
      Reviewed By: #kwin, romangg
      
      Subscribers: romangg, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T9600
      
      Differential Revision: https://phabricator.kde.org/D22810
      bebe8120
  8. 05 Sep, 2019 2 commits
    • Roman Gilg's avatar
      Lift output enablement into Platform · f7ff62e2
      Roman Gilg authored
      Summary:
      This lifts the enablement code for outputs from the DRM backend to Platform
      allowing other Wayland backends in the future to use this interface as well.
      
      To do that we also create some helper functions on Platform level and have to
      spill some KWayland classes into AbstractOutput what motivates a further split
      of Platform into a Wayland child class like for AbstractOutput.
      
      Test Plan: Disabled and enabled an output in DRM session.
      
      Reviewers: #kwin
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23545
      f7ff62e2
    • Aleix Pol Gonzalez's avatar
      Fix warning text message · 5ed98f79
      Aleix Pol Gonzalez authored
      5ed98f79
  9. 28 Aug, 2019 1 commit
    • Roman Gilg's avatar
      Remove outputs handling alternative · 5cc626c1
      Roman Gilg authored
      Summary:
      With f013a436, cd6b69a4, d960be4b and edb200f6 all possible
      backends of a Wayland session have been ported to using the internal functions
      of AbstractWaylandOutput's for managing outputs.
      
      This removes the alternative code path used before in these backends, what
      simplifies the code and is also a prerequisite to removing the Screens global
      in the future.
      
      Reviewers: #kwin, apol, zzag
      
      Reviewed By: #kwin, apol, zzag
      
      Subscribers: apol, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T11459, T11098
      
      Differential Revision: https://phabricator.kde.org/D23485
      5cc626c1
  10. 31 Jul, 2019 1 commit
    • Aleix Pol Gonzalez's avatar
      Allow blacklisting some wayland interfaces · f3247761
      Aleix Pol Gonzalez authored
      Summary:
      For some interfaces, we'll look at the X-KDE-Wayland-Interfaces property in the desktop file to see which interfaces are requested.
      Requires D22570.
      
      Reviewers: #plasma, #kwin, davidedmundson
      
      Reviewed By: #plasma, #kwin, davidedmundson
      
      Subscribers: fvogt, zzag, broulik, graesslin, davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D22571
      f3247761
  11. 22 Jun, 2019 1 commit
  12. 22 Feb, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Fix tests · e96da56f
      Vlad Zahorodnii authored
      `client = new ShellClient(surface)` is most likely a leftover after a
      merge conflict.
      e96da56f
  13. 21 Feb, 2019 1 commit
    • Martin Flöser's avatar
      Split out a dedicated InternalClient class · 9b922f88
      Martin Flöser authored
      Summary:
      Most of the functionality which is special to internal clients is moved
      from ShellClient to InternalClient. As KWin's qpa is still bound to the
      Wayland protocol InternalClient inherits from ShellClient. Due to that
      some aspects in ShellClient are "weird". ShellClient still detects
      whether it's an internal client and uses the variable m_internal to
      capture the state. This is required as we cannot use the isInternal
      method. Most of m_internal usage is in init which is called from
      constructor of ShellClient. Thus it's not possible to call into virtual
      methods of InternalClient.
      
      Also some of the code is duplicated and some methods are temporarily
      marked as virtual.
      
      The next step will be to remove ShmBuffer for internal windows which
      should decouple the two implementations further with the long term goal
      of having InternalClient inherit AbstractClient directly.
      
      Test Plan:
      Run nested KWin, triggered outline (OpenGL case) and debug console (shm case).
      InternalWindow unit test still passes.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18569
      9b922f88
  14. 19 Feb, 2019 3 commits
    • Roman Gilg's avatar
      [xwl] Drag and drop between Xwayland and Wayland native clients · 548978bf
      Roman Gilg authored
      Summary:
      Building upon the generic X Selection support this patch establishes another
      selection class representing the XDND selection and provides interfaces
      to communicate drags originating from Xwayland windows to the Wayland
      server KWin and drags originating from Wayland native drags to Xwayland.
      
      For Wayland native drags KWin will claim the XDND selection as owner and
      will simply translate all relevant events to the XDND protocol and receive
      alike messages by X clients.
      
      When an X client claims the XDND selection KWin is notified via the X protocol
      and it decides if it allows the X drag to transcend into the Wayland protocol.
      If this is the case the mouse position is tracked and on entering a Wayland
      native window a proxy X Window is mapped to the top of the window stack. This
      proxy window acts as a drag destination for the drag origin window and again
      X messages will be translated into respective Wayland protocol calls. If the
      cursor leaves the Wayland window geometry before a drop is registered, the
      proxy window is unmapped, what triggers a subsequent drag leave event.
      
      In both directions the necessary core integration is minimal. There is a single
      call to be done in the drag and drop event filter through the Xwayland
      interface class.
      
      From my tests this patch facilitates drags between any Qt/KDE apps. What needs
      extra care are the browsers, which use target formats, that are not directly
      compatible with the Wayland protocol's MIME representation. For Chromium an
      additional integration step must be done in order to provide it with a net
      window stack containing the proxy window.
      
      Test Plan: Manually. Auto tests planned.
      
      Reviewers: #kwin
      
      Subscribers: zzag, kwin, alexde
      
      Tags: #kwin
      
      Maniphest Tasks: T4611
      
      Differential Revision: https://phabricator.kde.org/D15627
      548978bf
    • Roman Gilg's avatar
      Remove X clipboard sync helper and rename its autotest · 2776f829
      Roman Gilg authored
      Summary:
      With the gneric X selections infrastructure and clipboard support the X
      clipboard sync helper utility can be removed. Also rename its autotest as it
      tests the inner workings of the new mechanism since this mechanism was
      introduced.
      
      Test Plan: Autotest still passes under new name.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D15063
      2776f829
    • Roman Gilg's avatar
      [xwl] Generic X selections translation mechanism with Clipboard support · 6e08fb2f
      Roman Gilg authored
      Summary:
      In this patch an infrastructure is created to represent generic X selections
      in a Wayland session and use them for data transfers between Xwayland windows
      and Wayland native clients.
      
      The central manager is the DataBridge class, in which Selection objects can be
      created. This is hard-coded and such a Selection object persists until the end
      of the session, so no arbitrary selections can be created on the fly. For now
      the X Clipboard selection is supported, whose corresponding mechanism in the
      Wayland protocol is just called Selection.
      
      A Selection object listens for selection owner changes on the X side and for
      similar events into the Wayland server interfaces. If a data provider is
      available a selection source object is created by the Selection object. In case
      data is requested on the other side, a data transfer is initialized by creating
      a Transfer object. A Selection keeps track of all transfers and makes sure that
      they are destroyed when they are finished or in case they idle because of
      misbehaving clients.
      
      The Clipboard class translates the X Clipboard via a proxy window. Selection
      changes on the Wayland side are listened to through a new signal on the active
      KWayland seat interface.
      
      The previously used X clipboard syncer helper is disabled. The clipboard sync
      autotest is changed to the new mechanism.
      
      BUG: 394765
      BUG: 395313
      
      Test Plan: Manually and clipboard sync autotest.
      
      Reviewers: #kwin
      
      Subscribers: zzag, graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D15061
      6e08fb2f
  15. 30 Jan, 2019 2 commits
    • David Edmundson's avatar
      [wayland] Drop Qt extended surface · 7d10ab0f
      David Edmundson authored
      Summary:
      This is only relevant on Qt and when WlShell is used.
      This was only the case before Qt5.10.
      
      We will depend on Qt5.12 next release.
      Static Qt builds which are that old typically wouldn't contain QtWayland
      
      Test Plan: Compiles. Not used in tests
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: graesslin, zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18594
      7d10ab0f
    • David Edmundson's avatar
      [wayland] Call ShellClient install interface methods consistently · 4240c4af
      David Edmundson authored
      Summary:
      When we create a new Shellclient there may be a pending relevant
      interface.
      
      For every other case this is handled in WaylandServer, the class
      responsible for attaching new interfaces at runtime.
      The only exception is ServerSideDecorationInterface which is handled in
      the ShellClient constructor.
      
      This makes everything consistent.
      
      No behavioural changes.
      
      Test Plan: Ran unit tests
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18592
      4240c4af
  16. 25 Jan, 2019 1 commit
  17. 01 Jan, 2019 1 commit
    • David Edmundson's avatar
      [wayland] XdgDecoration Support · ac45977e
      David Edmundson authored
      Summary:
      Does something similar to our existing ServerDecoration, but based
      around XDG Shell patterns and with a few subtle differneces.
      
      We'll probably still need both in kwin for the forseeable future as GTK3
      won't ever change from using the KDE Server Decoration.
      
      Test Plan:
      Relevant unit test. It's a bit simpler as spec states
      toolkits must follow what the compositor configures if they
      bind the interface.
      
      Modified plasma-integration to remove ServerIntegration
      (as Qt5.12 has native support) all my windows look and act the same.
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D17756
      ac45977e
  18. 13 Dec, 2018 1 commit
    • Martin Flöser's avatar
      Introduce a command line option to disable any kind of global shortcuts · a0b482cb
      Martin Flöser authored
      Summary:
      This command line option is useful for KWin in embedded use case. That
      is when KWin is just used as a compositor for one application instead of
      a complete desktop environment. In such a setup global shortcuts are not
      wanted and interfere with the application. E.g. one does not want Alt+F4
      to close the window, that would render the system unusable.
      
      This change introduces a command line option and disables the following
      event filters and spies:
       * global shortcuts
       * modifier only shortcuts
       * terminate session
       * virtual terminal switching
       * screen edges
      
      KGlobalAccel still gets inited, otherwise the (non-functional) binary
      would be launched when KWin registers it's global shortcuts.
      
      Test Plan:
      New test added based on existing tests for the global
      shortcuts, ctest passes
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D17304
      a0b482cb
  19. 08 Nov, 2018 1 commit
  20. 07 Nov, 2018 2 commits
    • Martin Flöser's avatar
      Remove potential endless loop from XClipboardSyncTest · e637d432
      Martin Flöser authored
      Summary:
      We need to wait till the helper process created the datadevice. For this
      we used a while loop. On build.kde.org the test gets stuck in this loop
      and times out after 10 minutes.
      
      This change introduces a dedicated signal and we just wait for it. So if
      something fails we wait only 5 sec instead of endless. This should help
      investigate why the test doesn't work on build.kde.org.
      
      Test Plan: Test works locally
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16741
      e637d432
    • 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 10 Jan, 2018 1 commit
  26. 04 Jan, 2018 1 commit
  27. 27 Dec, 2017 1 commit
  28. 22 Dec, 2017 1 commit
  29. 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
  30. 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
  31. 16 Oct, 2017 1 commit