1. 19 Aug, 2017 2 commits
    • Martin Flöser's avatar
      Send QKeyEvent with Qt::Key as expected by Qt to internal windows · 70bc9524
      Martin Flöser authored
      Summary:
      KWin passes the current keysym converted to a Qt::Key in the QKeyEvent.
      The current keysym does not always change when a key gets released, so
      when pressing a shortcut the release carry a Qt::Key which could be
      considered as wrong.
      
      QtWayland transforms the actual pressed/released key into a keysym and
      passes that through the QKeyEvent. This change does the same for the
      internal windows. A new QKeyEvent is created and adjusted in a way that
      it matches what Qt expects.
      
      Why not change everything to how Qt expects it? The key is used at
      various places and in KWin internally we expect the behavior how it is
      currently implemented. So it's better to use Qt's expectation only when
      interacting with Qt.
      
      Also the change carries a workaround for a bug in QKeySequenceEdit
      (see QTBUG-62102) and transforms Super to Meta. As this adjustment only
      makes sense for the internal windows we need to send in an adjusted
      QKeyEvent anyway, so another argument for using the Qt behavior only in
      this place.
      
      Test Plan:
      Can set a shortcut on Wayland and it can be used to activate
      the window.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D6828
      70bc9524
    • Martin Flöser's avatar
      [platforms/x11] Use a GlxContextAttributeBuilder · f88c322a
      Martin Flöser authored
      Summary:
      Based on the work of 3f4995fb this change
      introduces a GlxContextAttributeBuilder to make the requesting of context
      attributes cleaner, more verbose and less error prone copy and paste.
      
      Test Plan:
      Switched between Core and legacy and verified the output;
      extended auto test
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D6411
      f88c322a
  2. 18 Aug, 2017 1 commit
    • David Edmundson's avatar
      Track outputs in kwin integration tests · 34de2c2b
      David Edmundson authored
      Summary:
      Split from the last review, as in order to track output's removed (in
      any way that's useful) the registry needs to be on the heap and the change grew.
      
      Test Plan:
      Every test that previously passed on my system still does
      Though currently that's not every test (for some reason) which was
      my main motivation for splitting.
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: plasma-devel, kwin, #kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7377
      34de2c2b
  3. 16 Aug, 2017 2 commits
    • Martin Flöser's avatar
      Migrate Xkb::toQtKey away from KKeyServer · 5d101ce2
      Martin Flöser authored
      Summary:
      Turn Xkb into a QObject
      
      Reduced dependencies on other classes and allows to emit signal directly
      instead of emitting a signal on another class.
      
      Dependency inject KWayland::Server::SeatInterface into Xkb
      
      No need to depend on WaylandServer from within Xkb.
      
      [autotests] Add test case for Xkb::toQtKey
      
      Tests all key codes KKeyServer is able to map to Qt.
      
      Migrate Xkb::toQtKey away from KKeyServer
      
      The regression in kwindowsystem in
      32526718eae99ccb594360627586eebdf793372b showed once more that it's time
      to migrate the xkb keysym to Qt::Key mapping away from KKeyServer. The
      main problem with KKeyServer is that it's made for X11 and we don't have
      X11 here. This causes warnings printed at runtime and the code only
      works by accident at all because KKeyServer fails to initialise
      modifiers. That is normally KKeyServer would include the modifiers, but
      that is nothing we are interested in for mapping xkb keysyms to Qt::Key.
      
      So to address this, KWin now implements the mapping itself. It's based
      on the implementation in KKeyServer, but also improved by providing
      faster xkb to Qt conversion (which matters for KWin more than the other
      direction).
      
      Long term plan is to extend this so that also on X11 it can be used.
      Then it should be split out and be used in KKeyServer as a replacement
      for the current implementation which could support both X11 and Wayland.
      
      Test Plan:
      New test case added which covers all keysyms supported by
      existing KKeyserver mapping
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7336
      5d101ce2
    • Martin Flöser's avatar
      [autotests] Add test case for Xkb::toQtKey · 801fe410
      Martin Flöser authored
      Tests all key codes KKeyServer is able to map to Qt.
      801fe410
  4. 13 Aug, 2017 3 commits
  5. 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
  6. 09 Aug, 2017 2 commits
  7. 08 Aug, 2017 2 commits
  8. 02 Aug, 2017 1 commit
  9. 31 Jul, 2017 2 commits
  10. 29 Jul, 2017 2 commits
    • Martin Flöser's avatar
      [autotests] Fix unused function warnings · 1447f464
      Martin Flöser authored
      The functions are defined in a common header but not used in all tests.
      This creates needless warning noise, so hide them through an ifdef.
      1447f464
    • 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
  11. 28 Jul, 2017 2 commits
  12. 27 Jul, 2017 3 commits
  13. 26 Jul, 2017 1 commit
  14. 25 Jul, 2017 2 commits
    • Martin Flöser's avatar
      [autotests] Try to make PlasmaWindowTest::testCreateDestroyX11PlasmaWindow more robust · f5f14475
      Martin Flöser authored
      The test was racing on build.kde.org and failing due to that. We have
      a condition there where we wait for some parts being transmitted through
      X and some through Wayland. The test assumed X is faster and failed due
      to that.
      f5f14475
    • 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
  15. 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.
      a1af59e9
    • Martin Flöser's avatar
      Reset last_active_client when a ShellClient is removed · bd158a63
      Martin Flöser authored
      Summary:
      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
        manager
      
      Test Plan: test case no longer crashes
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6852
      bd158a63
    • 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
      dcbfa086
  16. 21 Jul, 2017 1 commit
  17. 20 Jul, 2017 3 commits
  18. 18 Jul, 2017 2 commits
  19. 17 Jul, 2017 2 commits
    • Martin Flöser's avatar
      [qpa] Use the new OpenGLContextAttributeBuilder to create Qt's OpenGL context · 73fa7b21
      Martin Flöser authored
      Summary:
      Introduces a few more attributes needed for creating the OpenGL context
      used by the QPA.
      
      Test Plan:
      Extended test and run KWin/Wayland and verified that OpenGL context
      gets created correctly.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6734
      73fa7b21
    • Martin Flöser's avatar
      Properly swap the quick tile side when pressing the shortcut again · 139b4dc8
      Martin Flöser authored
      Summary:
      The quick tile shortcuts have a feature of moving the window to the next
      screen if one presses the same shortcut again.
      E.g. if a window is quick tiled to the left on the right most screen,
      quick tile again to left should move it to the left screen and quick tile
      right. Thus it swaps the borders.
      
      This wasn't handled correctly, especially not for modes like top and
      bottom. If a window is quick tiled to the top an impossible mode was
      generated: Left | Right. Doesn't make sense.
      
      This change fixes the mode swapping and extends our quick tile testing
      to cover the situation.
      
      BUG: 382313
      FIXED-IN: 5.10.4
      
      Test Plan: Extended test case
      
      Reviewers: #plasma, #kwin
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6708
      139b4dc8
  20. 11 Jul, 2017 2 commits
    • Martin Flöser's avatar
      Implement support for restricted move area on Wayland · 672cae9a
      Martin Flöser authored
      Summary:
      This change implements a missing TODO to generate the restricted move
      area for windows with struts (aka panel) on Wayland.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D6611
      672cae9a
    • Martin Flöser's avatar
      Restrict move resize area only on the screen the strut window is on · 14c8440f
      Martin Flöser authored
      Summary:
      By allowing panels between screens in 5.8 to have a strut we created a
      "regression" in KWin. KWin always was wrong, just we didn't notice as
      neither Plasma nor previously Kicker set a strut on panels between shared
      screen edges.
      
      The strut is created from the edge of the overall screen setup. This
      means a panel on the left edge of a screen on the right has the strut
      starting from the left screen. KWin uses the strut to restrict the move
      resize area: a window decoration is not allowed to go below a strut. Thus
      it becomes impossible to move the window from the right to the left
      screen.
      
      This change tries to solve this problem by only restricting the move area
      on the screen the window with the strut is on. E.g. if the window is on
      the right screen, the left screen is not affected. Thus it's possible
      again to move a window from one screen to the other as the added test
      case shows.
      
      Unfortunately there are still corner cases where this won't work
      correctly. If the window is on both screens this won't work. It is also a
      rather heavy change for KWin and thus it's targeted for master and not
      for the 5.10 or the 5.8 branch. If we notice that the patch works well
      and doesn't create further issues, it should be considered for
      backporting.
      
      BUG: 371199
      CCBUG: 370510
      FIXED-IN: 5.11
      
      Test Plan: Added test case
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D6562
      14c8440f
  21. 08 Jul, 2017 1 commit