1. 20 Nov, 2020 1 commit
  2. 23 Oct, 2020 1 commit
  3. 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
  4. 12 Jun, 2020 1 commit
    • Nate Graham's avatar
      Allow corner-tiling by quickly combining edge tiling shortcuts · 87578bfc
      Nate Graham authored
      Currently the only way for a uuser to invoke corner-tiling is to
      manually set shortcuts for them. This patch adds another option: invoke
      the existing shortcuts for edge tiling in a combined manner in quick
      succession.
      
      For example, hitting Meta+Left and then Meta+Up within a one-second
      period will tile the active window into the top left corner. In practice
      you hold down the Meta key and then press Left then Up (or Up and then
      Left), and I think it feels very natural. Linux Mint's window manager
      has this feature and I always missed it when I left Mint for the KDE
      world.
      
      Autotests for existing tiling shortcuts are adjusted to not break, and
      additional tests for the new tiling options are added.
      87578bfc
  5. 01 Jun, 2020 1 commit
    • Vlad Zahorodnii's avatar
      [wayland] Rework xdg-shell implementation · 31ea780d
      Vlad Zahorodnii authored
      Summary:
      This change splits the XdgShellClient class to better match existing
      abstractions in the xdg-shell protocol and fix a few issues related to
      sending configure events.
      
      In the new client classes, configure events are handled differently.
      Instead of blocking configure events, we try to send them as late as
      possible. Delaying configure events will let us merge changeMaximize()
      for X11 clients and Wayland clients and it also fixes the bug where
      we don't send the final configure event when user has finished resizing
      a window.
      
      Given that configure events are not sent immediately, XdgSurfaceClient
      keeps the last requested frame geometry and the last requested client
      geometry.
      
      This patch doesn't intend to fix all issues in kwin's implementation of
      the xdg-shell protocol. For example, we still handle surface unmapping
      very poorly.
      
      Test Plan: Tests pass.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27861
      31ea780d
  6. 22 May, 2020 1 commit
    • Nate Graham's avatar
      Position OSD a bit farther down · 85b9aea5
      Nate Graham authored
      Summary:
      A common user complains is that our OSDs--particularly the volume OSD--are too intrusive
      and get in the way of the screen content. For example when adjusting the volume while
      watching a full-screen video, the volume change OSD will typically appear right in the
      middle of an actor's face.
      
      D20569 was an attempt to use a horizontal OSD to alleviate this issue. It mostly worked,
      but IMO it was still positioned too high up.
      
      This patch moved the placement down a little bit to make the OSD appear even farther from
      the center of the screen to make it less likely to
      
      I tried not to move it down too far or else it would interfere with subtitles in videos.
      
      Test Plan:
      With D20569:
      
      {F8269172}
      {F8269164}
      {F8269163}
      
      Reviewers: #kwin, #vdg, broulik, ndavis, zzag
      
      Reviewed By: #kwin, #vdg, ndavis, zzag
      
      Subscribers: meven, ndavis, niccolove, baberts, davidedmundson, filipf, zzag, kori, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D29263
      85b9aea5
  7. 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
  8. 28 Feb, 2020 1 commit
    • 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
  9. 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
  10. 22 Jan, 2020 1 commit
  11. 27 Nov, 2019 1 commit
    • 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 d...
      9d4a3259
  12. 02 Oct, 2019 3 commits
  13. 26 Sep, 2019 1 commit
  14. 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
  15. 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
  16. 16 Sep, 2019 3 commits
  17. 14 Sep, 2019 1 commit
  18. 06 Sep, 2019 1 commit
  19. 31 Aug, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Switch to Q_ASSERT · 7a3722b4
      Vlad Zahorodnii authored
      Summary:
      Switch to Q_ASSERT in order to make code a bit more consistent. We have
      places where both assert and Q_ASSERT are used next to each other. Also,
      distributions like Ubuntu don't strip away assert(), let's hope that
      things are a bit different with Q_ASSERT.
      
      Test Plan: Compiles.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: romangg, davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23605
      7a3722b4
  20. 29 Jul, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Use more traditional doxygen style · 684b4b63
      Vlad Zahorodnii authored
      Summary:
      So far we were following a bit unique and rare doxygen comment style:
      
          /**
           * Contents of the comment.
           **/
      
      Doxygen comments with this style look balanced and neat, but many people
      that contribute to KWin don't follow this style. Instead, they prefer
      more traditional doxygen comment style, i.e.
      
          /**
           * Contents of the comment.
           */
      
      Reviewing such changes has been a bit frustrating for me (so selfish!)
      and for other contributors.
      
      This change switches doxygen comment style in KWin to a more traditional
      style. The main reason for doing this is to make code review process easier
      for new contributors as well us.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D22812
      684b4b63
  21. 09 Jul, 2019 1 commit
  22. 24 Jun, 2019 1 commit
  23. 02 May, 2019 1 commit
  24. 23 Apr, 2019 1 commit
  25. 09 Apr, 2019 1 commit
    • David Edmundson's avatar
      [wayland] Place all toplevels before the first configure · efc62941
      David Edmundson authored
      Summary:
      Currently popups get positioned once at the initial configure, to set
      the correct size and again when they are mapped.
      
      Toplevels are currently only positioned when they are mapped. This works
      for all cases where the the toplevel defines its own size, but not if
      the window should have an initial size set by the placement strategy or
      window rules. Most notably the maximised placement strategy used on
      plasma mobile.
      
      Being out of sync and resizing later currently causes a positioning bug
      when plasma mobile is used with XdgShell.
      
      This patch repositions all top levels that don't have a position set
      through the plasma interface.
      
      Test Plan: Relevant unit test
      
      Reviewers: #kwin, bshah
      
      Reviewed By: bshah
      
      Subscribers: zzag, bshah, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D20241
      efc62941
  26. 22 Feb, 2019 1 commit
    • David Edmundson's avatar
      [wayland] Handle sizes in ShellClient::transientPlacement · 7014a339
      David Edmundson authored
      Summary:
      placeIn did not handle the case for a popup not having had the size
      already set and only being available via
      m_xdgShellPopup->initialSize(). This is needed if we want to call placeIn
      at the correct time, before the window is mapped.
      
      There was also a logic bug when sliding popups. We called the
      confusingly named setX thinking it would be move the popup keeping the
      width the same. In practice it moves the left edge keeping the right
      position the same. This wasn't an issue as the size was
      discarded.
      
      Handling the resize constraint is not yet done, but it should now be
      even more trivial.
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18956
      7014a339
  27. 12 Feb, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Overhaul doxygen comments · 7b20e1f6
      Vlad Zahorodnii authored
      Summary:
      We have a mix of different doxygen comment styles, e.g.
      
          /*!
            Foo bar.
           */
      
          /**
           * Foo bar.
           */
      
          /** Foo bar.
           */
      
          /**
           * Foo bar.
           */
      
          /**
           * Foo bar.
           **/
      
      To make the code more consistent, this change updates the style of all
      doxygen comments to the last one.
      
      Test Plan: Compiles.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18683
      7b20e1f6
  28. 31 Dec, 2018 1 commit
    • Martin Flöser's avatar
      Honor struts when placing Wayland transients · 792d8404
      Martin Flöser authored
      Summary:
      So far transients were placed anywhere on the screen. This behavior was
      inspired from X11 where context menus were able to overlap any other
      window and use the complete screen area. On X11 context menus and
      similar windows are override redirect and thus above all windows managed
      by KWin.
      
      On Wayland, though, context menus and similar and windows just like any
      other window and thus follow stacking constraints like the parent
      window. A context menu is stacked just above it's parent and is
      (normally) below any panels. This resulted in problems that context menu
      are stacked behind the panel with unreachable options.
      
      This change changes the placement for transients to use the
      PlacementArea instead of a screen geometry. Thus the transient does not
      render behind the panel. Only in case of a fullscreen the struts are
      ignored.
      
      BUG: 389222
      FIXED-IN: 5.15
      
      Test Plan: New test case
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D17826
      792d8404
  29. 23 Oct, 2018 1 commit
    • David Edmundson's avatar
      [wayland] Set better placement for XDG Toplevels · bdf348c6
      David Edmundson authored
      Summary:
      XDG Popups will have a transient parent and positional information.
      XDG Toplevels can have a transient parent without having positional
      information.
      
      Currently we set that we have a transient placement hint of 0,0 which
      means the newly opened children go to the top left of the parent.
      
      This new code paths treat child top levels as dialogs centering them to
      the parent.
      
      BUG: 393167
      
      Test Plan:
      Dolphin help->about
      Appeared where it does on X
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16293
      bdf348c6
  30. 20 Oct, 2018 2 commits
    • David Edmundson's avatar
      [wayland] XdgPopup Positioning · 8ef363cc
      David Edmundson authored
      Summary:
      Support XDGShell Positioning. This gives a client a lot more control
      over where the popup will be placed as well as control over how to
      handle constraints. i.e what to do if the popup doesn't fit.
      
      trasientOffset was replaced with a method on the client as semantically
      it's the role of the client to handle constraints.
      
      Both slide and flip constraint adjustments are implemented. Resize
      constraint adjustment will be handled in a future patch.
      
      WlShell is handled by treating it as 1x1 sized anchor with slide
      constraint adjustment.
      
      Test Plan:
      Manual test of a client implementing xdgpopup exists in kwayland
      Extensive unit test here
      
      Existing WlShell test passes (after D16314 which fixes the original)
      XdgPopup has a new unit test suite against manually calculated values
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16325
      8ef363cc
    • David Edmundson's avatar
      [wayland] Fix Placement::placeTransient keeping screens in bound. · d70c3568
      David Edmundson authored
      Summary:
      If a window flows off the left, we move left of the popup to the left
      edge of the screen.
      
      Currently if a window flows off the right, we move the window back by
      it's own width, leaving it floating at a random point.
      For consistency we should be setting it so the right edge of the popup is on the right
      edge of the screen.
      
      So in the auto test for the "right border" case:
      The screen is 1280 wide, and we open a 10px popup at 1279  the final X
      should be 1270.
      
      Test Plan: Unit test
      
      Reviewers: #kwin, zzag, graesslin
      
      Reviewed By: #kwin, zzag, graesslin
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16314
      d70c3568
  31. 29 Jul, 2017 1 commit
    • Martin Flöser's avatar
      Replace Workspace::slotWindowQuickTileFoo by a quickTileWindow with argument · 64da6c8d
      Martin Flöser authored
      Summary:
      Thanks to std::bind we don't need that many different slots to setup the
      global shortcut connections. Instead we can have one shared
      implementation which takes the argument and passes it to the window.
      
      To support std::bind arguments in kwinbindings the initShortcut method
      and dependencies are adjusted as well as a new macro is added.
      
      As I don't want to include abstract_client.h in workspace.h a new enum
      is created for the quick tiling flags used in Workspace. This caused a
      larger refactoring as the change to an enum class also caused quite some
      changes.
      
      Test Plan: Affected test cases still pass
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6783
      64da6c8d