1. 17 Mar, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Fix compiler warnings · cca0e15b
      Aleix Pol Gonzalez authored
      Summary: No need to keep them around for no reason.
      
      Test Plan: Tested the plugins I thought could be affected. Have been using it for a couple of days without problems
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D28062
      cca0e15b
  2. 04 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Use AbstractClient instead of XdgShellClient wherever possible · be759b7d
      Vlad Zahorodnii authored
      Summary:
      Currently, we have only one shell client type - XdgShellClient. We use
      it when we are dealing with Wayland clients. But it isn't really a good
      idea because we may need to support shell surfaces other than xdg-shell
      ones, for example input panel surfaces.
      
      In order to make kwin more extensible, this change replaces all usages
      of the XdgShellClient class with the AbstractClient class.
      
      Test Plan: Existing tests pass.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27778
      be759b7d
  3. 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
  4. 12 Feb, 2020 1 commit
  5. 23 Jan, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Use less Toplevel::isClient() · 4d161bec
      Vlad Zahorodnii authored
      Summary:
      Prefer qobject_cast<> over Toplevel::isClient() because it's more type
      safer and makes code a bit more readable.
      
      Hopefully, one day we will be able to get rid of isClient() altogether.
      
      Test Plan: Compiles.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D26541
      4d161bec
  6. 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 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
  7. 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
  8. 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
  9. 23 Sep, 2019 2 commits
    • 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
      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
  10. 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
  11. 14 Sep, 2019 1 commit
  12. 06 Sep, 2019 1 commit
  13. 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
  14. 11 Aug, 2019 1 commit
  15. 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
  16. 09 Jul, 2019 1 commit
  17. 02 May, 2019 1 commit
  18. 19 Feb, 2019 1 commit
    • Roman Gilg's avatar
      [xwl] Support stack optimizing X drag source clients · 4c18d156
      Roman Gilg authored
      Summary:
      Some X clients acting as drag sources might try to optimize finding the current
      target window by checking if a window manager, that sets the root window
      _NET_CLIENT_LIST_STACKING property, is present. An example for this is Chromium
      and since KWin sets the property the drag proxy windows must be added to this
      list. Otherwise the origin client will not detect the proxy window and not send
      an XdndEnter message.
      
      Test Plan: Manually with Chromium.
      
      Reviewers: #kwin
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D15628
      4c18d156
  19. 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
  20. 12 Jan, 2019 1 commit
  21. 16 Oct, 2018 1 commit
  22. 15 Oct, 2018 1 commit
    • Vlad Zahorodnii's avatar
      Generalize constrainedStackingOrder for group transients and ordinary transients · 3577e690
      Vlad Zahorodnii authored
      Summary:
      We don't really have to have two different code paths for group
      transients and ordinary transients. For now, AbstractClient::hasTransient
      is good enough to check the relationship between potential parent and
      the transient.
      
      In long term, we need to "invert" the relationship, instead of checking
      whether given parent window has a transient, we should check whether
      given transient is a transient for a given window so we can keep Deleted
      transients above their old parents.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D15893
      3577e690
  23. 07 Oct, 2018 1 commit
    • Vlad Zahorodnii's avatar
      Delete unused function · d95b6548
      Vlad Zahorodnii authored
      Summary:
      The function was introduced in 2d99ef91.
      
      It's not used anywhere plus we don't need it anymore because
      AbstractClient::isActiveFullscreen checks main clients.
      
      Test Plan: Compiles.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16022
      d95b6548
  24. 10 Jan, 2018 1 commit
    • Martin Flöser's avatar
      Keep fullscreen windows in active layer based on transients not the group · b7ad4bcf
      Martin Flöser authored
      Summary:
      So far a not-active fullscreen X11 window was kept in the active layer if
      the newly activated window is in the same group (that is same client
      leader). For example a fullscreen X11 kwrite window is in the active layer
      if another kwrite window is active. The two kwrite windows obviously
      don't have anything to do with each other, but are in the same group.
      
      This creates problems as it's not possible to raise other windows above
      the active not-fullscreen kwrite window. E.g. the panel is stacked below.
      
      The idea behind the check makes sense: if a fullscreen window opens
      another window (e.g. a configuration dialog) it should not be put back
      to normal layer. Thus the check is adjusted whether the new active
      window is a transient to the fullscreen window. Thus the intention is
      still the same, but does not cause the problems.
      
      As the code now does not need to differentiate between X11 and Wayland
      windows (group only on X11) the Client specific implementation is
      removed and the method unvirtual'ed.
      
      BUG: 388310
      FIXED-IN: 5.12.0
      
      Test Plan: Test passes
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D9699
      b7ad4bcf
  25. 01 Oct, 2017 1 commit
  26. 30 Sep, 2017 1 commit
    • Martin Flöser's avatar
      Make xstacking order dirty handling work without X11 · ec7fe441
      Martin Flöser authored
      Summary:
      The xStackingOrder unlike indicated by it's name is relevant for both
      X11 and Wayland and contains the stacking order of the windows used for
      compositing.
      
      So far it was determined whether it needs to be recreated based on
      whether an xcb query is pending. This change introduces a boolean
      variable to check whether the stacking order is dirty and guards the X11
      specific code to only be run if we have an X11 connection.
      
      This is to my current knowledge the last remaining issue where X11 was
      used during the normal Wayland operation mode. Now it should be possible
      to re-order the Workspace startup [1] and try to run kwin_wayland without
      Wayland support.
      
      [1] Workspace::Workspace and Workspace::init is still highly X11
      specific and needs to be split into X11 only and general parts.
      
      Test Plan: Compiles
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7856
      ec7fe441
  27. 07 Aug, 2017 1 commit
  28. 01 Jul, 2017 2 commits
    • Martin Flöser's avatar
      Remove roundtrip to XServer from Workspace::xStackingOrder · 630514d5
      Martin Flöser authored
      Introduce a method Workspace::markXStackingOrderAsDirty
      
      Summary:
      This method replaces the calls x_stacking_dirty = true in the code base
      allowing for further refactoring of that functionality.
      
      Remove roundtrip to XServer from Workspace::xStackingOrder
      
      The method xStackingOrder is only used during a Compositor paint pass.
      If the stacking order had changed, the method updated the stacking order
      from X by performing a sync XQueryTree. With other words we had a round
      trip to the X server directly in the paint pass.
      
      This change rearchitectures this area by making better use of xcb. When
      we notice that the stacking order changed and an XQueryTree is needed,
      we directly send out the request. When xStackingOrder is finally called,
      which normally happens a few milliseconds later, the reply is retreived.
      In the worst case it still blocks, but in most cases the roundtrip is
      gone.
      
      If the stacking order changed again before accessing xStackingOrder the
      running request is cancelled and a new request is issued. So whenever we
      get into xStackingOrder it will have the current state.
      
      The updating of the xStackingOrder is moved into a dedicated method and
      xStackingOrder invokes it through a const_cast instead of operating on
      mutable variables.
      
      Test Plan: Normal system usage, no issues
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6323
      630514d5
    • Martin Flöser's avatar
      Introduce a method Workspace::markXStackingOrderAsDirty · 0d8f1140
      Martin Flöser authored
      This method replaces the calls x_stacking_dirty = true in the code base
      allowing for further refactoring of that functionality.
      0d8f1140
  29. 09 Sep, 2016 1 commit
    • Martin Flöser's avatar
      Remove non visible internal windows from the x stacking order · 8d4204ac
      Martin Flöser authored
      Summary:
      KWin always has a few internal windows around which are not visible.
      A QWindow created somewhere, but not shown. Such windows should not
      be part of the stacking order.
      
      If they are it breaks code which looks at the top most window in the
      stacking order like e.g. SlidebackEffect.
      
      This change ensures that the stacking order gets updated whenever a
      ShellClient gets hidden and that internal windows with isShown being
      false are excluded from the stacking order.
      
      BUG: 364483
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2636
      8d4204ac
  30. 04 Aug, 2016 1 commit
    • Martin Flöser's avatar
      Remove the unredirect fullscreen windows functionality · 996ee34e
      Martin Flöser authored
      Summary:
      Rational: unredirect fullscreen windows is a weird beast. It's intended
      to make fullscreen windows "faster" by not compositing that screen. But
      that doesn't really work as KWin jumps out of that condition pretty
      quickly. E.g. whenever a tooltip window is shown. KWin itself has a
      better functionality by supporting to block compositing completely.
      The complete code was full of hacks around it to try to ensure that
      things don't break.
      
      Overall unredirect fullscreen has always been the odd one. We had it
      because a compositor needs to have it, but it never got truly integrated.
      E.g. effects don't interact with it properly so that some things randomly
      work, others don't. Will it trigger the screenedge, probably yes, but
      will it show the highlight: properly no.
      
      By removing the functionality we finally acknowledge that this mode is
      not maintained and has not been maintained for years and that we do not
      intend to support it better in future. Over the years we tried to make
      it more and more hidden: it's disabled for Intel GPUs, because it used
      to crash KWin. It's marked as an "expert" option, etc.
      
      It's clearly something we tried to hide from the user that it exists.
      
      For Wayland the whole unredirect infrastructure doesn't make sense
      either. There is no such thing as "unredirecting". We might make use
      of passing buffers directly to the underlying stack, but that will be
      done automatically when we know it can be done, not by some magic is
      this a window of specific size.
      
      Test Plan:
      Compiles, cannot really test as I am an Intel user who never
      had that working.
      
      Reviewers: #kwin, #plasma, #vdg
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D2180
      996ee34e
  31. 17 Sep, 2015 2 commits
    • Martin Flöser's avatar
      Allow transients to go over dock windows under certain conditions · 000954c5
      Martin Flöser authored
      For Wayland transients are popups relative to a parent surface. This
      means for a dock window we obviously want them above the dock, otherwise
      the context menu would be below the dock.
      
      To not break the existing functionality (which makes sense) we bind
      it to whether the transient has a positioning hint - that's only set
      for ShellClients.
      000954c5
    • Martin Flöser's avatar
      Move layer functionality to AbstractClient · d25c4652
      Martin Flöser authored
      Merges together the code from ShellClient and Client and removes the
      starting differences. Long term it's better to have only one
      implementation to prevent diversions in the implementation.
      
      As it doesn't match exactly protected virtual methods are called
      which allow more specific implementations for a certain aspect of the
      layer resolving.
      d25c4652
  32. 16 Sep, 2015 3 commits