1. 02 Jul, 2018 4 commits
  2. 01 Jul, 2018 3 commits
  3. 30 Jun, 2018 4 commits
    • Vlad Zahorodnii's avatar
      [effects/cube] Port to TimeLine · 5e24bed3
      Vlad Zahorodnii authored
      Summary: Depends on D13740
      
      Test Plan: "Activated" the desktop cube, animations still work.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13765
      5e24bed3
    • Vlad Zahorodnii's avatar
      [effects/minimizeanimation] Port to TimeLine · 0be5010c
      Vlad Zahorodnii authored
      Summary: Depends on D13740
      
      Test Plan: Minimized/Unminimized System Setting window, still works.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13761
      0be5010c
    • Vlad Zahorodnii's avatar
      [effects/magiclamp] Port to TimeLine · 138b1858
      Vlad Zahorodnii authored
      Summary: Depends on D13740
      
      Test Plan: Minimized/Unminimized System Setting window, still works.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13762
      138b1858
    • Vlad Zahorodnii's avatar
      [libkwineffects] Add TimeLine helper · ee88951b
      Vlad Zahorodnii authored
      Summary:
      Most effects use QTimeLine in the following manner
      
      ```lang=cpp
      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
      do
      
      ```lang=cpp
      class WindowInfo
      {
      public:
          ~WindowInfo();
      
          QTimeLine *timeLine;
      };
      
      WindowInfo::~WindowInfo()
      {
          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.
      
      Demo
      
      ```lang=cpp
      TimeLine timeLine(1000, TimeLine::Forward);
      timeLine.setEasingCurve(QEasingCurve::Linear);
      
      timeLine.value(); // 0.0
      timeLine.running(); // false
      timeLine.done(); // false
      
      timeLine.update(420);
      timeLine.value(); // 0.42
      timeLine.running(); // true
      timeLine.done(); // false
      
      timeLine.toggleDirection();
      timeLine.value(); // 0.42
      timeLine.running(); // true
      timeLine.done(); // false
      
      timeLine.update(100);
      timeLine.value(); // 0.32
      timeLine.running(); // true
      timeLine.done(); // false
      
      timeLine.update(1000);
      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
      ee88951b
  4. 29 Jun, 2018 2 commits
  5. 26 Jun, 2018 2 commits
    • Roman Gilg's avatar
      Make keyboard focus a pointer constraints necessity · 0bd5eff8
      Roman Gilg authored
      Summary:
      This patch changes KWin's pointer constraining behavior by only allowing
      constraints if the surface has keyboard focus. In case the client activation
      state changes, it rechecks it.
      
      Test Plan:
      Manually with the pointer constraints test application and opening the
      launcher by pressing meta. Also amended autotest.
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: graesslin, davidedmundson, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T8923
      
      Differential Revision: https://phabricator.kde.org/D13492
      0bd5eff8
    • Script Kiddy's avatar
      SVN_SILENT made messages (.desktop file) - always resolve ours · ea05ac38
      Script Kiddy authored
      In case of conflict in i18n, keep the version of the branch "ours"
      To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
      ea05ac38
  6. 24 Jun, 2018 6 commits
  7. 23 Jun, 2018 6 commits
    • David Edmundson's avatar
      Load Kwin's internal cursors for the highest resolution of attached monitors · c857c035
      David Edmundson authored
      Test Plan:
      Hovered over decoration
      Looked super crystal clear
      Same physical size as when I hover over window contents (which had a buffer scale of 1)
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13608
      c857c035
    • David Edmundson's avatar
      Set correct DPR on wayland cursors received from remote buffers · 1761b75b
      David Edmundson authored
      Summary:
      It will then be renderered appropriately when painting to the output
      buffer.
      
      Test Plan: Updated unit test, plus used with other relevant patches
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13606
      1761b75b
    • David Edmundson's avatar
      Remove concept of resolution dependent cursors · 6bdfea6d
      David Edmundson authored
      Summary:
      It's not a concept that makes sense with proper scaling.
      
      Cursor should be the big if you chose a big size, small if you choose a small size,
      regardless of what output it happens to be on.
      
      Test Plan:
      Set size to 0
      Ran kwin
      Cursor size was fine
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13607
      6bdfea6d
    • David Edmundson's avatar
      DRM cursor scaling · 2cc42ecc
      David Edmundson authored
      Summary:
      We pass the buffer scale of the cursor through QImage::devicePixelRatio.
      
      When copying the cursor with QPainter use Qt's in-built functionality to
      handle resizing the cursor pixmap as necessary to match the screen.
      
      As we're now resizing the cursor, the hotspot needs translating from
      logical to device co-ordinates.
      
      Test Plan: Used with associated patches
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13605
      2cc42ecc
    • David Edmundson's avatar
      Support cursor scaling in X windowed backend · 9ff1f77e
      David Edmundson authored
      Test Plan:
      Ran kwin_wayland --windowed  --scale2
      
      Hovered over deco. Got massive and detailed cursor
      Hovered over a wayland client (Qt 5.11 not dev)
      Got a massive, but slightly blocky cursor
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13642
      9ff1f77e
    • Vlad Zahorodnii's avatar
      [effects/slide] Disable "Slide docks" · 263503f8
      Vlad Zahorodnii authored
      Summary:
      D9638 made docks to slide to "fix" the problem when switching to a
      virtual desktop that has a window in full screen mode:
      
      {F5615542}
      
      As it turns out, people don't like this kind of behaviour. Another
      problem with sliding of docks is that pager goes away.
      
      This change disables sliding of docks by default. One can enable sliding
      of docks by checking "Slide docks" checkbox in slide effect KCM.
      
      Yet, transition to/from virtual desktop with a window in full screen
      mode doesn't look great but that's somewhat acceptable:
      
      {F5915681}
      
      //(we don't see issues that are present in the video above because the new slide effect elevates docks if sliding of docks is disabled)//
      
      Test Plan: Switched between virtual desktops, the default panel didn't slide.
      
      Reviewers: #kwin, #plasma, #vdg, ngraham, graesslin
      
      Reviewed By: #kwin, #plasma, #vdg, ngraham, graesslin
      
      Subscribers: ngraham, graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13566
      263503f8
  8. 22 Jun, 2018 2 commits
    • Vlad Zahorodnii's avatar
      [libkwineffects] Add keepBelow property to EffectWindow · 6a175ece
      Vlad Zahorodnii authored
      Summary:
      EffectWindow has keepAbove property, but not keepBelow.
      
      This change adds keepBelow property as a counterpart to keepAbove.
      
      Test Plan: Manually.
      
      Reviewers: #kwin, mart
      
      Reviewed By: #kwin, mart
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13650
      6a175ece
    • Vlad Zahorodnii's avatar
      Add some missing properties to Deleted · dcc349c1
      Vlad Zahorodnii authored
      Summary:
      ### keepAbove
      
      Some effects(e.g. Dim Inactive) can take keep above state of a window
      into account when they are making decision whether to operate on it.
      Because Deleted doesn't expose keepAbove property, it will be always
      `true`, which is wrong.
      
      ### keepBelow
      
      This property was added as a counterpart to keepAbove.
      
      ### caption
      
      That's mostly for debugging purposes, e.g.
      
      ```lang=cpp
      void CoolEffect::windowClosed(EffectWindow *w)
      {
          qDebug() << w->caption() << "has been closed";
          qDebug() << "keep above:" << w->keepAbove();
      }
      ```
      
      Test Plan: Manually.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13649
      dcc349c1
  9. 21 Jun, 2018 2 commits
  10. 20 Jun, 2018 1 commit
    • David Edmundson's avatar
      Workaround crash in Aurorae destruction · 275b7ee0
      David Edmundson authored
      Summary:
      Workaround QtBug-68997
      
      Deleting of a RenderControl/render controlled window triggers deletion
      of other queued deleted items, putting KWin in a corrupt state. See Qt
      bug report.
      
      Deleting this queued means we know we don't have anything else going on
      in the stack which should make this somewhat safe.
      
      BUG: 395346
      
      Test Plan:
      Couldn't reproduce original crash. Based purely on the incomplete backtrace and code reading
      
      Set an Aurorae theme. Closed some windows. Things still worked as before
      
      Reviewers: #kwin, #plasma, mart
      
      Reviewed By: #kwin, #plasma, mart
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13614
      275b7ee0
  11. 19 Jun, 2018 4 commits
    • Vlad Zahorodnii's avatar
      [effects] Ignore previous state of WindowForceBlurRole · e9ab3485
      Vlad Zahorodnii authored
      Summary:
      Currently, effects like Maximize, Slide Back have problems with setting
      WindowForceBlurRole. They store previous state of WindowForceBlurRole.
      This is wrong. Instead they should either ignore previous state of
      WindowForceBlur or refcount forced role.
      
      There's no need for refcounting right now. For example, if several effects
      force blur or background contrast, they are most likely in a conflict.
      Please notice that the Desktop Grid effect uses the Present Windows
      effect only to calculate transformations.
      
      Some other problems with the code that sets WindowForceBlurRole:
      * Maximize effect stores previous state of WindowForceBlurRole only
        for one window. It ignores the fact that there could be several
        active maximize animations;
      * Desktop Grid/Present Windows/Slide back don't clean after themselves.
        So, after using those effects for good amount of times, memory usage
        will bump.
      
      Test Plan:
      * Enabled blur for Konsole
      * Maximized Konsole
      * Activated Present Windows
      * Activated Desktop Grid
      * Raised another window(to trigger Slide Back)
      
      Reviewers: #kwin, fredrik
      
      Reviewed By: fredrik
      
      Subscribers: fredrik, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13479
      e9ab3485
    • Jonathan Esk-Riddell's avatar
      Update version number for 5.13.1 · e92b9a65
      Jonathan Esk-Riddell authored
      GIT_SILENT
      e92b9a65
    • Vlad Zahorodnii's avatar
      [effects/slide] Add "Slide desktop background" option · 64d1b0e9
      Vlad Zahorodnii authored
      Summary:
      Some people may not like the sliding of desktop background. Add
      corresponding option to disable the sliding of desktop background.
      
      By disabling the sliding of desktop background and docks, one can
      get old slide effect.
      
      {F5912713, layout=center, size=full}
      
      Test Plan:
      * Unchecked "Slide desktop background" checkbox, switched desktop;
      * Checked "Slide desktop background" checkbox, switched desktop.
      
      Reviewers: #kwin, #plasma, #vdg, mart
      
      Reviewed By: #kwin, #plasma, #vdg, mart
      
      Subscribers: romangg, abetts, ngraham, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13542
      64d1b0e9
    • Script Kiddy's avatar
      SVN_SILENT made messages (.desktop file) - always resolve ours · 1879303d
      Script Kiddy authored
      In case of conflict in i18n, keep the version of the branch "ours"
      To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
      1879303d
  12. 18 Jun, 2018 4 commits
    • Alex Nemeth's avatar
      [libkwineffects/kwinglutils] Calculate correct srcY0 and srcY1 in... · 98231607
      Alex Nemeth authored and David Edmundson's avatar David Edmundson committed
      [libkwineffects/kwinglutils] Calculate correct srcY0 and srcY1 in GLRenderTarget::blitFromFramebuffer
      
      Summary:
      There are several spaces that have to be considered in `GLRenderTarget::blitFromFramebuffer`:
      * KWin logical space: the origin is located at the global top-left corner
      * display space: the origin is located at the top-left corner of monitor/display
      * OpenGL screen space: the origin is located at the bottom-left corner of monitor/display
      
      Given `s`, which is in the KWin logical space, we have to transform it to the display space, then to the OpenGL screen space:
      
      * KWin logical space -> display space: `y' = s.y() - s_virtualScreenGeometry.y()`
      * display space -> OpenGL screen space: `y'' = s_virtualScreenGeometry.height() - y'`
      
      Overall, `srcY0` and `srcY1` should be written as follows:
      
      ```
      srcY0 = s_virtualScreenGeometry.height() - (s.y() - s_virtualScreenGeometry.y() + s.height())
      srcY1 = s_virtualScreenGeometry.height() - (s.y() - s_virtualScreenGeometry.y())
      ```
      
      Test Plan:
      Tweak background contrast effect to use GLRenderTarget::blitFromFramebuffer
      
      ```
      diff --git a/effects/backgroundcontrast/contrast.cpp b/effects/backgroundcontrast/contrast.cpp
      index f920fcd88..5247d83b8 100644
      --- a/effects/backgroundcontrast/contrast.cpp
      +++ b/effects/backgroundcontrast/contrast.cpp
      @@ -447,11 +447,10 @@ void ContrastEffect::doContrast(EffectWindow *w, const QRegion& shape, const QRe
           GLTexture scratch(GL_RGBA8, r.width() * scale, r.height() * scale);
           scratch.setFilter(GL_LINEAR);
           scratch.setWrapMode(GL_CLAMP_TO_EDGE);
      -    scratch.bind();
      
      -    const QRect sg = GLRenderTarget::virtualScreenGeometry();
      -    glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (r.x() - sg.x()) * scale, (sg.height() - sg.y() - r.y() - r.height()) * scale,
      -                        scratch.width(), scratch.height());
      +    GLRenderTarget scratchTarget(scratch);
      +    scratchTarget.blitFromFramebuffer(r);
      +    scratch.bind();
      
           // Draw the texture on the offscreen framebuffer object, while blurring it horizontally
      
      ```
      
      GLRenderTarget::blitFromFramebuffer without this change:
      {F5817883, layout=center, size=full}
      
      Reviewers: #kwin, fredrik, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kpiwowarski, davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D12452
      98231607
    • Alex Nemeth's avatar
      Fix multimonitor blur · 2419c949
      Alex Nemeth authored and David Edmundson's avatar David Edmundson committed
      Summary:
      On wayland blur on secondary monitor would not render correctly.
      
      BUG: 393723
      Depends on D12452
      
      Test Plan:
       - use more than one output
       - log in in a wayland session
       - open a transparent window (for example: Konsole with transparent and blur enabled profile)
       - drag the window to another screen
       - blurs the content under the window corretly
      
      Reviewers: #kwin, graesslin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: apol, zzag, davidedmundson, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D12678
      2419c949
    • David Edmundson's avatar
      Merge branch 'Plasma/5.13' · 6f6f2243
      David Edmundson authored
      6f6f2243
    • Alex Nemeth's avatar
      [effects/blur] Check for blitting support · be3168b8
      Alex Nemeth authored and David Edmundson's avatar David Edmundson committed
      Summary:
      In D12678 blur was changed to use `blitFromFramebuffer()` instead of `glCopyTexSubImage2D()`
      Now it checks if the GPU supports it.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13246
      be3168b8