1. 27 Jan, 2019 2 commits
    • Martin Flöser's avatar
      Switch ThumbnailItem to internal uuid instead of WId · 932ccb2a
      Martin Flöser authored
      So far the ThumbnailItem in TabBox mode used the window id for finding
      the window it should render a thumbnail on. In the Wayland world this is
      not unique. The window id could be either an X11 window or a wayland
      window. We don't guarantee that there are no conflicting ids.
      With the internal id we have a way to properly identify the windows, so
      this element should use them.
      To support this the property changed the type to QUuid and the
      clientmodel also provides the QUuid. As in TabBox the way to get the
      window is through the model this should be compatible for all themes.
      It's tested and verified with the Breeze switcher.
      For declarative KWin scripts the ThumbnailItem also provides the
      AbstractClient as a property, so there should not be any script which
      uses wid. If it does, this could break, but well the script should use
      the intended API.
      Test Plan: ctest passes, manual testing of Breeze alt-tab switcher
      Reviewers: #kwin
      Differential Revision: https://phabricator.kde.org/D18405
    • Martin Flöser's avatar
      Add windowsystem plugin for KWin's qpa · 02a05610
      Martin Flöser authored
      KWindowSystem provides a plugin interface to have platform specific
      implementations. So far KWin relied on the implementation in
      KWayland-integration repository.
      This is something I find unsuited, for the following reasons:
       * any test in KWin for functionality set through the plugin would fail
       * it's not clear what's going on where
       * in worst case some code could deadlock
       * KWin shouldn't use KWindowSystem and only a small subset is allowed
      to be used
      The last point needs some further explanation. KWin internally does not
      and cannot use KWindowSystem. KWindowSystem (especially KWindowInfo) is
      exposing information which KWin sets. It's more than weird if KWin asks
      KWindowSystem for the state of a window it set itself. On X11 it's just
      slow, on Wayland it can result in roundtrips to KWin itself which is
      But due to using Plasma components we have a few areas where we use
      KWindowSystem. E.g. a Plasma::Dialog sets a window type, the slide in
      direction, blur and background contrast. This we want to support and
      need to support. Other API elements we do not want, like for examples
      the available windows. KWin internal windows either have direct access
      to KWin or a scripting interface exposed providing (limited) access -
      there is just no need to have this in KWindowSystem.
      To make it more clear what KWin supports as API of KWindowSystem for
      internal windows this change implements a stripped down version of the
      kwayland-integration plugin. The main difference is that it does not use
      KWayland at all, but a QWindow internal side channel.
      To support this EffectWindow provides an accessor for internalWindow and
      the three already mentioned effects are adjusted to read from the
      internal QWindow and it's dynamic properties.
      This change is a first step for a further refactoring. I plan to split
      the internal window out of ShellClient into a dedicated class. I think
      there are nowadays too many special cases. If it moves out there is the
      question whether we really want to use Wayland for the internal windows
      or whether this is just historic ballast (after all we used to use
      qwayland for that in the beginning).
      As the change could introduce regressions I'm targetting 5.16.
      Test Plan:
      new test case for window type, manual testing using Alt+Tab
      for the effects integration. Sliding popups, blur and contrast worked fine.
      Reviewers: #kwin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D18228
  2. 13 Jan, 2019 1 commit
  3. 12 Jan, 2019 1 commit
  4. 11 Jan, 2019 1 commit
  5. 07 Jan, 2019 1 commit
  6. 14 Dec, 2018 1 commit
    • Vlad Zahorodnii's avatar
      [libkwineffects] Bump API version · 17358796
      Vlad Zahorodnii authored
      Recently, libkwineffects got some changes that break ABI compatibility,
      so we have to bump the API version.
      Test Plan:
      When using a binary effect, which is made against 226 version, KWin no
      longer crashes.
      Reviewers: #kwin, davidedmundson
      Reviewed By: #kwin, davidedmundson
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D17444
  7. 30 Nov, 2018 1 commit
    • David Edmundson's avatar
      [libkwineffects] Replace property name lookup with calling the virtual methods · 7834bec5
      David Edmundson authored
      EffectWindow proxies its properties from the client/deleted's
      QObject::property(char*) is a slow string search. It's a loop
      of string comparisons not a hash lookup!
      QML's use of properties is different, there's a property cache.
      It's fetched multiple times for every window in every paint of some
      effects (such as blur). Hotspot shows this as a significant amount of
      the render pass (X11) with nothing in kwin animating.
      This patch replaces the macro that does
      with a macro calling the relevant function directly without metaobjects.
      This also improves type safety for future changes.
      Test Plan:
      Existing unit tests
      Ran it for a bit
      Reviewers: #kwin, graesslin
      Subscribers: graesslin, zzag, broulik, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D16602
  8. 17 Nov, 2018 1 commit
    • Vlad Zahorodnii's avatar
      [libkwineffects] Introduce timeline redirect modes · e0257326
      Vlad Zahorodnii authored
      The redirect modes control behavior of the timeline when its direction
      is changed at the start or target position. For example, consider the
      following piece of code:
          TimeLine timeLine(1000ms, TimeLine::Forward);
      What should happen when the direction of the timeline was changed to go
      backward? Should the current value of the timeline go from 1 to 0, or
      should the timeline stop its "execution"?
      In the relaxed mode, the timeline will go from 1 to 0.
      In the strict mode, the timeline will stop its execution.
      Different effects may prefer different modes for source and target
      positions. For example, most C++ effect would prefer relaxed mode for
      source position, and strict mode for target position. On the other side,
      scripted effects(AnimationEffect) would prefer strict mode for source
      position, and relaxed mode for target position(because of set).
      Reviewers: #kwin, graesslin
      Reviewed By: #kwin, graesslin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D16447
  9. 14 Nov, 2018 1 commit
    • David Edmundson's avatar
      [wayland] add enter/leave virtual desktop API · f521d4bb
      David Edmundson authored
      As setDesktop was changed to "move" this left unSetDesktop non-symetric.
      This replaces it with explicit API to enter/leave.
      This also moves new API to the new object based API rather than still
      using ints.
      Where numbers are used it has been tidied up so that desktop IDs are
      uint, which should be used when we have a list of desktops.
      int is used only when we have either a desktop ID or NET::OnAllDesktops
      Effects API cleared up to use this and use a set of x11 IDs, which
      avoids any potential complications of handling add and removes any
      ambiguity with what happens if you leave all desktops and such.
      Test Plan:
      testVirtualDesktops passes (with pending kwayland patch)
      Moving a window in the desktop grid on X11 behaves
      Moving a window in the desktop grid on wayland behaves
      Reviewers: #kwin, zzag
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D16704
  10. 07 Nov, 2018 1 commit
    • Vlad Zahorodnii's avatar
      [libkwineffects] Use correct type for the desktops property · f4663072
      Vlad Zahorodnii authored
      Type of the x11DesktopIds property was changed from QList<int> to
      QVector<int> in KWin core, but not in libkwineffects. That resulted in
      having effects like slide not working because Qt can't implicitly
      convert QVector<int> to QList<int>.
      Test Plan: Slide effect works again.
      Reviewers: #kwin, graesslin
      Reviewed By: #kwin, graesslin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D16743
  11. 01 Nov, 2018 1 commit
    • David Edmundson's avatar
      [wayland] Use the new plasma virtual desktop protocol · 7e8facc3
      David Edmundson authored
      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
  12. 18 Oct, 2018 1 commit
  13. 11 Oct, 2018 1 commit
  14. 09 Oct, 2018 1 commit
    • Vlad Zahorodnii's avatar
      [effects] Make Scale and Glide effects Wayland-friendly · 769f2659
      Vlad Zahorodnii authored
      The Scale effect and the Glide effect have to animate only ordinary
      windows(i.e. the ones that are considered to be apps).
      On X11, in order to distinguish ordinary windows from combo box popups,
      popup menus, and other popups, those effects check whether given window
      is managed.
      On Wayland, there is no concept of managed/unmanaged windows.
      XDG Shell protocol defines 2 surface roles:
      * xdg_toplevel;
      * and, xdg_popup.
      The former can be used to implement typical windows, the ones that can
      be minimized, maximized, etc.
      The latter can be used to implement tooltips, popup menus, etc. Thus,
      that's a good criteria to filter popup windows.
      CCBUG: 398100
      Reviewers: #kwin, graesslin, davidedmundson
      Reviewed By: #kwin, graesslin, davidedmundson
      Subscribers: davidedmundson, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D15117
  15. 04 Oct, 2018 1 commit
  16. 03 Oct, 2018 1 commit
    • David Edmundson's avatar
      [libkwineffects] Expose getting/setting activeFullScript to scripted effects · 99b33e74
      David Edmundson authored
      Getter is exposed as a property on scripted effect in a way that hides
      pointers from the scripting side.
      Setter is implicitly handled as a property of newly created animations
      and holds the activeFullScreenEffect whilst any of them are active. Like
      existing effects it remains up to the effect author to avoid the
      problems of multiple full screen effects. The RAII lock pattern is
      somewhat overkill currently, but it's the direction I hope we can take
      EffectsHandler in next API break.
      BUG: 396790
      This patch is against the QJSEngine port, though it's not conceptually a
      Test Plan: Unit test
      Reviewers: #kwin, zzag
      Reviewed By: #kwin, zzag
      Subscribers: zzag, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D14688
  17. 29 Aug, 2018 1 commit
  18. 17 Jul, 2018 1 commit
    • Vlad Zahorodnii's avatar
      [libkwineffects] Deprecate Outline feature · 653e98d5
      Vlad Zahorodnii authored
      KWin had Outline effect during KDE SC times, which had been removed in
      KDE SC 4.11. With that effect, also showOutline and hideOutline signals
      had been removed, making it impossible to write effects that show
      outline. Yet, Outline enum value had been left.
      Even though the Outline feature is useless nowadays, in order to keep API
      compatibility, let's just deprecate it.
      Reviewers: #kwin, graesslin
      Reviewed By: #kwin, graesslin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D14188
  19. 30 Jun, 2018 1 commit
    • Vlad Zahorodnii's avatar
      [libkwineffects] Add TimeLine helper · ee88951b
      Vlad Zahorodnii authored
      Most effects use QTimeLine in the following manner
      if (...) {
          m_timeline->setCurrentTime(m_timeline->currentTime() + time);
      } else {
          m_timeline->setCurrentTime(m_timeline->currentTime() - time);
      Because effects do not rely on a timer that QTimeLine has, they can't
      toggle direction of the QTimeLine, which makes somewhat harder to write
      effects. In some cases that's obvious what condition to use to figure
      out whether to add or subtract `time`, but there are cases when it's
      not. In addition to that, setCurrentTime allows to have negative
      currentTime, which in some cases causes bugs.
      And overall, the way effects use QTimeLine is really hack-ish. It makes
      more sense just to use an integer accumulator(like the Fall Apart
      effect is doing) than to use QTimeLine.
      Another problem with QTimeLine is that it's a QObject and some effects
      class WindowInfo
          QTimeLine *timeLine;
          delete timeLine;
      // ...
      QHash<EffectWindow*, WindowInfo> m_windows;
      which is unsafe.
      This change adds the TimeLine class. The TimeLine class is a timeline
      helper that designed specifically for needs of effects.
      TimeLine timeLine(1000, TimeLine::Forward);
      timeLine.value(); // 0.0
      timeLine.running(); // false
      timeLine.done(); // false
      timeLine.value(); // 0.42
      timeLine.running(); // true
      timeLine.done(); // false
      timeLine.value(); // 0.42
      timeLine.running(); // true
      timeLine.done(); // false
      timeLine.value(); // 0.32
      timeLine.running(); // true
      timeLine.done(); // false
      timeLine.value(); // 0.0
      timeLine.running(); // false
      timeLine.done(); // true
      Test Plan: Ran tests.
      Reviewers: #kwin, davidedmundson, graesslin
      Reviewed By: #kwin, davidedmundson, graesslin
      Subscribers: romangg, graesslin, anthonyfieroni, davidedmundson, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D13740
  20. 24 Jun, 2018 2 commits
    • Vlad Zahorodnii's avatar
      [libkwineffects] Save value of the managed property during construction of EffectWindow · f977e608
      Vlad Zahorodnii authored
      When windowClosed signal is emitted, effects can't distinguish managed
      windows from unmanaged windows(e.g. combo box popups, popup menus, etc).
      This leads to dirty hacks like IsXXXWindow. Also, there's a big chance
      that such hack can introduce more bugs and overall this makes harder to
      write/maintain effects.
      This change proposes to save value of managed property during
      construction of EffectWindow. So, its value is preserved with Deleted.
      Test Plan: Manually.
      Reviewers: #kwin, graesslin
      Reviewed By: #kwin, graesslin
      Subscribers: graesslin, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D13690
    • Vlad Zahorodnii's avatar
      [libkwineffects] Emit a signal when active fullscreen effect changed · 95a2c3bf
      Vlad Zahorodnii authored
      Behaviour of some effects depends on presence of active fullscreen effect.
      For example, Dim Inactive effect brightens windows if there is an active
      fullscreen effect. If active fullscreen effect has been changed, these effects
      might need to do some setup work, e.g. schedule repainting, toggle direction
      of a timeline, etc.
      For what it's worth, because the Dim Inactive effect doesn't schedule
      repainting after leaving Desktop Grid, windows aren't dimmed back. One
      need to move mouse to trigger dimming.
      Reviewers: #kwin, graesslin
      Reviewed By: #kwin, graesslin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D13701
  21. 22 Jun, 2018 1 commit
  22. 05 Jun, 2018 1 commit
  23. 17 Nov, 2017 1 commit
  24. 12 Sep, 2017 1 commit
    • Martin Flöser's avatar
      [effects] Support xcbConnectionChanged for support properties · 90e77a93
      Martin Flöser authored
      Several effects announce a support property atom on the root window. This
      change forwards the KWin::Application's signal that the xcbConnection
      changed to the EffectsHandler so that the effects can respond to it.
      All effects which announce a support property connect to this new signal
      and re-announce the property. In case the xcb connection died (future
      XWayland crashing case) it is set to XCB_ATOM_NONE by that. In case the
      xcb connection got created (future delayed XWayland startup) the atom is
      set to the proper value.
      In addition all usages of the support properties are guarded, so that no
      nonesense actions are performed if the support property is XCB_ATOM_NONE.
      Test Plan: Only compile tested as we don't have XFree KWin yet
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D7761
  25. 24 Apr, 2017 1 commit
    • Martin Flöser's avatar
      Add a KSharedConfigPtr for kcminputrc to KWin::Application · 857d8a9c
      Martin Flöser authored
      There are a few places where KWin needs to read values from kcminputrc.
      As I need to add yet another one it makes more sense to properly
      structure it like in other cases and have only one kcminputrc hold in
      the application. This also allows to better mock the config values in
      the integration tests.
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D5540
  26. 15 Apr, 2017 1 commit
    • Martin Flöser's avatar
      [effects] Use arg="true" in the kcfg files · 2132b1e0
      Martin Flöser authored
      By changing all kcfg to have arg="true" we can pass in the same
      KSharedConfigPtr into all effects. This allows to have fake config in
      the tests and in the planned effect demo mode.
      Also it means that we don't have to hardcode the name kwinrc into the
      files. In the configs - where we cannot access the effectshandler - we
      use the define KWIN_CONFIG which gets generated based on the compile
      time arguments.
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D3571
  27. 07 Apr, 2017 1 commit
  28. 05 Apr, 2017 1 commit
  29. 29 Mar, 2017 1 commit
    • David Edmundson's avatar
      Provide scale offset to WindowVertex calculation · ebebc6ca
      David Edmundson authored
      WindowVertex contains the x position and also the relative texture x position
      Our textures are scaled bigger than kwin's resolution, so this makes sure we set the right
      texture position.
      Otherwise our final array ends up using 0 to 0.5 of the texture, not 0 to 1.
      Test Plan:
      Opened some 2x windows, on a 1x output.
      It looked how it should do, instead of it being double the size and cropped
      Tested some things that use quads, like wobbly windows
      Reviewers: #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D3502
  30. 27 Mar, 2017 1 commit
    • Martin Flöser's avatar
      Add support for global touchpad swipe gestures · 22c91df2
      Martin Flöser authored
      This change adds global touchpad swipe gestures to the
      GlobalShortcutsManager and hooks up the swipe gestures as defined at the
      Plasma Affenfels sprint:
       * swipe up: Desktop Grid
       * swipe down: Present Windows
       * swipe left: previous virtual desktop
       * swipe right: next virtual desktop
      The main work is handled by two new classes: SwipeGesture and
      GestureRecognizer. This is implemented in a way that it can be extended
      to also recognize touch screen gestures and pinch gestures.
      The SwipeGesture defines what is required for the gesture to trigger.
      Currently this includes the minimum and maximum number of fingers
      participating in the gesture and the direction. The gesture gets
      registered in the GestureRecognizer.
      The events for the gesture are fed into the GestureRecognizer. It
      evaluates which gestures could trigger and tracks them for every update
      of the gesture. In the process of the gesture tracking the
      GestureRecognizer emits signals on the Gesture:
       * started: when the Gesture gets considered for a sequence
       * cancelled: the Gesture no longer matches the sequence
       * triggered: the sequence ended and the Gesture still matches
      The remaining changes are related to hook up the existing shortcut
      framework with the new touchpad gestures. The GlobalShortcutManager
      gained support for it, InputRedirection and EffectsHandler offer methods
      to register a QAction. VirtualDesktopManager, PresentWindows and
      DesktopGrid are adjusted to support the gesture.
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel
      Tags: #plasma_on_wayland
      Differential Revision: https://phabricator.kde.org/D5097
  31. 25 Jan, 2017 1 commit
    • Martin Flöser's avatar
      Add support for skip close animation to OnScreenMessage · d38bce77
      Martin Flöser authored
      This change adds support for marking the OnScreenMessage as it should
      skip close animation. The screenshot effect is adjusted to use the
      on screen message instead of the custom effect frame.
      Test Plan: Message window is not captured when taking screenshot
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D4091
  32. 24 Dec, 2016 1 commit
    • Martin Flöser's avatar
      Add support for on-screen-message to kwineffects · ab456596
      Martin Flöser authored
      This adds support for the new on-screen-message support to the
      kwineffects API and makes use of it in the colorpicker effect.
      Not yet added to screenshot effect as for that we need support for
      skip close animation on the on-screen-message window.
      Reviewers: #plasma, #kwin
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D3803
  33. 25 Nov, 2016 2 commits
    • David Edmundson's avatar
      Initialise all variables for WindowVertex. · adbd9fc5
      David Edmundson authored
      The default constructor shouldn't have been used anyway, but better safe
      than sorry.
      Reviewers: #plasma, graesslin
      Reviewed By: #plasma, graesslin
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D3453
    • Martin Flöser's avatar
      Add interactive position selection to screenshot screen under cursor · f9f7b84c
      Martin Flöser authored
      A second interactive selection mode gets added to select a position on
      the screen. This is handled by the same input event filter as for the
      window selection. Just that instead of returning a window, it returns a
      This allows to pick a point on the screen which we need to screenshot
      the screen under the mouse cursor and in future for color picking.
      The screenshot effect provides two new dbus methods to (interactively)
      select a screen or fullscreen. This allows spectacle to screenshot the
      (full) screen with still having the user in control.
      Reviewers: #kwin, #plasma_on_wayland, bgupta
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D3475
  34. 17 Nov, 2016 1 commit
    • Martin Flöser's avatar
      [effects] Add interactive window selection mode to ScreenshotEffect · 27376e39
      Martin Flöser authored
      EffectsHandler gains a new method to startInteractiveWindowSelection
      which just delegates to the one in Platform. That way a window can be
      selected and returned to an Effect.
      The screenshot effect makes use of this new functionality and provides
      an interactive window screenshot mode which saves to a temporary file.
      Note that this is not yet the variant intended for use in spectacle.
      Test Plan: Took a screenshot on Wayland
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D3367
  35. 16 Nov, 2016 3 commits