1. 07 Oct, 2018 1 commit
    • David Edmundson's avatar
      [wayland] Use pending maximize mode in decoration updates · 29a49f86
      David Edmundson authored
      Summary:
      The change to make maximize mode asynchronous featured the comment
      
      >Things are a bit complex with borders. Technically we
      >shouldn't update them till we get a response, but we also need to have
      >the correct geometry of the full size window in our request. For now
      >they behave as before, updating when we request the change.
      
      We call setNoBorder when we request the geometry but decoratedClient
      also checks the maximise mode, in order to follow the scheme above we
      need this to operate on the requested state not current state.
      
      X is unaffected.
      
      This fixes the borders being restored correct after maximize/restore.
      
      Test Plan:
      Chose a theme with visible borders
      Maximised a window and back
      They restored
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D15991
      29a49f86
  2. 11 Jun, 2018 1 commit
    • David Edmundson's avatar
      Set specific edge cursor shape when resizing · 5b4eb80c
      David Edmundson authored
      Summary:
      Instead of seeing the cursor <--> on the left edge you now see an icon
      that looks like |<-  .
      
      This brings kwin decorations in line with GTK CSD icons.
      
      In theory this is also useful to tell which window will resize in the
      case of side-by-side windows (regardless of whether borders are on or
      not). In practice with the adwaita icon theme I tested with it's not
      very intuitive to realise which is which till you learn the icon.
      
      Change is more involved than it should be as Qt::CursorShape doesn't
      have these entries, and I don't want to shadow that enum internally or
      have
      to change kwin effect code.
      
      Specifics depend on cursor icon theme if they are not present it will
      fallback to the <--> icon. (Breeze does not have them currently)
      
      Test Plan:
      Resized some windows (on X and on Wayland)
      Correct icon appeared on Adwaita
      Existing icon appeared on Breeze
      
      Reviewers: #plasma
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D13396
      5b4eb80c
  3. 24 May, 2018 1 commit
  4. 20 May, 2018 2 commits
  5. 28 Apr, 2018 1 commit
    • Luca Beltrame's avatar
      Revert "Add "SkipSwitcher" to API" · 5ef11904
      Luca Beltrame authored
      This reverts commit 8a2a00a4.
      
      It was likely wrongly pushed before the KWayland changes, so it won't
      compile.
      
      Feel free to reinstate it once the dependent changes (KWayland) are in.
      
      CCMAIL: bundito@gmail.com
      CCMAIL: kwin@kde.org
      5ef11904
  6. 27 Apr, 2018 1 commit
    • Scott Harvey's avatar
      Add "SkipSwitcher" to API · 8a2a00a4
      Scott Harvey authored
      Summary:
      Adding "SkipSwitcher" to the API, following discussion in
      BUG 375921
      
      Depends on / related to D11925 and D11924
      
      Reviewers: hein, #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: davidedmundson, #plasma, ngraham, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D11926
      8a2a00a4
  7. 18 Mar, 2018 1 commit
  8. 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
  9. 16 Nov, 2017 1 commit
    • Martin Flöser's avatar
      Allow a cross-process check for same applications · 1ae7990a
      Martin Flöser authored
      Summary:
      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
      1ae7990a
  10. 14 Nov, 2017 2 commits
  11. 15 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Fix placement of KSplash · afe0a5c0
      Martin Flöser authored
      Summary:
      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
      afe0a5c0
  12. 07 Oct, 2017 1 commit
    • Martin Flöser's avatar
      Move WindowRules from Client to AbstractClient · 0372fdaf
      Martin Flöser authored
      Summary:
      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
      0372fdaf
  13. 01 Sep, 2017 3 commits
    • Martin Flöser's avatar
      Drop boolean parameter from AbstractClient::caption · f0652970
      Martin Flöser authored
      Summary:
      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
      f0652970
    • Martin Flöser's avatar
      Make AbstractClient::caption no longer a virtual method · a7b29e09
      Martin Flöser authored
      Summary:
      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
      a7b29e09
    • Martin Flöser's avatar
      Add <number> to Wayland captions if the caption is the same · 6685288d
      Martin Flöser authored
      Summary:
      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
      name.
      
      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
      6685288d
  14. 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
  15. 02 Aug, 2017 1 commit
  16. 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
  17. 25 Jul, 2017 1 commit
    • 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
  18. 05 Apr, 2017 1 commit
  19. 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
  20. 17 Nov, 2016 1 commit
    • Martin Flöser's avatar
      KillWindow support for Wayland windows · 6bee7f4a
      Martin Flöser authored
      Summary:
      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
      Client.
      
      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
      6bee7f4a
  21. 31 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Add support for desktopFileName provided by NETWinInfo · b7bd5f9a
      Martin Flöser authored
      Summary:
      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
      b7bd5f9a
  22. 18 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Support docks which take input · 03d70615
      Martin Flöser authored
      Summary:
      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
      03d70615
  23. 05 Oct, 2016 2 commits
    • Martin Flöser's avatar
      Implement show on screen edge for Wayland · dd3c6d6c
      Martin Flöser authored
      Summary:
      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
      dd3c6d6c
    • Martin Flöser's avatar
      Add support for resize only borders on Wayland · fb59b054
      Martin Flöser authored
      Summary:
      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
      fb59b054
  24. 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
      42e82f09
  25. 24 Aug, 2016 1 commit
    • Martin Flöser's avatar
      Move implementation of iconGeometry from ShellClient to AbstractClient · 455c5c07
      Martin Flöser authored
      Summary:
      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
      455c5c07
  26. 13 Jul, 2016 1 commit
    • Martin Flöser's avatar
      Use hiddenInternal() for a ShellClient which got unmapped · a35ffa93
      Martin Flöser authored
      Summary:
      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
      effects.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2083
      a35ffa93
  27. 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
      Summary:
      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
      titleBarArea.
      
      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
      14d12c05
  28. 11 Mar, 2016 1 commit
  29. 18 Feb, 2016 2 commits
  30. 15 Feb, 2016 1 commit
  31. 18 Jan, 2016 1 commit
  32. 18 Dec, 2015 3 commits