Commit 974abbfa authored by Martin Flöser's avatar Martin Flöser

[autotests/integration] Add test case for global shortcuts with Fx

New test which tries to trigger Alt+F3 which does not work due to the
behavior how xkbcommon calculates consumed modifers. The combination
Ctrl+Alt+F3 generates a keysym (vt switching) so just pressing F3
already consumes ctrl and alt modifier.

For more information see:

CCBUG: 368989
parent 03b8477f
......@@ -23,9 +23,12 @@ along with this program. If not, see <>.
#include "platform.h"
#include "screens.h"
#include "shell_client.h"
#include "useractions.h"
#include "wayland_server.h"
#include "workspace.h"
#include <KWayland/Client/shell.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Server/seat_interface.h>
#include <KGlobalAccel>
......@@ -46,6 +49,7 @@ private Q_SLOTS:
void testConsumedShift();
void testRepeatedTrigger();
void testUserActionsMenu();
void GlobalShortcutsTest::initTestCase()
......@@ -67,12 +71,14 @@ void GlobalShortcutsTest::initTestCase()
void GlobalShortcutsTest::init()
KWin::Cursor::setPos(QPoint(640, 512));
void GlobalShortcutsTest::cleanup()
void GlobalShortcutsTest::testConsumedShift()
......@@ -137,5 +143,32 @@ void GlobalShortcutsTest::testRepeatedTrigger()
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTSHIFT, timestamp++);
void GlobalShortcutsTest::testUserActionsMenu()
// this test tries to trigger the user actions menu with Alt+F3
// the problem here is that pressing F3 consumes modifiers as it's part of the
// Ctrl+alt+F3 keysym for vt switching. xkbcommon considers all modifiers as consumed
// which a transformation to any keysym would cause
// for more information see:
// first create a window
QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(;
auto c = Test::renderAndWaitForShown(, QSize(100, 50), Qt::blue);
quint32 timestamp = 0;
kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++);
kwinApp()->platform()->keyboardKeyPressed(KEY_F3, timestamp++);
kwinApp()->platform()->keyboardKeyReleased(KEY_F3, timestamp++);
QEXPECT_FAIL("", "BUG 368989", Continue);
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++);
#include "globalshortcuts_test.moc"
......@@ -21,6 +21,8 @@ along with this program. If not, see <>.
#include "ui_shortcutdialog.h"
#include <kwinglobals.h>
// Qt
#include <QDialog>
#include <QObject>
......@@ -52,7 +54,7 @@ class Client;
* @author Martin Gräßlin <>
class UserActionsMenu : public QObject
class KWIN_EXPORT UserActionsMenu : public QObject
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment