1. 02 Apr, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Make it possible to have a separate cursor for the tablet · 6abd23ed
      Aleix Pol Gonzalez authored
      Summary:
      As is KWin only had 1 Cursor which was a singleton. This made it impossible for
      us to properly implement the tablet (as in drawing tablets) support and show where
      we're drawing.
      This patch makes it possible to have different Cursors in KWin, it makes all the
      current code still follow the mouse but the tablet can still render a cursor.
      
      Test Plan: Tests pass, been using it and works as well as before but with beautiful tablet cursors.
      
      Reviewers: #kwin, cblack, davidedmundson
      
      Reviewed By: #kwin, cblack, davidedmundson
      
      Subscribers: davidedmundson, cblack, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D28155
      6abd23ed
  2. 01 Apr, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Reduce the amount of objects that are compiled several times · dbac4bce
      Aleix Pol Gonzalez authored
      Summary:
      We build some objects several times which makes it uncomfortable to develop KWin
      since every time we modify something a lot of things get rebuilt. This should
      help a bit although it doesn't solve all the problems.
      
      Test Plan: Builds, tests pass
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: davidedmundson, zzag, anthonyfieroni, iasensio, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D28445
      dbac4bce
  3. 26 Mar, 2020 1 commit
  4. 18 Mar, 2020 1 commit
  5. 17 Mar, 2020 1 commit
  6. 14 Mar, 2020 1 commit
  7. 04 Mar, 2020 2 commits
  8. 02 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      [autotests] Fix failing KeyboardLayoutTest::testNumLock() · 5d580b9f
      Vlad Zahorodnii authored
      Summary:
      Since Qt::KeypadModifier is set only for keypad keys and not the NumLock
      key, we need to press at least one keypad key to determine whether
      numlock is actually on. On the other hand, we know that when numlock is
      on, the corresponding LED is also on. So we could check the LED rather
      than press two keys.
      
      Test Plan: testKeyboardLayout passes.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27789
      5d580b9f
  9. 28 Feb, 2020 3 commits
    • Vlad Zahorodnii's avatar
      [autotests] Fix PointerInputTest::testCursorImage() · fcea0eb2
      Vlad Zahorodnii authored
      Summary:
          FAIL!  : KWin::PointerInputTest::testCursorImage() Compared QImages differ in device pixel ratio.
             Actual   (((p->cursorImage()))): 2
             Expected (blueScaled): 1
             Loc: [/home/vlad/Workspace/KDE/src/kde/workspace/kwin/autotests/integration/pointer_input.cpp(1058)]
      
      Test Plan: The test passes.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27725
      fcea0eb2
    • Vlad Zahorodnii's avatar
      Refactor geometry constraints code · a75fb7f8
      Vlad Zahorodnii authored
      Summary:
      Currently, there are a couple of issues with sizeForClientSize(). First
      of all, we have a method called clientSizeToFrameSize() which does similar
      thing except applying geometry constraints and checking window rules. The
      other issue is that sizeForClientSize() is doing a bit too much, it checks
      window rules, it applies a bunch of geometry constrains. Sometimes it
      does not perform conversion between client sizes and frame sizes!
      
      This change attempts to address those issues by replacing sizeForClientSize
      with two similar methods and changing semantics of some methods of the
      X11Client class.
      
      The most significant difference between sizeForClientSize() and the new
      methods is that neither constrainClientSize() nor constrainFrameSize()
      check window rules. This is up to users of those methods. In many places,
      we don't have to check window rules because we check isResizable(),
      which returns false if the frame size is enforced by a window rule.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, romangg, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D26828
      a75fb7f8
    • Vlad Zahorodnii's avatar
      [autotests] Add tests for PMinSize, PMaxSize, and PResizeInc geometry hints · e32374ab
      Vlad Zahorodnii authored
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27400
      e32374ab
  10. 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
  11. 14 Feb, 2020 1 commit
  12. 13 Feb, 2020 1 commit
  13. 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
  14. 31 Jan, 2020 1 commit
  15. 23 Jan, 2020 1 commit
    • Vlad Zahorodnii's avatar
      [wayland] Keep the opposite corner still when resizing a window · d079f5da
      Vlad Zahorodnii authored
      Summary:
      According to the xdg-shell spec, configure events carry the maximum
      window geometry size. If a client wants to enforce aspect ratio, it
      may attach a buffer with smaller size. We need to account for that
      when determining frame geometry in the commit handler.
      
      I'm targeting 5.18 branch.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D26886
      d079f5da
  16. 14 Jan, 2020 1 commit
  17. 02 Dec, 2019 1 commit
  18. 27 Nov, 2019 2 commits
    • Vlad Zahorodnii's avatar
      Drop some custom list typedefs · 9d4a3259
      Vlad Zahorodnii authored
      Summary:
      Qt has its own thing where a type might also have corresponding list
      alias, e.g. QObject and QObjectList, QWidget and QWidgetList. I don't
      know why Qt does that, maybe for some historical reasons, but what
      matters is that we copy this pattern here in KWin. While this pattern
      might be useful with some long list types, for example
      
          QList<QWeakPointer<TabBoxClient>> TabBoxClientList
      
      in general, it causes more harm than good. For example, we've got two
      new client types, do we need corresponding list typedefs for them? If
      no, why do we have ClientList and so on?
      
      Another problem with these typedefs is that you need to include utils.h
      header in order to use them. A better way to handle such things is to
      just forward declare a client class (if that's possible) and use it
      directly with QList or QVector. This way translation units don't get
      "bloated" with utils.h stuff for no apparent reason.
      
      So, in order to make code more consistent and easier to follow, this
      change drops some of our custom typedefs. Namely ConstClientList,
      ClientList, DeletedList, UnmanagedList, ToplevelList, and GroupList.
      
      Test Plan: Compiles.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D24950
      9d4a3259
    • 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. 26 Nov, 2019 1 commit
  20. 25 Oct, 2019 1 commit
    • Vlad Zahorodnii's avatar
      [scripting] Provide conversion functions for AbstractClient · a738ecce
      Vlad Zahorodnii authored
      Summary:
      If no conversion functions are provided for a QObject-subclass, then
      QScriptEngine will use QScriptEngine::newQObject() method without any
      special options to convert an instance of that QObject-subclass to a
      QScriptValue. However, it's very important that every client object is
      wrapped with PreferExistingWrapperObject option. We need that option
      because a script may set a property on a client object and that property
      must remain until it's deleted by the script.
      
      BUG: 413044
      FIXED-IN: 5.17.2
      
      Test Plan: New test.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D24944
      a738ecce
  21. 11 Oct, 2019 1 commit
    • Marco Martin's avatar
      [wayland] Make sure fullscreen windows aren't repositioned · 10ace126
      Marco Martin authored
      Summary:
      on X11, setFullScreen is always called after Placement::place()
      so they always have the correct geometry.
      on wayland, the window if is shown directly as fullscren,
      is set fullscreen in init() then place() is evecuted, potentially
      moving it to a wrong position and potentially even size (which happens
      with maximiziong placement strategy)
      so instead of place() the client needs to be explicitly set at
      fullscreen geometry
      
      Test Plan:
      fullscreen windows always appear with the proper geometry
      autotests still pass
      
      Reviewers: #kwin, #plasma, davidedmundson
      
      Reviewed By: #kwin, #plasma, davidedmundson
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D24542
      10ace126
  22. 02 Oct, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Rename geometry property to frameGeometry · 7d4471eb
      Vlad Zahorodnii authored
      Summary:
      In order to properly implement xdg_surface.set_window_geometry we need
      two kinds of geometry - frame and buffer. The frame geometry specifies
      visible bounds of the client on the screen, excluding client-side drop
      shadows. The buffer geometry specifies rectangle on the screen that the
      attached buffer or x11 pixmap occupies on the screen.
      
      This change renames the geometry property to frameGeometry in order to
      reflect the new meaning assigned to it as well to make it easier to
      differentiate between frame geometry and buffer geometry in the future.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D24334
      7d4471eb
  23. 29 Sep, 2019 1 commit
  24. 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
  25. 24 Sep, 2019 1 commit
  26. 23 Sep, 2019 5 commits
    • Vlad Zahorodnii's avatar
      a4ec7978
    • 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
      [autotests] Don't test wl-shell clients · d92d6e77
      Vlad Zahorodnii authored
      Summary:
      This change removes all traces of wl-shell in the test suite. That's a
      prerequisite for dropping wl-shell support in KWin.
      
      Given that wl-shell and xdg-shell are not interchangeable, some tests
      were removed and initialization sequence in some tests was adjusted.
      
      The most notable change is ensuring that each plasmashell window sets
      its role and initial position before committing the surface. Setting
      those properties before the first surface commit is important because
      our window placement code needs to know window type in order to
      avoid maximizing panels, popups, etc.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23561
      d92d6e77
    • 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
  27. 12 Sep, 2019 3 commits