1. 25 Jan, 2020 1 commit
  2. 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
  3. 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
  4. 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
  5. 23 Sep, 2019 1 commit
  6. 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
  7. 14 Sep, 2019 1 commit
  8. 08 Sep, 2019 1 commit
  9. 31 Aug, 2019 2 commits
    • 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
    • Vlad Zahorodnii's avatar
      Traverse the stacking order backwards when switching between windows · 9102e41e
      Vlad Zahorodnii authored
      Summary:
      In order to pick the next client to activate we traverse the stacking
      order from bottom to top and assign to each client a score. The client
      with the best score will be activated next. Function that assigns score
      bases its decisions purely on geometry. This may backfire if there are
      couple maximized or fullscreen clients on the screen - we'll activate
      the bottom-most client.
      
      This change toggles direction we traverse the stacking order. If there
      are several clients with an identical score, then prefer the top-most
      client, the one that the user most likely sees at the moment.
      
      BUG: 411356
      FIXED-IN: 5.17.0
      
      Test Plan: New tests pass.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23521
      9102e41e
  10. 14 Aug, 2019 1 commit
    • Frederik Gladhorn's avatar
      Remove custom menu positioning code · 1296ad39
      Frederik Gladhorn authored
      Summary:
      Qt will position the menu just fine, this is overhead.
      No matter how hard I tried, I couldn't get the menu to show up in a
      position where it wasn't shown entirely, removing this should be safe.
      Suggested by zzag.
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23142
      1296ad39
  11. 13 Aug, 2019 1 commit
  12. 11 Aug, 2019 2 commits
  13. 10 Aug, 2019 1 commit
    • Frederik Gladhorn's avatar
      Remove usage of QWeakPointer for QObject · 9002f9b9
      Frederik Gladhorn authored
      This usage of QWeakPointer has been deprecated since Qt 5.0, since it
      leads to really confusing API - usually you must never dereference a
      QWeakPointer directly, but always go through QSharedPointer, except in
      this one case, where it's permissible.
      
      Use QPointer instead, which is clean.
      Only keep the QPointer where the object in question may get deleted,
      while in the API where it has to be valid, use a regular pointer.
      
      Initializing the pointer explicitly to nullptr makes no sense.
      9002f9b9
  14. 09 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 2 commits
    • Vlad Zahorodnii's avatar
      [colorcorrection] Introduce toggle Night Color shortcut · b1835166
      Vlad Zahorodnii authored
      Summary:
      The new shortcut can be useful if a user wants to quickly disable the
      Night Color manager for a brief moment.
      
      FEATURE: 409083
      
      Reviewers: #kwin, davidedmundson, romangg
      
      Reviewed By: #kwin, davidedmundson, romangg
      
      Subscribers: romangg, ngraham, broulik, davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D22287
      b1835166
    • Vlad Zahorodnii's avatar
      [wayland] Apply window rules only to xdg-shell clients · 18844f59
      Vlad Zahorodnii authored
      Summary:
      There are rules that have to be applied only once, e.g. every Remember
      and Apply Initially rule, as well rules that need to configure the client,
      e.g. size, etc. In the best scenario the compositor would evaluate such
      rules when the client is about to be mapped.
      
      This change limits window rules only to xdg-shell clients because right
      now only this protocol lets compositors to intervene in the client
      initialization process. Also, it makes things a bit easier for us on the
      compositor side.
      
      xdg-shell protocol satisfies most of ours requirements to implement window
      rules, but not all of them. If the client is about to be mapped for the
      second time and its size is forced by a rule, then compositor may need
      to configure it. Currently, xdg-shell protocol doesn't have any mechanism
      that a client could use to notify the compositor about its intent to map.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: fmonteiro, davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D19411
      18844f59
  17. 22 Apr, 2019 1 commit
  18. 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
  19. 31 Dec, 2018 1 commit
    • Martin Flöser's avatar
      Port window specific rules dialog to DBus · 0b28abeb
      Martin Flöser authored
      Summary:
      The dialog invoked through user actions menu takes the internal uuid as
      command line argument which allows to query the required information
      from KWin instead of using X11.
      
      This allows to enable the system for Wayland windows.
      
      In order to replace the usage of ClientMachine in the rules dialog the
      dbus interface is extended by a value whether the window is on the
      localhost. This is exposed through a virtual method on toplevel which is
      overridden in ShellClient and there always returning true.
      
      Test Plan: Run a nested Wayland and opened the dialog on a wayland window
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D17750
      0b28abeb
  20. 14 Nov, 2018 1 commit
    • David Edmundson's avatar
      [wayland] add enter/leave virtual desktop API · f521d4bb
      David Edmundson authored
      Summary:
      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
      (-1)
      
      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
      f521d4bb
  21. 01 Nov, 2018 1 commit
    • David Edmundson's avatar
      [wayland] Use the new plasma virtual desktop protocol · 7e8facc3
      David Edmundson authored
      Summary:
      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
      7e8facc3
  22. 10 Oct, 2018 1 commit
    • David Edmundson's avatar
      [activities] Fix logic error in user menu blocking activity updates · 273a3fab
      David Edmundson authored
      Summary:
      There's an attempt to block updates to activities whilst the popup menu
      is showing.
      
      In one of the two code paths for positioning the menu the block is set
      but instead of releasing the block at the end of the exec locks it
      again.
      
      CCBUG: 335725
      
      Test Plan:
      On X11 changed activities with the popup menu near the bottom.
      It still flickered like crazy whilst the menu is open (see bug report)
      But now at least fixes itself after
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16101
      273a3fab
  23. 20 May, 2018 2 commits
  24. 21 Feb, 2018 1 commit
    • Martin Flöser's avatar
      Disable window rule configuration for Wayland · 7bf4a942
      Martin Flöser authored
      Summary:
      The window rule detection is too bound to X11 for it to work for
      Wayland windows. In fact it results in the config module just crashing.
      Thus it's better to just disable the items in the menu. As it's only for
      X11 windows we can also enforce platform xcb for the rules dialog.
      
      Test Plan: Menu disabled on Wayland window, menu enabled on Xwayland window
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D10594
      7bf4a942
  25. 24 Sep, 2017 2 commits
  26. 01 Sep, 2017 1 commit
  27. 12 Aug, 2017 1 commit
    • Martin Flöser's avatar
      Implement the shortcut caption suffix for Wayland windows · bbca8c66
      Martin Flöser authored
      Summary:
      The generation of the shortcut caption part is moved from Client to
      AbstractClient. The ShellClient also has a captionSuffix and implements
      the full part in caption.
      
      Overall this needs more refactoring to support more sharing between the
      two implementations. But one step at a time.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D7093
      bbca8c66
  28. 29 Jul, 2017 3 commits
  29. 25 Jul, 2017 2 commits
    • Martin Flöser's avatar
      Implement support for window shortcuts for Wayland windows · c29d6093
      Martin Flöser authored
      Summary:
      Moves most of the implementation from Client to AbstractClient, so that
      it can be used for both Client and ShellClient. Only the X11 specific
      code is kept in Client.
      
      Not yet implemented is updating the window caption.
      
      Unfortunately the testing of this feature showed that setting a window
      shortcut is not working on Wayland at all (the Qt widget doesn't properly
      catch the shortcut). So this feature is currently only of erm theoretical
      use.
      
      Test Plan: Added new test case. No testing in real world as explained.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6818
      c29d6093
    • Martin Flöser's avatar
      Call Platform::setupActionForGlobalAccel on the Client shortcut · 4c996a57
      Martin Flöser authored
      Summary:
      Platform::setupActionForGlobalAccel is an important call on X11 platform.
      Without the x11 timestamp doesn't get updated and calls in KWin might
      fail - e.g. the activation of the Client which is supposed to happen.
      
      Test Plan: compiles
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6802
      4c996a57
  30. 20 Jun, 2017 1 commit
  31. 19 Apr, 2017 1 commit
  32. 11 Jan, 2017 1 commit
    • Kai Uwe Broulik's avatar
      Restore global menu support · 93938d60
      Kai Uwe Broulik authored
      This brings back global menu support in KWin.
      The DBusMenu infrastructure is different that we just read the DBus service name and
      menu object path from the windows rather than passing around window IDs on DBus which
      won't work on Wayland.
      
      Differential Revision: https://phabricator.kde.org/D3089
      93938d60