1. 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
      Summary:
      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
      6abd23ed
  2. 04 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Use AbstractClient instead of XdgShellClient wherever possible · be759b7d
      Vlad Zahorodnii authored
      Summary:
      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
      be759b7d
  3. 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
  4. 23 Sep, 2019 3 commits
    • Vlad Zahorodnii's avatar
      Rename ShellClient to XdgShellClient · 168ea988
      Vlad Zahorodnii authored
      Summary:
      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
      168ea988
    • Vlad Zahorodnii's avatar
      [autotests] Don't test wl-shell clients · d92d6e77
      Vlad Zahorodnii authored
      Summary:
      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
      d92d6e77
    • 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. 24 Apr, 2018 2 commits
  6. 18 Sep, 2017 1 commit
  7. 19 Aug, 2017 1 commit
    • 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
  8. 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
  9. 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
  10. 20 Jul, 2017 1 commit
  11. 15 Dec, 2016 1 commit
  12. 17 Oct, 2016 1 commit
    • Martin Flöser's avatar
      Fix shortcut triggering with shift+letter · 78a2732a
      Martin Flöser authored
      Summary:
      A shortcut with e.g. shift+w could not be triggered as shift is
      considered as consumed. It transforms the keysym to an uppercase variant
      thus it is consumed.
      
      This change checks for the condition that shift is pressed and is the
      only consumed modifier. If the current keysym is a letter the shift is
      removed from the consumed modifier again to still support the shortcut.
      
      BUG: 370341
      FIXED-IN: 5.8.2
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D3015
      78a2732a
  13. 11 Oct, 2016 1 commit
  14. 06 Oct, 2016 2 commits
    • Martin Flöser's avatar
      Workaround xkbcommon behavior concerning consumed modifiers · 421824b6
      Martin Flöser authored
      Summary:
      If a key could be turned into a keysym with a modifier xkbcommon
      considers the modifier as consumed even if not pressed.
      E.g. Alt+F3 considers alt as consumed as there is a keysym gnerated with
      Ctrl+Alt+F3 (vt switching).
      
      This change tries to workaround the problem by ignoring the consumed
      modifiers if there are more modifiers consumed than active. It's
      possible that this will create regressions for other shortcuts - we need
      to test it in the wild. Although this might cause regressions I'm aiming
      for Plasma/5.8 branch with the change. It only affects Wayland and fixes
      quite important shortcuts from window manager perspective (desktop
      switching (ctrl+f1 to ctrl+f4), desktop grid (ctrl+f8), present windows
      (ctrl+f9, ctrl+10), cube (ctrl+f11), user actions (alt+f3), close window
      (alt+f4)). If it causes regressions they need to be fixed as well in the
      Plasma/5.8 branch.
      
      A new API entry point for xkbcommon was proposed, but is not yet merged
      and there is no release with it yet. Once that is available the
      workaround should get removed and replaced by the new API call.
      
      BUG: 368989
      FIXED-IN: 5.8.1
      
      Test Plan: Going to restart session now with the change
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2945
      421824b6
    • Martin Flöser's avatar
      Only repeat one key · 3bc60893
      Martin Flöser authored
      Summary:
      So far KWin tried to repeat all pressed keys which should repeat. But
      this is not how X11 and e.g. QtWayland handle it. There only one key -
      the last one which got pressed - repeats. And this makes sense as the
      key is used to generate a keysym and that one KWin caches. Thus the
      logic so far resulted in incorrect keysyms to be generated during the
      repeat. E.g. pressing a, pressing b, releasing b would repeat b instead
      of the hold a as b was the last generated keysym.
      
      This change addresses this problem and let's only one key repeat at a
      time. When the currently repeating key gets released the repeat timer is
      stopped and other hold keys won't repeat any more. This also matches the
      behavior of X11 and QtWayland.
      
      BUG: 369091
      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/D2941
      3bc60893
  15. 05 Oct, 2016 1 commit
  16. 04 Oct, 2016 1 commit
    • Martin Flöser's avatar
      [autotests/integration] Add test case for repeating shortcuts · 48db6716
      Martin Flöser authored
      This adds a new test case for global shortcuts which simulates
      triggering a shortcut through key repeat. The test verifies a problem
      that the the shortcut continues to be triggered after releasing the key
      if another key is still pressed (and triggers repeats).
      
      CCBUG: 369091
      48db6716
  17. 15 Sep, 2016 2 commits
    • Sebastian Kügler's avatar
      parent qaction in test · 99f491e7
      Sebastian Kügler authored
      Summary:
      My compiler doesn't seem to like this constructor, it bails out with the
      following error:
      
      /home/sebas/kf5/src/kde/workspace/kwin/autotests/integration/globalshortcuts_test.cpp:
      In member function ‘void GlobalShortcutsTest::testConsumedShift()’:
      /home/sebas/kf5/src/kde/workspace/kwin/autotests/integration/globalshortcuts_test.cpp:79:40:
      error: no matching function for call to ‘QAction::QAction()’
           QScopedPointer<QAction> action(new QAction);
                                              ^~~~~~~
      
      Using this as first argument fixes the build on my machine.
      
      Test Plan: screenedges test fails, others pass. (this screenedges test failure seems unrelated)
      
      Reviewers: graesslin
      
      Reviewed By: graesslin
      
      Subscribers: luebking, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D2782
      99f491e7
    • Sebastian Kügler's avatar
      parent qaction in test · 1d37b92d
      Sebastian Kügler authored
      Summary:
      My compiler doesn't seem to like this constructor, it bails out with the
      following error:
      
      /home/sebas/kf5/src/kde/workspace/kwin/autotests/integration/globalshortcuts_test.cpp:
      In member function ‘void GlobalShortcutsTest::testConsumedShift()’:
      /home/sebas/kf5/src/kde/workspace/kwin/autotests/integration/globalshortcuts_test.cpp:79:40:
      error: no matching function for call to ‘QAction::QAction()’
           QScopedPointer<QAction> action(new QAction);
                                              ^~~~~~~
      
      Using this as first argument fixes the build on my machine.
      
      Test Plan: screenedges test fails, others pass. (this screenedges test failure seems unrelated)
      
      Reviewers: graesslin
      
      Reviewed By: graesslin
      
      Subscribers: luebking, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D2782
      1d37b92d
  18. 14 Sep, 2016 2 commits
    • Martin Flöser's avatar
      Remove not-wanted modifiers prior to evaluating global shortcuts · 42358716
      Martin Flöser authored
      Summary:
      When triggering global shortcuts we are more interested in the hold
      keys than the currently active modifiers. E.g. capslock should not
      be seen as "shift is hold". Similar we need to remove consumed
      modifiers. Shift+5 is % and not Shift+% - the shift modifier is
      consumed and needs to be removed from shortcut evaluation.
      
      To support this we need to have the actual state directly from
      xkbcommon. Thus a new method is added which exposes the modifiers
      relevant for global shortcut matching. In addition on every key press
      all consumed modifiers are calculated and kept so that they can be
      used for shortcut matching.
      
      In addition a workaround is added for Backtab. Similar workaround
      exists in kglobalaccel for X11. The problem is that our shortcuts are
      stored incorrectly: Shift+Tab instead of Backtab. Thus a mapping back
      is required. To make everything worse KWin registers the wrong key
      sequence "Alt+Shift+Backtab" which doesn't make any sense and is
      broken on X11 at least.
      
      The workaround supports both special cases. The one for Backtab should
      be turned into Shift+Tab and also KWin's special case of adding shift
      to backtab.
      
      CCBUG: 368581
      
      Reviewers: #kwin, #plasma_on_wayland, bshah
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D2768
      42358716
    • Martin Flöser's avatar
      [autotests/integration] Add a global shortcuts test · cdcee88b
      Martin Flöser authored
      New test case to verify that global shortcut triggering works correctly.
      First test case is to verify that consumed modifiers do not break the
      shortcut. E.g. a shortcut registered for % should trigger on Shift+5 on
      us layout. For that the modifier needs to be consumed, otherwise it's
      Shift+% and doesn't trigger. As the test shows this is currently the
      case.
      cdcee88b