Super modifier is not triggered under kwin_wayland/sway
Steps to reproduce
- Use following test program with
WAYLAND_DEBUG=1 ./test 2>&1 | grep '\(keypress\|keyrelease\|modifier\|wl_keyboard\)'
#include <glib-object.h>
#include <gtk/gtk.h>
GtkWidget *window;
void key_pressed(GtkEventController *, guint keyval, guint keycode,
GdkModifierType state, void *) {
g_warning("keypress keyval: %u keycode: %u state: %u", keyval, keycode,
state);
}
void key_released(GtkEventController *, guint keyval, guint keycode,
GdkModifierType state, void *) {
g_warning("keyrelease keyval: %u keycode: %u state: %u", keyval, keycode,
state);
}
void modifiers(GtkEventController *, GdkModifierType state, void *) {
g_warning("modifiers state: %u", state);
}
static void activate(GtkApplication *app, gpointer user_data) {
window = gtk_application_window_new(app);
gtk_window_set_title(GTK_WINDOW(window), "Window");
gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);
gtk_widget_set_focusable(window, TRUE);
GtkEventController *event = gtk_event_controller_key_new();
gtk_widget_add_controller(window, event);
g_signal_connect(event, "key-pressed", G_CALLBACK(key_pressed), NULL);
g_signal_connect(event, "key-released", G_CALLBACK(key_released), NULL);
g_signal_connect(event, "modifiers", G_CALLBACK(modifiers), NULL);
gtk_widget_show(window);
}
int main(int argc, char *argv[]) {
GtkApplication *app;
int status;
app = gtk_application_new("org.gtk.example", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
status = g_application_run(G_APPLICATION(app), argc, argv);
g_object_unref(app);
return status;
}
- Press super key , or other key combined with super
Some log sample
[ 705195.739] -> wl_seat@23.get_keyboard(new id wl_keyboard@30)
[ 705265.750] wl_keyboard@30.repeat_info(25, 600)
[ 705265.775] wl_keyboard@30.keymap(1, fd 11, 63776)
[ 705317.888] wl_keyboard@30.enter(2182, wl_surface@32, array[0])
[ 705317.912] wl_keyboard@30.modifiers(2158, 0, 0, 0, 0)
[ 705844.994] wl_keyboard@30.key(2186, 4946067, 125, 1)
[ 705845.076] wl_keyboard@30.modifiers(2187, 64, 0, 0, 0) <---- press super
** (test:56065): WARNING **: 12:41:48.752: keypress keyval: 65515 keycode: 133 state: 0
[ 705962.704] wl_keyboard@30.key(2188, 4946185, 125, 0)
[ 705962.784] wl_keyboard@30.modifiers(2189, 0, 0, 0, 0) <---- release super , compositor send the modifier change.
** (test:56065): WARNING **: 12:41:48.870: keyrelease keyval: 65515 keycode: 133 state: 0
[ 709558.430] wl_keyboard@30.key(2190, 4949781, 29, 1)
[ 709558.472] wl_keyboard@30.modifiers(2191, 4, 0, 0, 0) <---- press control
** (test:56065): WARNING **: 12:41:52.466: keypress keyval: 65507 keycode: 37 state: 0
[ 709668.397] wl_keyboard@30.key(2192, 4949891, 29, 0)
[ 709668.438] wl_keyboard@30.modifiers(2193, 0, 0, 0, 0) <---- release control
** (test:56065): WARNING **: 12:41:52.576: modifiers state: 4 <--- gtk report control change
** (test:56065): WARNING **: 12:41:52.576: keyrelease keyval: 65507 keycode: 37 state: 4
[ 711139.364] wl_keyboard@30.key(2194, 4951362, 125, 1)
[ 711139.397] wl_keyboard@30.modifiers(2195, 64, 0, 0, 0)
** (test:56065): WARNING **: 12:41:54.047: modifiers state: 0 <---- super
** (test:56065): WARNING **: 12:41:54.047: keypress keyval: 65515 keycode: 133 state: 0
[ 712924.793] wl_keyboard@30.key(2196, 4953147, 30, 1) <--- super + a
** (test:56065): WARNING **: 12:41:55.832: keypress keyval: 97 keycode: 38 state: 0
[ 713075.700] wl_keyboard@30.key(2197, 4953298, 30, 0)
** (test:56065): WARNING **: 12:41:55.983: keyrelease keyval: 97 keycode: 38 state: 0
[ 713701.720] wl_keyboard@30.key(2198, 4953924, 125, 0)
[ 713701.799] wl_keyboard@30.modifiers(2199, 0, 0, 0, 0)
** (test:56065): WARNING **: 12:41:56.609: keyrelease keyval: 65515 keycode: 133 state: 0
- super modifier is not set.
Current behavior
super key does not capture any super key modifier change.
Expected outcome
super key modifier is set.
Version information
4.8.2 / 4.6.7
Additional information
Edited by Weng Xuetian