1. 01 Oct, 2020 1 commit
  2. 24 Sep, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Replace remaining usages of old connect syntax with new connect syntax · 0c266e76
      Vlad Zahorodnii authored
      This change replaces the remaining usages of the old connect syntax with
      the new connect syntax.
      
      Unfortunately, there are still places where we have to use SIGNAL() and
      SLOT() macros, for example the stuff that deals with d-bus business.
      
      Clazy was used to create this change. There were a few cases that needed
      manual intervention, the majority of those cases were about resolving
      ambiguity caused by overloaded signals.
      0c266e76
  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. 27 Jul, 2020 1 commit
  5. 21 May, 2020 1 commit
  6. 12 May, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Emit Workspace::clientAdded() with AbstractClient · 7b751099
      Vlad Zahorodnii authored
      Summary:
      Currently, if one wants to monitor for new X11 and Wayland clients, they
      have to listen for two signals. Workspace::clientAdded() is emitted only
      for X11 and Xwayland clients, while WaylandServer::shellClientAdded() is
      emitted only for xdg-shell clients. Such design doesn't scale well.
      
      As the first towards emitting Workspace::clientAdded() for new Wayland
      clients, this change replaces the X11Client parameter in the clientAdded
      signal with AbstractClient.
      
      Test Plan: Tests still pass.
      
      Reviewers: #kwin, cblack
      
      Reviewed By: cblack
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D29665
      7b751099
  7. 07 May, 2020 1 commit
  8. 29 Jan, 2020 1 commit
  9. 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
  10. 23 Sep, 2019 1 commit
  11. 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
  12. 23 May, 2019 2 commits
    • Vlad Zahorodnii's avatar
      [scripting] Emit clientAdded for Wayland clients · 4bbef8d1
      Vlad Zahorodnii authored
      Summary:
      Currently, if a script relies on clientAdded to setup some required
      connections, then it probably won't work with Wayland clients because
      clientAdded is emitted only for X11 clients.
      
      Test Plan:
      * Installed sticky window snapping script, it works;
      * Installed a couple of tiling scripts, with some small changes, they work.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: strobach, TomButler, davidedmundson, mart, graesslin, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D17097
      4bbef8d1
    • Vlad Zahorodnii's avatar
      [scripting] Port the remaining bits of API to AbstractClient · 689d89ae
      Vlad Zahorodnii authored
      Currently, clientArea(ClientAreaOption, const Client *) and clientList()
      are quite X11-specific, which results in having some tiling scripts not
      working with Wayland clients. This change is the first step towards working
      tiling scripts in the Wayland session.
      689d89ae
  13. 01 Sep, 2017 1 commit
  14. 29 Jul, 2017 2 commits
    • Martin Flöser's avatar
      Drop the Workspace::slotSwitchWindowFoo methods · 7d351706
      Martin Flöser authored
      Summary:
      They were only delegating into switchWindow(Direction), so let's do the
      same through std::bind in kwinbindings and delegate to it directly in
      scripting's WorkspaceWrapper.
      
      Test Plan: Not yet, want to add test case for Workspace::switchWindow
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D6791
      7d351706
    • 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
  15. 03 Nov, 2016 1 commit
  16. 02 Nov, 2016 1 commit
    • James Pike's avatar
      Support for workspace.clientList() in declarative script · 4730be08
      James Pike authored
      Summary:
      The version provided is only compatible with QtScript so it became
      necessary to split WorkspaceWrapper into a base class and two child
      classes, one for QtScript and one for QmlScript.
      
      BUG: 340125
      FIXED-IN: 5.8.4
      REVIEW: D3185
      4730be08
  17. 07 Jul, 2015 1 commit
    • Martin Flöser's avatar
      Disable Activities support on Wayland · a1a89d3d
      Martin Flöser authored
      This is a temporary workaround for bug 349992 which causes freezes
      during startup as kwin and kamd dead lock each other on DBus.
      
      To workaround we don't call Activities::create and check in every
      usage of Activities::self() whether the pointer is valid.
      
      As a result kwin_wayland now starts pretty fast.
      
      CCBUG: 349992
      a1a89d3d
  18. 07 Jun, 2015 1 commit
  19. 08 May, 2015 8 commits
  20. 31 Mar, 2015 1 commit
  21. 27 Nov, 2014 1 commit
  22. 25 Mar, 2014 1 commit
    • Martin Flöser's avatar
      [kwin] Use std::find_if and lambda functions for Workspace::findClient · bc0a9cb5
      Martin Flöser authored
      Instead of passing the macro based Predicate to findClient it now
      expects a function which can be passed to std::find_if.
      
      Existing code like:
      xcb_window_t window; // our test window
      Client *c = findClient(WindowMatchPredicated(window));
      
      becomes:
      Client *c = findClient([window](const Client *c) {
          return c->window() == window;
      });
      
      The advantage is that it is way more flexible and has the logic what
      to check for directly with the code and not hidden in the macro
      definition.
      
      In addition there is a simplified overload for the very common case of
      matching a window id against one of Client's windows. This overloaded
      method takes a Predicate and the window id.
      
      Above example becomes:
      Client *c = findClient(Predicate::WindowMatch, w);
      
      Existing code is migrated to use the simplified method taking
      MatchPredicate and window id. The very few cases where a more complex
      condition is tested the lambda function is used. As these are very
      local tests only used in one function it's not worthwhile to add further
      overloads to the findClient method in Workspace.
      
      With this change all the Predicate macro definitions are removed from
      utils.h as they are now completely unused.
      
      REVIEW: 116916
      bc0a9cb5
  23. 05 Mar, 2014 1 commit
    • Martin Flöser's avatar
      [kwin] Introduce Screens::size and Screens::geometry · 6b1f0b1f
      Martin Flöser authored
      Screens provides a size which is constructed from the size of
      the bounding geometry of all screens and provides an overload taking
      an int to return the size of a specified screen. For geometry() a new
      ovload is added without an argument, which is just a convenient wrapper
      for QRect(QPoint(0, 0), size()).
      
      Both new methods are exported to effects and scripting as new
      properties there called virtualScreenSize and virtualScreenGeometry.
      
      The (virtual) size gets cached in screens and is updated whenever the
      count or geometry changes.
      
      Construction of Screens is slightly changed by moving the init code
      from ctor into a virtual method init(). Reason is that we ended in
      a loop with accessing the singleton pointer before it was set.
      
      REVIEW: 116114
      6b1f0b1f
  24. 06 Aug, 2013 1 commit
  25. 11 May, 2013 1 commit
  26. 29 Apr, 2013 1 commit
  27. 25 Apr, 2013 1 commit
    • Martin Flöser's avatar
      Make Outline a KWIN_SINGLETON · cd025c75
      Martin Flöser authored
      Given that Outline is now a QObject hold by Workspace, but not used in
      Workspace, it can also be a KWIN_SINGLETON.
      
      REVIEW: 110146
      cd025c75
  28. 15 Apr, 2013 1 commit
    • Martin Flöser's avatar
      Split out screen handling from Workspace into own class Screens · edb074cb
      Martin Flöser authored
      Following the approaches of other split out functionality Screens is a
      singleton class created by Workspace.
      
      The class takes over the responsibility for:
      * screenChanged signal delayed by timer
      * number of screens
      * geometry of given screen
      * active screen
      * config option for active screen follows mouse
      
      The class contains a small abstraction layer and has a concrete subclass
      wrapping around QDesktopWidget, but the idea is to go more low level and
      interact with XRandR directly to get more detailed information.
      
      All over KWin the usage from QDesktopWidget is ported over to the new
      Screens class.
      
      REVIEW: 109839
      edb074cb
  29. 11 Apr, 2013 1 commit
    • Martin Flöser's avatar
      Split out Activities related code from Workspace · da85b5fd
      Martin Flöser authored
      All activities related code moves into new singleton class Activities.
      This class gets only included into the build if the build option is
      enabled which means there are less ifdefs all over the code and it also
      handles better the moc doesn't like ifdef case.
      
      The class holds the list of open and all activites, the current and the
      previous activity and the KActivities::Controller. It also emits the
      signals for any activities related changes.
      
      Workspace still contains some activities related code. That is the
      adjustment on change of current activity. Nevertheless the code looks
      much cleaner now and does not contain the confusing naming conflict with
      takeActivity() which existed before.
      
      In all the places where Activities got used the code got adjusted and
      quite often the ifdef got added with a fallback for the disabled case.
      da85b5fd
  30. 06 Mar, 2013 1 commit