1. 05 Apr, 2021 1 commit
  2. 31 Mar, 2021 3 commits
    • Vlad Zahorodnii's avatar
      scene: Refactor damage teardown in X11SurfaceItem · a9d5b845
      Vlad Zahorodnii authored
      This introduces the markedAsZombie signal, which is emitted when the
      window is about to become deleted. The X11SurfaceItem uses this signal
      to determine when the damage must be destroyed.
      a9d5b845
    • Vlad Zahorodnii's avatar
      scene: Introduce window items · 47113e09
      Vlad Zahorodnii authored
      Currently, dealing with sub-surfaces is very difficult due to the scene
      design being heavily influenced by X11 requirements.
      
      The goal of this change is to re-work scene abstractions to make improving
      the wayland support easier.
      
      The Item class is based on the QQuickItem class. My hope is that one day
      we will be able to transition to QtQuick for painting scene, but in
      meanwhile it makes more sense to have a minimalistic internal item class.
      
      The WindowItem class represents a window. The SurfaceItem class represents
      the contents of either an X11, or a Wayland, or an internal surface. The
      DecorationItem and the ShadowItem class represent the server-side deco and
      drop-shadow, respectively.
      
      At the moment, the SurfaceItem is bound to the scene window, but the long
      term plan is to break that connection so we could re-use the SurfaceItem
      for things such as software cursors and drag-and-drop additional icons.
      
      One of the responsibilities of the Item is to schedule repaints as needed.
      Ideally, there shouldn't be any addRepaint() calls in the core code. The
      Item class schedules repaints on geometry updates. In the future, it also
      has to request an update if its opacity or visibility changes.
      47113e09
    • Vlad Zahorodnii's avatar
      wayland: Mark Xwayland windows ready for painting when mapped · 369b768f
      Vlad Zahorodnii authored
      This makes the logic that determines when Xwayland windows can be marked
      as ready for painting more robust.
      
      At the moment, we call setReadyForPainting() when the surface is damaged,
      but we want Toplevel stop managing damages.
      369b768f
  3. 03 Mar, 2021 1 commit
    • Vlad Zahorodnii's avatar
      x11: Initialize opacity when starting to track Unmanaged · d9ec4822
      Vlad Zahorodnii authored and Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez committed
      This is a minor regression that was introduced with the refactoring of
      Toplevel::opacity().
      
      Previously, neither X11Client nor Unmanaged had to explicitly initialize
      the opacity because it was queried from the net info object in
      Toplevel::opacity().
      
      With the refactored version, X11-specific opacity code was removed from
      the Toplevel class. When starting to manage a window, the opacity must
      be explicitly initialized.
      
      BUG: 432744
      d9ec4822
  4. 16 Feb, 2021 1 commit
  5. 10 Feb, 2021 1 commit
    • Vlad Zahorodnii's avatar
      Move source code to src/ directory · 93e0265e
      Vlad Zahorodnii authored
      Once in a while, we receive complaints from other fellow KDE developers
      about the file organization of kwin. This change addresses some of those
      complaints by moving all of source code in a separate directory, src/,
      thus making the project structure more traditional. Things such as tests
      are kept in their own toplevel directories.
      
      This change may wreak havoc on merge requests that add new files to kwin,
      but if a patch modifies an already existing file, git should be smart
      enough to figure out that the file has been relocated.
      
      We may potentially split the src/ directory further to make navigating
      the source code easier, but hopefully this is good enough already.
      93e0265e
  6. 02 Dec, 2020 1 commit
  7. 30 Oct, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Store repaint regions per individual screen · 74391e25
      Vlad Zahorodnii authored
      AnimationEffect schedules repaints in postPaintWindow() and performs
      cleanup in preScreenPaint(). With the X11-style rendering, this doesn't
      have any issues, scheduled repaints will be reset during the next
      compositing cycle.
      
      But with per screen rendering, we might hit the following case
      
          - Paint screen 0
          - Reset scheduled repaints
          - AnimationEffect::prePaintScreen(): update the timeline
          - AnimationEffect::postPaintScreen(): schedule a repaint
      
          - Paint screen 1
          - Reset scheduled repaints
          - AnimationEffect::prePaintScreen(): destroy the animation
          - AnimationEffect::postPaintScreen(): no repaint is scheduled
      
          - Return to the event loop
      
      In this scenario, the repaint region scheduled by AnimationEffect will
      be lost when compositing is performed on screen 1.
      
      There is no any other way to fix this issue but maintain repaint regions
      per each individual screen if per screen rendering is enabled.
      
      BUG: 428439
      74391e25
  8. 29 Sep, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Schedule workspace repaint for destroyed clients · 12e59f9a
      Vlad Zahorodnii authored
      We need to schedule a workspace repaint in case no effect is going to
      animate the window.
      
      The workspace repaint is issued before creating a Deleted because the
      latter takes the owner of the effect window, which means that after an
      instance of Deleted has been created, visibleRect() returns the frame
      geometry.
      
      CCBUG: 425294
      12e59f9a
  9. 24 Sep, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Replace remaining usages of old connect syntax with new connect syntax · 0c266e76
      Vlad Zahorodnii authored
      This change replaces the remaining usages of the old connect syntax with
      the new connect syntax.
      
      Unfortunately, there are still places where we have to use SIGNAL() and
      SLOT() macros, for example the stuff that deals with d-bus business.
      
      Clazy was used to create this change. There were a few cases that needed
      manual intervention, the majority of those cases were about resolving
      ambiguity caused by overloaded signals.
      0c266e76
  10. 21 Aug, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Use universal helper for writing toplevels to QDebug streams · 90b53f41
      Vlad Zahorodnii authored
      Toplevel::debug() is one of annoyances that you need to deal with when
      implementing a new client type. It can be tempting to just write "this"
      to the stream, but it will result in a crash.
      
      In order to make implementing new client types easier, this change
      introduces a debug stream insertion operator overload that works for all
      kinds of the Toplevel class.
      90b53f41
  11. 07 Aug, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Prettify license headers · 4ce853e8
      Vlad Zahorodnii authored
      4ce853e8
    • Vlad Zahorodnii's avatar
      Switch to SPDX license markers · 1fb9f6f1
      Vlad Zahorodnii authored
      The main advantage of SPDX license identifiers over the traditional
      license headers is that it's more difficult to overlook inappropriate
      licenses for kwin, for example GPL 3. We also don't have to copy a
      lot of boilerplate text.
      
      In order to create this change, I ran licensedigger -r -c from the
      toplevel source directory.
      1fb9f6f1
  12. 05 Aug, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Survive Xwayland crashes · 19ad1725
      Vlad Zahorodnii authored
      If the Xwayland process crashes, it will bring down the entire session
      together with itself. Obviously, we don't want that. At least, Wayland
      clients should survive the crash.
      
      This change refactors relevant X11 parts to handle Xwayland crashes in a
      less fatal way.
      
      In order to handle Xwayland crashes better, a pair of start() and stop()
      methods had been introduced in the Xwayland class to allow starting and
      stopping the Xwayland process at any moment.
      
      If we detect that the Xwayland process has crashed, we will immediately
      stop the Xwayland server, which in its turn will deactivate the socket
      notifier and destroy all connected X11 clients. Unfortunately, a couple
      of subtle changes in X11Client::releaseWindow() and Unmanaged::release()
      had to be made to ensure that we are left with a valid state after the
      Xwayland server has been stopped.
      19ad1725
  13. 30 Jun, 2020 1 commit
  14. 18 Jun, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Introduce the client geometry in Toplevel · cc3eb54b
      Vlad Zahorodnii authored and Vlad Zahorodnii's avatar Vlad Zahorodnii committed
      In most cases, we don't need to react to client geometry changes, but in
      code that deals with server-side window decorations, we need to react to
      client geometry changes. The problem is that frame and client geometry
      updates are not correlated even though there is a connection between the
      frame geometry and the client geometry.
      
      This change introduces the client geometry in the Toplevel class in order
      to allow monitoring client geometry updates from DecoratedClientImpl.
      cc3eb54b
  15. 22 Feb, 2020 4 commits
    • Nicolas Fella's avatar
      Revert "[kcm/effects] Clip ListView" · 7159684c
      Nicolas Fella authored
      Bad merge
      
      This reverts commit b7130442.
      7159684c
    • Nicolas Fella's avatar
      [kcm/effects] Clip ListView · b7130442
      Nicolas Fella authored
      Summary:
      Otherwise the content overflows the frame when scrolling.
      
      QQC2 scrollview docs say "ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true"
      
      Test Plan:
      Before:
      {F8121150}
      
      After:
      {F8121152}
      
      Reviewers: #kwin, #plasma, ngraham
      
      Reviewed By: ngraham
      
      Subscribers: ngraham, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27558
      b7130442
    • Nicolas Fella's avatar
      Revert "[kcm/effects] Clip ListView" · cdc5ea19
      Nicolas Fella authored
      Bad merge
      
      This reverts commit 5babf52d.
      cdc5ea19
    • Nicolas Fella's avatar
      [kcm/effects] Clip ListView · 5babf52d
      Nicolas Fella authored
      Summary:
      Otherwise the content overflows the frame when scrolling.
      
      QQC2 scrollview docs say "ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true"
      
      Test Plan:
      Before:
      {F8121150}
      
      After:
      {F8121152}
      
      Reviewers: #kwin, #plasma, ngraham
      
      Reviewed By: ngraham
      
      Subscribers: ngraham, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27558
      5babf52d
  16. 12 Feb, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Introduce Toplevel::frameGeometryChanged signal · 15af09c7
      Vlad Zahorodnii authored
      Summary:
      Currently we have two signals that are emitted when the Toplevel's geometry
      changes - geometryShapeChanged() and geometryChanged(). The former signal
      is used primarily to invalidate cached window quads and the latter is
      sort of emitted when the frame geometry changes. But it's not that easy. We
      have a bunch of connects that link those signals together...
      
      The worst part about all of this is that the window quads cache gets
      invalidated every time a geometry update occurs, for example when user
      moves a window around on the screen.
      
      This change introduces a new signal and deprecates the existing geometryChanged
      signal. frameGeometryChanged is similar to geometryChanged except that it is
      emitted when an _actual_ geometry change has occurred.
      
      We do still emit geometryShapeChanged signal. However, in long term, we
      need to get rid of this signal or come up with something that makes sense
      and doesn't require us to waste computational resources.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, romangg, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D26863
      15af09c7
  17. 04 Dec, 2019 1 commit
  18. 27 Nov, 2019 1 commit
    • Vlad Zahorodnii's avatar
      [wayland] Implement window geometry more properly · 9f7a856d
      Vlad Zahorodnii authored
      Summary:
      So far the window geometry from xdg-shell wasn't implemented as it should
      be. A toplevel must have two geometries assigned to it - frame and buffer.
      The frame geometry describes bounds of the client excluding server-side
      and client-side drop-shadows. The buffer geometry specifies rectangle on
      the screen occupied by the main surface.
      
      State and geometry handling in XdgShellClient is still a bit broken. This
      change doesn't intend to fix that, it must be done in another patch asap.
      
      Test Plan: New tests pass.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, romangg, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T10867
      
      Differential Revision: https://phabricator.kde.org/D24455
      9f7a856d
  19. 24 Oct, 2019 1 commit
  20. 24 Sep, 2019 1 commit
  21. 20 Sep, 2019 2 commits
  22. 19 Sep, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Use nullptr everywhere · 62a7db70
      Vlad Zahorodnii authored
      Summary:
      Because KWin is a very old project, we use three kinds of null pointer
      literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
      nullptr keyword.
      
      This change converts all usages of 0 and NULL literal to nullptr. Even
      though it breaks git history, we need to do it in order to have consistent
      code as well to ease code reviews (it's very tempting for some people to
      add unrelated changes to their patches, e.g. converting NULL to nullptr).
      
      Test Plan: Compiles.
      
      Reviewers: #kwin, davidedmundson, romangg
      
      Reviewed By: #kwin, davidedmundson, romangg
      
      Subscribers: romangg, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23618
      62a7db70
  23. 07 Sep, 2019 1 commit
  24. 16 Apr, 2019 1 commit
  25. 09 Apr, 2019 1 commit
  26. 07 Nov, 2018 1 commit
  27. 01 Nov, 2018 1 commit
    • David Edmundson's avatar
      [wayland] Use the new plasma virtual desktop protocol · 7e8facc3
      David Edmundson authored and Marco Martin's avatar Marco Martin committed
      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
  28. 12 Aug, 2016 1 commit
    • Martin Flöser's avatar
      Implement addDamage in Unmanaged · 5ea88eff
      Martin Flöser authored
      For Xwayland Unmanaged needs to override the addDamage method and
      update the repaints_region accordingly, otherwise the repaint is not
      triggered for the Unmanaged window.
      
      Reviewed-By: bshah
      5ea88eff
  29. 01 Feb, 2016 1 commit
  30. 17 Mar, 2015 1 commit
  31. 26 Jan, 2015 1 commit
  32. 05 May, 2014 2 commits