1. 23 Nov, 2020 2 commits
  2. 22 Nov, 2020 1 commit
    • David Edmundson's avatar
      Bundle QPA plugin directly · 5e60e64a
      David Edmundson authored
      On wayland, we know we're always going to load our internal QPA. Instead
      of shipping a plugin and loading it dynamically we can use Qt static
      This should result in slightly faster load times, but also reduce the
      number of moving pieces for kwin.
      This also prevents anyone outside kwin loading our QPA which wouldn't
      have made any sense and just crashed.
  3. 30 Sep, 2020 1 commit
  4. 29 Sep, 2020 1 commit
  5. 09 Sep, 2020 1 commit
  6. 03 Sep, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Implement the layer-shell v1 protocol · d3cca65d
      Vlad Zahorodnii authored
      The layer-shell protocol allows wayland clients to create surfaces that
      can be used for building desktop environment components such as panels,
      notifications, etc.
      The support for the plasma-shell protocol will be dropped once plasma in
      all its entirety is ported to the layer-shell protocol.
  7. 01 Sep, 2020 2 commits
    • Marco Martin's avatar
      Fix size restore upon keyboard close in XdgSurfaceClient · 97f4712f
      Marco Martin authored
      in XdgSurfaceClient setFrameGeometry is async,
      so we can't rely on it having the final value immediately.
      make setVirtualKeyboardGeometry a virtual.
      in the implementation on setVirtualKeyboardGeometry
      use requestedFrameGeometry() instead of frameGeometry()
    • Vlad Zahorodnii's avatar
      xwayland: Restart the Xwayland server after it has crashed · 432cfb44
      Vlad Zahorodnii authored
      If the Xwayland process has crashed due to some bug, the user should
      still be able to start applications in Xwayland mode. There is no reason
      to restart the whole session just to be able to launch some application
      that doesn't have native support for Wayland.
  8. 05 Aug, 2020 1 commit
  9. 13 Jul, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Move inputConfig away from KWin::Application · e28e4cb1
      Aleix Pol Gonzalez authored
      We were calling it from tests that were not running a KWin::Application
      and not even including the symbols from main.cpp and main.h. The only
      reason they linked was that it was static_casting up the QCoreApplication.
  10. 01 Apr, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Reduce the amount of objects that are compiled several times · dbac4bce
      Aleix Pol Gonzalez authored
      We build some objects several times which makes it uncomfortable to develop KWin
      since every time we modify something a lot of things get rebuilt. This should
      help a bit although it doesn't solve all the problems.
      Test Plan: Builds, tests pass
      Reviewers: #kwin, zzag
      Reviewed By: #kwin, zzag
      Subscribers: davidedmundson, zzag, anthonyfieroni, iasensio, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D28445
  11. 23 Sep, 2019 2 commits
    • Vlad Zahorodnii's avatar
      Rename ShellClient to XdgShellClient · 168ea988
      Vlad Zahorodnii authored and Vlad Zahorodnii's avatar Vlad Zahorodnii committed
      Rename ShellClient to XdgShellClient in order to reflect that it
      represents only xdg-shell clients.
      Test Plan: Compiles, tests still pass.
      Reviewers: #kwin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D23589
    • Vlad Zahorodnii's avatar
      [autotests] Don't test wl-shell clients · d92d6e77
      Vlad Zahorodnii authored and Vlad Zahorodnii's avatar Vlad Zahorodnii committed
      This change removes all traces of wl-shell in the test suite. That's a
      prerequisite for dropping wl-shell support in KWin.
      Given that wl-shell and xdg-shell are not interchangeable, some tests
      were removed and initialization sequence in some tests was adjusted.
      The most notable change is ensuring that each plasmashell window sets
      its role and initial position before committing the surface. Setting
      those properties before the first surface commit is important because
      our window placement code needs to know window type in order to
      avoid maximizing panels, popups, etc.
      Reviewers: #kwin, davidedmundson
      Reviewed By: #kwin, davidedmundson
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D23561
  12. 12 Sep, 2019 1 commit
  13. 31 Aug, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Traverse the stacking order backwards when switching between windows · 9102e41e
      Vlad Zahorodnii authored
      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
  14. 10 Jul, 2019 1 commit
    • David Edmundson's avatar
      [autotests] Test placement strategies · 9b04e031
      David Edmundson authored
      The maximise test is moved and a simple test is added for smart
      placement and placeCorner.
      The class tries to make a framework to make it faster to add future
      xdg_toplevel placement tests without having to copy too much
      Test Plan: Passes
      Reviewers: #kwin, zzag
      Reviewed By: #kwin, zzag
      Subscribers: zzag, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D21996
  15. 21 Feb, 2019 1 commit
    • Roman Gilg's avatar
      [autotests] Sub-surface resize test · 06f64d5e
      Roman Gilg authored
      Adds an autotest to show that KWin fails an assertion when a client tries to
      resize a sub-surface.
      Since it is the first autotest dealing with sub-surfaces explicitly additional
      autotest helpers are introduced to allow that.
      We also add a new signal in Compositor to spy on to know when the buffer swap
      has been completed.
      Test Plan:
      Test fails as expected:
      QFATAL : KWin::BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface() ASSERT: "image.size() == m_size" in file /home/roman/dev/kde/src/kde/workspace/kwin/platformsupport/scenes/opengl/abstract_egl_backend.cpp, line 394
      FAIL!  : KWin::BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface() Received a fatal error.
         Loc: [Unknown file(0)]
      Totals: 4 passed, 1 failed, 0 skipped, 0 blacklisted, 367ms
      ********* Finished testing of KWin::BufferSizeChangeTest *********
      Reviewers: #kwin, zzag
      Subscribers: zzag, graesslin, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D18452
  16. 19 Feb, 2019 3 commits
    • Roman Gilg's avatar
      Remove X clipboard sync helper and rename its autotest · 2776f829
      Roman Gilg authored
      With the gneric X selections infrastructure and clipboard support the X
      clipboard sync helper utility can be removed. Also rename its autotest as it
      tests the inner workings of the new mechanism since this mechanism was
      Test Plan: Autotest still passes under new name.
      Reviewers: #kwin, davidedmundson
      Reviewed By: #kwin, davidedmundson
      Subscribers: graesslin, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D15063
    • Roman Gilg's avatar
      [xwl] Generic X selections translation mechanism with Clipboard support · 6e08fb2f
      Roman Gilg authored
      In this patch an infrastructure is created to represent generic X selections
      in a Wayland session and use them for data transfers between Xwayland windows
      and Wayland native clients.
      The central manager is the DataBridge class, in which Selection objects can be
      created. This is hard-coded and such a Selection object persists until the end
      of the session, so no arbitrary selections can be created on the fly. For now
      the X Clipboard selection is supported, whose corresponding mechanism in the
      Wayland protocol is just called Selection.
      A Selection object listens for selection owner changes on the X side and for
      similar events into the Wayland server interfaces. If a data provider is
      available a selection source object is created by the Selection object. In case
      data is requested on the other side, a data transfer is initialized by creating
      a Transfer object. A Selection keeps track of all transfers and makes sure that
      they are destroyed when they are finished or in case they idle because of
      misbehaving clients.
      The Clipboard class translates the X Clipboard via a proxy window. Selection
      changes on the Wayland side are listened to through a new signal on the active
      KWayland seat interface.
      The previously used X clipboard syncer helper is disabled. The clipboard sync
      autotest is changed to the new mechanism.
      BUG: 394765
      BUG: 395313
      Test Plan: Manually and clipboard sync autotest.
      Reviewers: #kwin
      Subscribers: zzag, graesslin, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D15061
    • Roman Gilg's avatar
      [autotests] Use Xwayland class in WaylandTestApplication · 608a89a8
      Roman Gilg authored
      By using the new Xwayland class we can reduce code duplication.
      An abstract parent class is introduced, that allows interfacing
      with the Xwayland class from the test binaries.
      Test Plan: Autotests still pass.
      Reviewers: #kwin, davidedmundson
      Reviewed By: #kwin, davidedmundson
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D15022
  17. 12 Feb, 2019 1 commit
  18. 17 Dec, 2018 1 commit
    • Martin Flöser's avatar
      Add a dbus method getWindowInfo returning same data as queryWindowInfo · 9993c6d6
      Martin Flöser authored
      This dbus method is intended to be used by the kwin rules dialog. KWin
      can pass the internal id to the rules dialog through a command line
      argument (or similar way) and the dialog can query the information
      through the dbus call for the provided id. Thus it's possible to
      implement one way to query the information which works on both X11 and
      Wayland without any windowing system specific functionality.
      Test Plan: See new added integration test
      Reviewers: #kwin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D17433
  19. 13 Dec, 2018 1 commit
    • Martin Flöser's avatar
      Introduce a command line option to disable any kind of global shortcuts · a0b482cb
      Martin Flöser authored
      This command line option is useful for KWin in embedded use case. That
      is when KWin is just used as a compositor for one application instead of
      a complete desktop environment. In such a setup global shortcuts are not
      wanted and interfere with the application. E.g. one does not want Alt+F4
      to close the window, that would render the system unusable.
      This change introduces a command line option and disables the following
      event filters and spies:
       * global shortcuts
       * modifier only shortcuts
       * terminate session
       * virtual terminal switching
       * screen edges
      KGlobalAccel still gets inited, otherwise the (non-functional) binary
      would be launched when KWin registers it's global shortcuts.
      Test Plan:
      New test added based on existing tests for the global
      shortcuts, ctest passes
      Reviewers: #kwin
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D17304
  20. 02 Dec, 2018 1 commit
    • Vlad Zahorodnii's avatar
      Make sure that effect windows outlive effects · 29513814
      Vlad Zahorodnii authored
      Compositing is suspended/finished in a very hard way fashion, effect
      windows are destroyed without notifying effects about it.
      AnimationEffect tries gracefully release deleted windows, but because
      in some cases(like when suspending compositing) a deleted window can
      be already destroyed, a segmentation fault can happen.
      This change adjusts the order in which effect windows and effects are
      destroyed, so AnimationEffect (and other effects) cannot access dangling
      BUG: 400788
      FIXED-IN: 5.15.0
      Reviewers: #kwin, graesslin
      Reviewed By: #kwin, graesslin
      Subscribers: graesslin, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D17311
  21. 15 Oct, 2018 1 commit
    • Vlad Zahorodnii's avatar
      Generalize constrainedStackingOrder for group transients and ordinary transients · 3577e690
      Vlad Zahorodnii authored
      We don't really have to have two different code paths for group
      transients and ordinary transients. For now, AbstractClient::hasTransient
      is good enough to check the relationship between potential parent and
      the transient.
      In long term, we need to "invert" the relationship, instead of checking
      whether given parent window has a transient, we should check whether
      given transient is a transient for a given window so we can keep Deleted
      transients above their old parents.
      Reviewers: #kwin, davidedmundson
      Reviewed By: #kwin, davidedmundson
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D15893
  22. 14 Jun, 2018 2 commits
  23. 07 Jun, 2018 2 commits
    • Vlad Zahorodnii's avatar
      [scenes/qpainter] Draw decoration shadows · 2d01ba64
      Vlad Zahorodnii authored
      QPainter doesn't render decoration shadows. It renders only
      shadows provided through ShadowInterface.
      With this change, painting of shadows is done in similar way OpenGL backend is
      currently doing.
      {F5734867, layout=center, size=full}
      {F5734870, layout=center, size=full}
      Depends on D10811 (dummy decoration with shadows in autotests)
      Test Plan:
      * start kwin with QPainter backend enabled:
      KWIN_COMPOSE=Q kwin_wayland --xwayland --windowed
      * open konsole and kate:
      DISPLAY=:1 konsole
      DISPLAY=:1 kate
      Reviewers: #kwin, graesslin, davidedmundson
      Reviewed By: davidedmundson
      Subscribers: abetts, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D10943
    • Vlad Zahorodnii's avatar
      [scenes/opengl] Fix overlapping shadow tiles · 7637cfc2
      Vlad Zahorodnii authored
      This problem appears if shadow corner tiles are too big and
      some window has size smaller than 2 * shadowTileSize.
      This change tries to address the problem above by exclusing
      overlapping tile parts. If there are any two overlapping corners
      then tile between them(top/right/bottom/left) is not rendered.
      Also, because some corner tile parts can be excluded, corner tiles
      are expected to be symmetrical(i.e. if we remove right half from
      the top-left tile and left half from the top-right tile and
      stick them together, they still look fine, there are no misalignments, etc).
      Most shadows(e.g. shadows from Breeze) have such behaviour.
      No tiles are overlapping
      {F5728514, layout=center, size=full}
      Overlapping tiles
      {F5728516, layout=center, size=full}
      And this is how it supposed to be
      {F5728517, layout=center, size=full}
      Test Plan:
      * apply D11069 to Breeze
      * in System Settings/Application Style/Window Decorations, choose "Very Large" shadow size
      * open Konsole
      * resize it to a minimum possible size
      Reviewers: #kwin, graesslin, davidedmundson
      Reviewed By: #kwin, davidedmundson
      Subscribers: davidedmundson, ngraham, anemeth, abetts, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D10811
  24. 04 Mar, 2018 1 commit
    • Martin Flöser's avatar
      Don't crash if the cursor theme fails to create · 2ea5153e
      Martin Flöser authored
      If the cursor theme failed to create KWin crashed due to an endless
      recursion. There are two reasons for this fault:
      1) When the physical size does not exist we perform a division by 0
      which results in an invalid size going into wl_cursor_theme_load
      2) We emit the signal that the cursor theme changed even if it didn't
      change thus creating an endless recursion
      This change addresses both problems: it checks that the size is not 0
      and changes the handling for theme update to only destroy the previous
      theme if the new theme could be created and only emits the signal if
      things change.
      BUG: 390314
      FIXED-IN: 5.12.3
      Test Plan: Added a new test case which crashed with old code
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #plasma
      Differential Revision: https://phabricator.kde.org/D10549
  25. 11 Dec, 2017 1 commit
    • Roman Gilg's avatar
      [colorcorrection] Night Color - blue light filter at nighttime · 82d28604
      Roman Gilg authored
      With Wayland KWin needs to provide certain services, which were provided
      before that by the Xserver. One of these is gamma correction, which includes
      the - by many people beloved - functionality to reduce the blue light at
      nighttime. This patch provides the KWin part of that. It is self contained,
      but in the end will work in tandem with a lib in Plasma Workspace and a KCM
      in Plasma Desktop, which can be used to configure Night Color.
      * Three modi:
      ** Automatic: The location and sun timings are determined automatically
         (location data updates will be provided by the workspace)
      ** Location: The sun timings are determined by fixed location data
      ** Timings: The sun timings are set manually by the user
      * Color temperature value changes are smoothly applied:
      ** Configuration changes, which lead to other current values are changed
         in a quick way over a few seconds
      ** Changes on sunrise and sunset are applied slowly over the course of few
         minutes till several hours depending on the configuration
      * The current color value is set immediately at startup or after suspend
        phases and VT switches. There is no flickering.
      * All configuration is done via a DBus interface, changed values are tested
        on correctness and applied atomically
      * Self contained mechanism, speaks directly to the hardware by setting the
        gamma ramps on the CRTC
      * Currently working on DRM backend, extensible to other platform backends in
        the future
      * The code is written in a way to make the classes later easily extendable to
        also provide normal color correction, as it's currently done by KGamma on X
      Test Plan:
      Manually with the workspace parts and added integration tests in KWin using
      the virtual backend.
      Reviewers: #kwin, graesslin
      Subscribers: kwin, plasma-devel, #kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D5928
  26. 30 Nov, 2017 1 commit
    • Martin Flöser's avatar
      Add support for new IdleInhibition protocol · ff2e8834
      Martin Flöser authored
      A small helper class is added which manages inhibiting idle for the
      ShellClients. So far only very basic functionality is added. That is
      only the inhibition on the Surface is followed. It is not yet checked
      whether the ShellClient is visible at all. That needs some changes in
      BUG: 385956
      FIXED-IN: 5.12
      Test Plan: New test case passes
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D8856
  27. 21 Nov, 2017 1 commit
  28. 19 Oct, 2017 2 commits
    • Martin Flöser's avatar
      [QPA] Implement Screen on top of internal Screens API · abedb464
      Martin Flöser authored
      The test DontCrashUseractionsMenu (Waylandonly) found an issue in our
      screen handling implementation in the QPA. The code exposed a short time
      frame between the dummy screen getting destroyed and the first screen
      being added. This could result in a crash of KWin.
      There is actually no need to implement Screen on top of Wayland screen.
      KWin has all the knowledge, so we can also base this on top of the
      Screens API.
       * no delays due to Wayland roundtrips
       * handle screen getting removed (was a TODO)
       * handle resolution changes (was a TODO)
      The new implementation has a disadvantage that it destroys and readds
      all screens whenever something around the screen changes. This shouldn't
      be an issue in practice as it's only for the internal QPA and thus only
      affects KWin internal windows which is placed in global coordinates
      anyway. If it turns out to be a problem we need to track better the
      screen changes - so far those were not tracked at all.
      Test Plan: Run a few unit tests which change screens
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D8345
    • Martin Flöser's avatar
      Implement Apply desktop rule for ShellClient · d3eccada
      Martin Flöser authored
      This change sets up ShellClient for supporting window rules by reading
      in the rules once it gets created. As a first rule the Apply initially
      rule for desktop is implemented.
      Currently it is not yet possible to set window rules through the
      configuration menu. So far only injecting rules through the test
      framework (temporary rules) is implemented. The idea is to first
      implement all rules then to expose them to the UI.
      Test Plan: New test case
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D8177
  29. 01 Oct, 2017 1 commit
  30. 30 Sep, 2017 1 commit
    • Martin Flöser's avatar
      [autotests] Support Wayland Only in addition to XWayland · 2fb5a5fb
      Martin Flöser authored
      The integrationTest function takes a new optional argument whether the
      test supports a Wayland Only mode. If that's the case the test is
      compiled twice, once (as always) as "foo" with XWayland support and
      once as "foo_waylandonly" without XWayland support.
      This way we can ensure that our code always supports both modes. The
      tests found multiple issues. At the moment fast running tests are
      sporadically crashing on tear down. This needs further investigation.
  31. 27 Jul, 2017 1 commit
  32. 20 Jul, 2017 1 commit
    • Martin Flöser's avatar
      [autotests] Add test cases for switchWindow · 84b0578a
      Martin Flöser authored
      A new test class for KWinBindings added which is intended to group the
      testing of the various slots set up in kwinbindings.cpp. As the scripts
      also delegate to the slots this is also tested.