1. 29 Sep, 2019 1 commit
  2. 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
  3. 24 Sep, 2019 1 commit
  4. 23 Sep, 2019 1 commit
    • 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
  5. 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
  6. 14 Sep, 2019 1 commit
  7. 07 Sep, 2019 1 commit
  8. 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
  9. 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
  10. 09 Jul, 2019 1 commit
  11. 22 Jun, 2019 1 commit
  12. 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
  13. 10 Feb, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Copy layer repaints to Deleted · 381d0df7
      Vlad Zahorodnii authored
      Summary:
      If a Toplevel has scheduled layer repaints, then we have to copy them
      to Deleted as well. This can happen, for example, when a client loses
      shadow right before it gets closed or unmapped.
      
      Reviewers: #kwin, graesslin
      
      Reviewed By: #kwin, graesslin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18786
      381d0df7
  14. 12 Jan, 2019 1 commit
  15. 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
  16. 06 Dec, 2018 1 commit
    • David Edmundson's avatar
      Avoid deleting ourselves midway through updateShadow · 576c6671
      David Edmundson authored
      Summary:
      If updating a shadow means that there should be no shadow, shadow ends
      up deleting itself midway through the method.
      
      It's cleaner and safer to leave that to the caller.
      
      This new change matches the existing documentation for
      Shadow::updateShadow which states
      
      > In case the Property has been withdrawn the method returns @c false.
      > In that case the owner should delete the Shadow.
      
      Test Plan:
      Created an ASAN of kwin
      Relevant testMaximised no longer fails
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D17380
      576c6671
  17. 01 Dec, 2018 1 commit
    • Martin Flöser's avatar
      Introduce the concept of an internal window system independent id · 3ad9ac72
      Martin Flöser authored
      Summary:
      For supporting Wayland windows in the kwin_rules_dialog we need a way to
      pass a window id for Wayland windows to the dialog. This id needs to be
      sent to the dbus interface to query window information just like the
      interactive query. For Wayland windows we don't really have a window id
      and it would require to also pass the windowing system to
      kwin_rules_dialog and back through the dbus interface.
      
      To not complicate things this change introduces a windowing system
      independent id based on UUID. This could in future also be used
      internally for areas where it's window id based and used in both
      windowing systems.
      
      Test Plan: Adjusted test cases to verify the uuid is generated and passed to Deleted
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16986
      3ad9ac72
  18. 01 Nov, 2017 1 commit
    • David Edmundson's avatar
      Render GL Window decorations at the correct scale · fc887ab9
      David Edmundson authored
      Summary:
      Under wayland we support high DPI putting by putting a separation
      between the logical co-ordinate system and the resolution of rendered
      assets.
      
      When a window is on a high DPI screen, we should render at the higher
      resolution.
      
      Like the window scaling this handles any combination of a 2x scaled
      decoration being rendered on a 1x screen or vice versa.
      
      ---
      This patch is a bit different from the other scaling stuff. We have to
      generate the quads *before* we have an updated texture with the new
      scale. This means the scale isn't attached to the buffer like elsewhere.
      
      That's why I added a property in TopLevel so there's still one canonical
      source and things can't get out of sync.
      
      BUG: 384765
      
      Test Plan:
      Crystal clear breeze and oxygen decos on my @2x display
      Drag windows to attached @1x display, things still look OK when across 2
      screens
      Changing the scale of a screen updated the decos instantly
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: graesslin, plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D8600
      fc887ab9
  19. 05 Oct, 2016 1 commit
    • 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
  20. 26 Aug, 2016 1 commit
    • Martin Flöser's avatar
      DiscardWindowPixmap when Surface size changes · be79d1ae
      Martin Flöser authored
      Summary:
      So far this connect was only in ShellClient, but it's needed for all
      Toplevels. Also when a XWayland window has it's surface size changed,
      the pixmap needs to be discarded. Otherwise KWin might hit an assert
      in AbstractEGLTexture due to the buffer having a different size than
      the texture had previously.
      
      Test Plan:
      Firefox, click download on bugreports.qt.io used to trigger
      this for me. With this change no longer able to reproduce.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2583
      be79d1ae
  21. 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
  22. 26 Jun, 2016 1 commit
    • Martin Flöser's avatar
      Update Keyboard focus when the Surface of the active client changes · 7adf69de
      Martin Flöser authored
      Summary:
      For XWayland windows the window might be activated before the Wayland
      Surface is set for it. Thus the keyboard focus is not passed to the
      window. Only on the next activate after the window got created the
      window got keyboard focus.
      
      This change addresses this problem by emitting a signal from Toplevel
      when the surface changes. The KeyboardInput listens to this signal
      for the active client and updates keyboard focus again if the surface
      changes. Thus keyboard focus is properly passed to XWayland windows.
      
      Test Plan:
      Test case which creates an X11 window is adjusted to verify
      the condition.
      
      Reviewers: #plasma_on_wayland, #kwin
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2009
      7adf69de
  23. 23 Jun, 2016 2 commits
  24. 17 May, 2016 1 commit
    • Martin Flöser's avatar
      Make Toplevel::window() no longer virtual and introduce ::windowId() · 24bdfc63
      Martin Flöser authored
      Summary:
      Toplevel::window() is the actual X11 window. This makes it difficult
      to use as the generic identifier for both X11 and Wayland. The Wayland
      ShellClient already had a windowId() which is now added to Toplevel as
      a virtual method. On X11 (Toplevel default) it returns the window().
      
      The method window() now returns XCB_WINDOW_NONE for classes without
      the Toplevel::m_client, such as ShellClient. Thus it allows to properly
      check whether we are on Wayland or X11.
      
      The code is adjusted to use windowId where a generic id is needed and
      to properly check whether the window is valid before using it where
      a window() is used.
      
      This also fixes at least one additional unknown issue in
      Workspace::setActiveClient
      
      where the windowId of a Wayland client was passed to X11.
      
      Reviewers: #plasma
      
      Subscribers: plasma-devel
      
      Projects: #plasma
      
      Differential Revision: https://phabricator.kde.org/D1527
      24bdfc63
  25. 07 Apr, 2016 1 commit
  26. 04 Mar, 2016 1 commit
    • Martin Flöser's avatar
      Fix repaints area on Wayland damage · 34951b3b
      Martin Flöser authored
      The damage event of the Surface does not consider the offset through
      the server side decoration. Due to that we need to have a different
      repaint and damage area. As Toplevel::addDamage(QRegion) is only used
      in the Wayland case the repaint adjustment is removed from the generic
      implementation and moved into the specific implementations. While it
      wouldn't hurt to have the repaint adjustment in Toplevel, it would
      trigger a repaint of an unchanged area.
      
      For Client I'm not sure whether it's correct without considering the
      clientPos. My testing shows it's working, but that might also just be
      do to Xwayland using OpenGL buffers. Needs further testing.
      34951b3b
  27. 01 Feb, 2016 1 commit
  28. 09 Jan, 2016 1 commit
    • Andreas Hartmetz's avatar
      Remove saving and loading (and client matching by) WM_COMMAND. · 2eac7634
      Andreas Hartmetz authored
      This legacy session management scheme using the WM_COMMAND property
      seems to be called XSM. It is very, very legacy because it was
      superseded by XSMP in 1993(!).
      
      By inspecting ~/.config/session/kwin_[...] I could see that Firefox
      still sets WM_COMMAND, but nothing else in a regular session with
      some applications.
      As one of the last applications to switch to XSMP session management,
      I guess Firefox keeps doing that because it still needs to work on,
      say, Solaris, anyway, so why not set WM_COMMAND on Linux as well.
      The WM_COMMAND set by Firefox looks like "wmCommand8=firefox\s" in
      the kwin session file. It doesn't actually contain a session
      identifier. But then, Firefox only has one session per user anyway.
      
      This goes together with commit 5f0ca1305db4a925 in plasma-workspace /
      ksmserver to remove legacy session management support.
      
      I've talked about my plan to do this on IRC with Martin so hopefully
      it's okay to just do this now.
      2eac7634
  29. 18 Dec, 2015 1 commit
    • Martin Flöser's avatar
      Specify inputTransformation in Toplevel · 55bae74a
      Martin Flöser authored
      InputRedirection uses the inputTransformation() to pass to SeatInterface
      for focused pointer surface. This prepares for proper input
      transformation including scaling and rotation.
      55bae74a
  30. 25 Aug, 2015 1 commit
    • Martin Flöser's avatar
      Composite windows from a QOpenGLFramebufferObject · c56bbc0d
      Martin Flöser authored
      This change introduces a mechanism for internal windows to be rendered
      to a QOpenGLFramebufferObject to be composited using the texture bound
      to the FBO. This is useful for in-process rendering (e.g. QtQuick) and
      at the same time bypassing the windowing system.
      
      The OpenGL context of the QOpenGLFramebufferObject needs to be sharing
      with the compositing OpenGL context.
      c56bbc0d
  31. 12 Aug, 2015 1 commit
  32. 20 Jul, 2015 1 commit
    • Martin Flöser's avatar
      [wayland] Pass appId to PlasmaWindow interface · 01d805f1
      Martin Flöser authored
      For the appId we use:
      * wl_shell windowClass for Wayland clients
      * resourceName from window class for X11 clients
      
      This is implemented by sharing the window class implementation in
      Toplevel.
      
      CCMAIL: hein@kde.org
      01d805f1
  33. 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
  34. 18 Jun, 2015 1 commit
  35. 01 Jun, 2015 2 commits
    • Martin Flöser's avatar
      Set Toplevel::m_surface to nullptr if SurfaceInterface gets destroyed · 1e16ab25
      Martin Flöser authored
      When minimizing an Xwayland client the Xwayland server destroys the
      Surface causing our next access to the Surface to crash KWin. So for
      safety we connect to the destroyed signal and reset the pointer.
      
      The disadvantage is that a minimized Xwayland window doesn't have a
      preview any more.
      1e16ab25
    • Martin Flöser's avatar
      [wayland] Set depth in ShellClient depending on whether the Buffer has alpha · 5a98d8bb
      Martin Flöser authored
      We need to set the depth in order to properly determine whether the
      Surface has an alpha channel and whether blending needs to be enabled
      for rendering.
      
      For this a new method is introduced in Toplevel to set the depth. If
      the depth changed in a way that the Toplevel gained or lost the alpha
      channel a signal is emitted which implies that the hasAlpha property of
      Toplevel is no longer constant.
      5a98d8bb
  36. 08 May, 2015 1 commit
  37. 17 Mar, 2015 2 commits