1. 16 Nov, 2017 1 commit
    • Martin Flöser's avatar
      Allow a cross-process check for same applications · 1ae7990a
      Martin Flöser authored
      Commit 5d9027b1 introduced a regression in TabBox by using the generic
      framework inside KWin to test for same application. What I did not
      consider was that the code in TabBox was "broken by design". It didn't
      use the generic check as that is too strict and considers windows from
      different processes as not belonging to the same application. But this
      is not wanted in the case of TabBox.
      On the other hand the change itself is an improvement to also support
      Wayland in a better way and not have special handling situations. Thus
      just reverting would not help.
      Instead this change addresses the problem by extending the internal API
      and to allow more adjustements. So far there was already an
      "active_hack" boolean flag. This is extended to proper flags with an
      additional flag to allow cross application checks.
      The checks in Client which would filter out different applications check
      for this flag and are skipped if set. In addition ShellClient also adds
      support for this flag and compares for the desktop file name.
      Thus we get in TabBox the same behavior as before with the advantage of
      having a better shared code base working on both X11 and Wayland.
      BUG: 386043
      FIXED-IN: 5.11.4
      Test Plan:
      Started two kwrite processes on X11, clicked new in one of them,
      used Alt+` and verified that there are three windows shown.
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D8661
  2. 14 Nov, 2017 2 commits
  3. 15 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Fix placement of KSplash · afe0a5c0
      Martin Flöser authored
      In a bug report there was a reference that on multi-screen KSplash is
      not placed correctly. I investigated and noticed that it is an OSD which
      sets an own position. In KWin the events were processed correctly but
      the position was off.
      The problem is that KWin has code to correct the position of an OSD when
      it's size changes. This happens also on first damage and then the window
      gets incorrectly placed when the position is set. So honor that the
      position is set.
      Test Plan: Restarted the session, ksplash positioned correctly now.
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D8268
  4. 07 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Move WindowRules from Client to AbstractClient · 0372fdaf
      Martin Flöser authored
      So far window rule specific functionality was only implemented in Client
      and in ShellClient there was only a dummy implementation. This change
      moves the client_rules member variable from Client to AbstractClient.
      Areas which would not compile anymore are adjusted.
      This is a first step to get window rule support for Wayland windows.
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D8090
  5. 01 Sep, 2017 3 commits
    • Martin Flöser's avatar
      Drop boolean parameter from AbstractClient::caption · f0652970
      Martin Flöser authored
      With the latest refactoring AbstractClient::captionNormal is the same as
      AbstractClient::caption(false) used to be. As there were only two usages
      of the false parameter, let's remove this boolean trap and use proper
      API calls.
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D7427
    • Martin Flöser's avatar
      Make AbstractClient::caption no longer a virtual method · a7b29e09
      Martin Flöser authored
      The implementation can now be shared, it doesn't differ anymore between
      X11 (Client) and Wayland (ShellClient). So instead of code duplication a
      shared implementation in AbstractClient.
      Test Plan: X11 and ShellClient tests still pass
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D7426
    • Martin Flöser's avatar
      Add <number> to Wayland captions if the caption is the same · 6685288d
      Martin Flöser authored
      Bringing another caption feature from X11 to Wayland. If we have
      multiple windows with the same caption, starting from the second window
      a suffix <number> is added.
      E.g. if we have three windows with caption "foo", the naming is:
       * foo
       * foo <2>
       * foo <3>
      The change tries to use as much shared code between the X11 and Wayland
      implementation. Unfortunately it's not possible to share completely as
      the X11 implementation does X11 specific things like editing the visible
      By sharing the code the numbering also works cross windowing system.
      That is if a window is called "foo" on X11, a new window on Wayland with
      caption "foo" will get adjusted to "foo <2>" and vice versa.
      The change also eliminates a duplicated signal for captionChanged in
      ShellClient (found by test case).
      By using the shared implementation on X11 side a bug gets fixed which
      got introduced with the support of "unresponsive", this is no longer
      considered and the numbering still works even if there is a window which
      is unresponsive.
      Test Plan: New test case and manual testing
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D7425
  6. 12 Aug, 2017 1 commit
    • Martin Flöser's avatar
      Implement the shortcut caption suffix for Wayland windows · bbca8c66
      Martin Flöser authored
      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
  7. 02 Aug, 2017 1 commit
  8. 29 Jul, 2017 1 commit
    • Martin Flöser's avatar
      Replace Workspace::slotWindowQuickTileFoo by a quickTileWindow with argument · 64da6c8d
      Martin Flöser authored
      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
      Test Plan: Affected test cases still pass
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D6783
  9. 25 Jul, 2017 1 commit
    • Martin Flöser's avatar
      Implement support for window shortcuts for Wayland windows · c29d6093
      Martin Flöser authored
      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
      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
  10. 05 Apr, 2017 1 commit
  11. 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
  12. 17 Nov, 2016 1 commit
    • Martin Flöser's avatar
      KillWindow support for Wayland windows · 6bee7f4a
      Martin Flöser authored
      AbstractClient gains a new pure virtual killWindow method and this gets
      implemented in ShellClient.
      ShellClient performs the killing by sending a term signal to the
      process. This can only work if the client connected through the socket
      and didn't get a socketpair fd passed. In that case the pid is KWin's
      and KWin doesn't want to terminate. Thus this is special handled to
      destroy the connection instead.
      In case terminating the process has no effect, the connection gets
      destroyed after five seconds.
      The KillWindow is adjusted to operate on AbstractClient instead of
      This implements T4463.
      Test Plan: Killed windows and auto test
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D3370
  13. 31 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Add support for desktopFileName provided by NETWinInfo · b7bd5f9a
      Martin Flöser authored
      KWindowSystem provides a KDE specific property for the desktop file
      name. This allows KWin to take the icon from the desktop file. The
      advantage from the desktop file is that KWin normally gets higher
      resolution icons than provided through the xproperty based icons used
      previously. If the desktop file does not provide an icon name, KWin
      falls back to the previous implementation.
      As on Wayland the icon is taken from the desktop file name already the
      code for X11 and Wayland is merged in AbstractClient. Also to the
      PlasmaWindowInterface the appId is taken from the new desktop file
      instead of the resourceName. Due to that for Xwayland windows where KWin
      knows the desktop file name it can be passed to PlasmaWindowInterface.
      This allows e.g. the task manager to better map the windows to
      applications and provide better icons. Also it means that icons do not
      need to be passed as bitmap data to the clients.
      Test Plan:
      Verified that icon is taking from desktop file if provided and
      from X property if not provided and that Wayland windows still have icon.
      Reviewers: #kwin, #plasma_on_wayland, hein
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D3177
  14. 18 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Support docks which take input · 03d70615
      Martin Flöser authored
      On X11 one needs to force activate a panel to pass it focus. This change
      implements something similar for Wayland but a little bit more stateful
      by using a request on the PlasmaShellSurface. If set KWin will activate
      the panel.
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D3037
  15. 05 Oct, 2016 2 commits
    • Martin Flöser's avatar
      Implement show on screen edge for Wayland · dd3c6d6c
      Martin Flöser authored
      This change ports ScreenEdges to operate on AbstractClient instead of
      Client. For this AbstractClient gained a new pure virtual method
      showOnScreenEdge which is also implemented in ShellClient.
      In ShellClient the functionality is bound for the case windows can
      cover a panel. If triggered the panel gets raised again.
      The auto hiding panel, though, is not yet implemented. For that the
      protocol needs to be adjusted to give a hint to the compositor when to
      hide and hint back to the panel when it was shown. This needs a change
      in KWayland and thus is not 5.8 material.
      Test Plan: See added test case
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2793
    • Martin Flöser's avatar
      Add support for resize only borders on Wayland · fb59b054
      Martin Flöser authored
      This change adds support for resizing outside the window decoration
      (e.g. setting borders to NoSide or None).
      To support this a new Toplevel::inputGeometry() -> QRect method is
      added which exposes the geometry adjusted by the margins provided by
      the decoration. This is checked in InputRedirection when finding a
      Toplevel at a given position. The logic for figuring out whether the
      event should go to the decoration or the window already handled the
      situation correctly, so no further changes are needed.
      BUG: 364607
      FIXED-IN: 5.8.1
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2787
  16. 29 Aug, 2016 1 commit
    • Martin Flöser's avatar
      Move Q_PROPERTY definitions from Client to AbstractClient · 42e82f09
      Martin Flöser authored
      The properties:
       * maximizable
       * moveable
       * moveableAcrossScreens
       * resizeable
      Were only defined on Client instead of AbstractClient. This resulted
      in the EffectWindow having those properties evaluate always to false
      for a ShellClient and breaking some effects.
      BUG: 355947
  17. 24 Aug, 2016 1 commit
    • Martin Flöser's avatar
      Move implementation of iconGeometry from ShellClient to AbstractClient · 455c5c07
      Martin Flöser authored
      This allows Client to use the Wayland-specific implementation if there
      is no icon geometry set through the X11 way. That way Xwayland windows
      have an icon geometry even if Plasma is using Wayland and setting the
      icon geometry in the Wayland way. Which is expected as Plasma is
      ignorant about the windowing system a PlasmaWindow uses.
      In order to move the code from ShellClient to AbstractClient
      WaylandServer gained a new findAbstractClient(Surface*) method which
      is just like findClient(Surface*) with the difference that it returns
      an AbstractClient instead of a ShellClient*.
      Test Plan:
      minimized/unminimized an X client on Wayland, verified
      animation is correct (though broken in general for minimize)
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2530
  18. 13 Jul, 2016 1 commit
    • Martin Flöser's avatar
      Use hiddenInternal() for a ShellClient which got unmapped · a35ffa93
      Martin Flöser authored
      So far when a ShellClient got unmapped ready_for_painting was set to
      false. That is the ShellClient was treated in the same way as a not
      yet shown window. It was completely excluded from painting, a close
      animation impossible.
      This change makes use of the functionality available in
      Client::hiddenInternal(). The window is considered as hidden, thus
      still excluded from e.g. getting input events, but could be rendered
      any time as we still have a previous window pixmap (if referenced).
      This allows to have it considered in the rendering pass, but effects
      still cannot make use of it as that state is not yet exposed to the
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2083
  19. 12 May, 2016 1 commit
    • Martin Flöser's avatar
      Do not limit mouse actions to titleBarArea but allow on complete titleBarPosition · 14d12c05
      Martin Flöser authored
      Mouse actions like wheel and double click were restricted to the titleBar
      area. This made the top most pixel non-interactive as it's not part of the
      This change makes the complete titlebarPosition interactive. That is it
      includes for a "normal" (top) setup also the TopLeft/Top/Right section.
      Thus the top most pixel can be double clicked, mouse wheeled, etc.
      For the Wayland case the test case is adjusted.
      BUG: 362860
      FIXED-IN: 5.7.0
      Reviewers: #plasma
      Subscribers: plasma-devel
      Projects: #plasma
      Differential Revision: https://phabricator.kde.org/D1596
  20. 11 Mar, 2016 1 commit
  21. 18 Feb, 2016 2 commits
  22. 15 Feb, 2016 1 commit
  23. 18 Jan, 2016 1 commit
  24. 18 Dec, 2015 12 commits