1. 10 Sep, 2020 1 commit
  2. 07 Aug, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Prettify license headers · 4ce853e8
      Vlad Zahorodnii authored
    • 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.
  3. 22 Jul, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Check if we successfully restored input focus · 55588507
      Vlad Zahorodnii authored
      In rare cases, Workspace::restoreFocus() may fail, for example when the
      most recently activated client is about to be destroyed or unmapped.
      If it happens that we cannot restore the focus, then mark the window in
      FocusIn event as active.
      CCBUG: 424223
    • Vlad Zahorodnii's avatar
      Make setFrameGeometry() re-entrant for X and internal clients · 80a31ab4
      Vlad Zahorodnii authored
      If AbstractClient::setFrameGeometry() is called from a slot connected
      directly to the frameGeometryChanged() signal, then is there a good
      chance that kwin will fall into an infinite recursion. However, that's
      the case with only X11 and internal clients.
      The root cause of the infinite recursion is that both X11Client and
      InternalClient compare the new geometry against the geometry before
      update blocking. In order to fix the bug, we simply need to ensure that
      updateGeometryBeforeUpdateBlocking() has been called before we start
      emitting the frameGeometryChanged() signal.
      Furthermore, a couple of tests were added to ensure that we won't hit
      this subtle bug again.
  4. 21 Jul, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Partially revert a0c4a8e7 · 27172528
      Vlad Zahorodnii authored
      Unfortunately, a0c4a8e7 has a major bug
      where clients that track focus events may get confused by focusToNull().
      One such a notable example is Dota 2. It tracks the focus events to
      minimize itself after the keyboard focus has been lost as well stop
      playing music while it's in background. So, when we call focusToNull(),
      Dota 2 will receive a corresponding FocusOut event and ask the window
      manager to minimize it. It doesn't really matter that the FocusOut
      event is going to be followed by a FocusIn event because when a window
      is minimized, kwin will activate the next one in the focus chain.
      Since those issues can't be fixed from the window manager's side, this
      patch partially reverts a0c4a leaving only the autotest.
      BUG: 424223
      FIXED-IN: 5.19.4
  5. 17 Jul, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Introduce started signal in Application · d1b35f30
      Vlad Zahorodnii authored
      The new signal is emitted when the Application has fully been initialized.
      It allows us to change the startup sequence, for example create workspace
      before starting the Xwayland server, without making any adjustments in our
      test suit.
  6. 25 Jun, 2020 1 commit
    • Vlad Zahorodnii's avatar
      [x11] Force FocusIn events for already focused windows · a0c4a8e7
      Vlad Zahorodnii authored
      Depending on the current focus stealing prevention level, it's possible
      for kwin to call XSetInputFocus() on a window that already has the input
      focus. In which case, we won't receive the corresponding FocusIn event
      and the client will remain inactive from kwin's perspective even though
      it isn't.
      In order to work around this issue, we can move the input focus to the
      null window. By doing so, it's guaranteed that we're going to receive
      the matching FocusIn event for the client.
      This commit indirectly fixes a bug where fullscreen games are displayed
      below panels.
  7. 02 Apr, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Make it possible to have a separate cursor for the tablet · 6abd23ed
      Aleix Pol Gonzalez authored
      As is KWin only had 1 Cursor which was a singleton. This made it impossible for
      us to properly implement the tablet (as in drawing tablets) support and show where
      we're drawing.
      This patch makes it possible to have different Cursors in KWin, it makes all the
      current code still follow the mouse but the tablet can still render a cursor.
      Test Plan: Tests pass, been using it and works as well as before but with beautiful tablet cursors.
      Reviewers: #kwin, cblack, davidedmundson
      Reviewed By: #kwin, cblack, davidedmundson
      Subscribers: davidedmundson, cblack, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D28155
  8. 04 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Use AbstractClient instead of XdgShellClient wherever possible · be759b7d
      Vlad Zahorodnii authored
      Currently, we have only one shell client type - XdgShellClient. We use
      it when we are dealing with Wayland clients. But it isn't really a good
      idea because we may need to support shell surfaces other than xdg-shell
      ones, for example input panel surfaces.
      In order to make kwin more extensible, this change replaces all usages
      of the XdgShellClient class with the AbstractClient class.
      Test Plan: Existing tests pass.
      Reviewers: #kwin, davidedmundson
      Reviewed By: #kwin, davidedmundson
      Subscribers: davidedmundson, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D27778
  9. 28 Feb, 2020 1 commit
  10. 25 Sep, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Rename Client to X11Client · ffcbe24e
      Vlad Zahorodnii authored
      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
      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
  11. 23 Sep, 2019 2 commits
    • Vlad Zahorodnii's avatar
      Rename ShellClient to XdgShellClient · 168ea988
      Vlad Zahorodnii authored
      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
      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. 26 Apr, 2019 1 commit
    • Christoph Feck's avatar
      Fix captions with non-BMP characters · 57440d1d
      Christoph Feck authored
      KWin replaces any non-printable character with a space. This check does not
      handle surrogate pairs correctly. Additionally, translators sometimes insert
      non-printable soft-hyphens into titles, which also cause KWin to display a
      space instead.
      This code adds the missing surrogate handling, and (to fix both issues), also
      removes non-printable characters instead of replacing them with a space.
      Also moved the changed test after these changes, so that changes in non-
      printable characters do not cause unneeded redraws.
      Unit tests adapted by Vlad Zagorodniy.
      Test Plan:
      kwrite /tmp/Test😣.txt shows correct title. I also tested actual non-printable
      characters, such as 0x1A, and these are correctly omitted.
      BUG: 376813
      FIXED-IN: 5.15.5
      Reviewers: #kwin, zzag
      Reviewed By: #kwin, zzag
      Subscribers: zzag, grasslin, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D19052
  13. 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
      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
  14. 31 Aug, 2018 1 commit
    • Vlad Zahorodnii's avatar
      Clean up includes · 624a4531
      Vlad Zahorodnii authored
      * effects.h includes client.h and forward declares Client, both at the
        same time. Thus, delete the include;
      * the blur effect includes effects.h. That, most likely, is a leftover
        after 3f5bf65a.
      Test Plan: Compiles.
      Reviewers: #kwin, davidedmundson
      Reviewed By: #kwin, davidedmundson
      Subscribers: kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D15191
  15. 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
      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
  16. 06 Jan, 2018 1 commit
    • Martin Flöser's avatar
      [autotests] Add test case for fullscreen window with groups · 87ebfd15
      Martin Flöser authored
      When an X11 window is raised to fullscreen it gets set to active layer.
      When another window gets activated then it goes back to normal layer.
      But when a window of the same group gets activated the fullscreen window
      stays in the active layer. Due to that it is not possible to raise other
      windows above the fullscreen window.
      This just adds a test case exposing the problematic area.
      CCBUG: 388310
  17. 23 Sep, 2017 1 commit
    • Martin Flöser's avatar
      Properly update the visible (icon) name when the caption changes · ab7b6757
      Martin Flöser authored
      It was possible that we performed an early exit when the caption changes
      and this results in the visible name being wrong. E.g if we have two
      windows called foo, the second one has the visible name "foo <2>". After
      changing that to "bar" the bug resulted in it still being the foo
      variant instead of getting cleared.
      BUG: 384760
      FIXED-IN: 5.11.0
      Test Plan: Created new test case exposing the problem
      Reviewers: #kwin, #plasma, hein
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D7871
  18. 01 Sep, 2017 1 commit
  19. 21 Aug, 2017 1 commit
    • Martin Flöser's avatar
      Use xcb-icccm to read the name property · c87230c3
      Martin Flöser authored
      The KWindowSystem call which we used doesn't work on Wayland as it's only
      implemented in the xcb variant and cannot be made available for Wayland
      in an easy way as it is still XLib based.
      This change turns the optional XCB-ICCCM dependency in a required one
      and thus can use the functionality provided by said library to implement
      what KWindowSystem provided.
      BUG: 382789
      Test Plan: New test case which failed with old code
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D7046
  20. 13 Aug, 2017 2 commits
  21. 26 Jul, 2017 1 commit
  22. 23 Jul, 2017 3 commits
    • Martin Flöser's avatar
      [autotests] Extend X11ClientTest::testFullscreenLayerWithActiveWaylandWindow · a1af59e9
      Martin Flöser authored
      Unfortunately still doesn't trigger the actual bug.
    • Martin Flöser's avatar
      Reset last_active_client when a ShellClient is removed · bd158a63
      Martin Flöser authored
      The last_active_client is set when an AbstractClient gets activated. For
      the X11 case the last_active_client was getting reset to nullptr when
      the last_active_client gets destroyed. But for the ShellClient that did
      not yet happen. This could result in a crash.
      This change addresses the problem and adds a test case which triggered
      the crash. The condition of the crash are difficult to generate though -
      it took me about an hour to write the test for the crash.
      1. Wayland client must be active
      2. Explicit focus to null (no active client)
      3. destroy Wayland window
      4. X11 client which sets focus on itself without interaction with window
      Test Plan: test case no longer crashes
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D6852
    • Martin Flöser's avatar
      [autotest] Add a test case for X11 fullscreen windows when an Wayland window is there · dcbfa086
      Martin Flöser authored
      KWin cannot handle the layering correctly when a Wayland window is active
      and there is a fullscreen X11 window. This test tries to simulate the
      situation, but it does not show it.
      Nevertheless it's a good test, so let's add it.
      CCBUG: 375759
  23. 07 Nov, 2016 1 commit
    • Martin Flöser's avatar
      Simplify the window title passed in from the window system · 2a155925
      Martin Flöser authored
      So far KWin used the window title provided from the window directly
      without any sanitizing. This could result in broken window decorations
      if the title included line breaks. Those were passed to the decoration
      and depending on the way how the decoration renders the title, it could
      result in visual breakage.
      Having line breaks in a window title doesn't make sense. Given that KWin
      now simplifies the title when copying it to it's own structure. This
      also ensures that the title passed to e.g. task manager does not have
      any line breaks on Wayland.
      BUG: 323798
      FIXED-IN: 5.8.4
      Test Plan: Opened the web page in a nested KWin, properly rendered now.
      Reviewers: #kwin, #plasma
      Subscribers: plasma-devel, kwin
      Tags: #kwin
      Differential Revision: https://phabricator.kde.org/D3215
  24. 31 Oct, 2016 1 commit
  25. 13 Jul, 2016 1 commit
    • Martin Flöser's avatar
      Handle situation of no XDG_RUNTIME_DIR gracefully · 3c04d529
      Martin Flöser authored
      If KWin fails to start the Wayland server due to XDG_RUNTIME_DIR not
      being set, kwin_wayland should terminate with an error condition but
      not crash.
      This change makes sure that KWin detects that the Wayland server does
      not work and terminates the startup early and ensures that it doesn't
      crash while going down.
      An error message is shown that we could not create the Wayland server.
      Test Plan:
      Test case added which verifies that WaylandServer fails to
      init. Manual testing that kwin_wayland exits with error 1.
      Reviewers: #kwin, #plasma_on_wayland
      Subscribers: plasma-devel, kwin
      Tags: #plasma_on_wayland, #kwin
      Differential Revision: https://phabricator.kde.org/D2078
  26. 29 Jun, 2016 1 commit
  27. 11 May, 2016 1 commit