D6828: Send QKeyEvent with Qt::Key as expected by Qt to internal windows

Martin Flöser noreply at phabricator.kde.org
Sat Jul 22 10:56:50 UTC 2017


graesslin created this revision.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.

REVISION 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.

BRANCH
  internal-window-proper-key

REVISION DETAIL
  https://phabricator.kde.org/D6828

AFFECTED FILES
  autotests/integration/globalshortcuts_test.cpp
  input.cpp
  workspace.h

To: graesslin, #kwin, #plasma
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170722/ac290065/attachment.html>


More information about the Plasma-devel mailing list