Undo/redo should work in GtkEntry by default
This problem was first found in Geary geary#233 (closed) It seems that GTK doesn't set common shortcuts such as Ctrl+z for GtkEntry by default, which must cripple a user experience for all apps written in the toolkit.
Steps to reproduce
-
Create files
test.cpp
andtest.glade
as follows: test.cpp:#include <gtk/gtk.h> int main(int argc, char** argv) { GtkBuilder *builder; GtkWidget *window; gtk_init(&argc, &argv); builder = gtk_builder_new(); gtk_builder_add_from_file (builder, "test.glade", NULL); window = GTK_WIDGET(gtk_builder_get_object(builder, "window_main")); gtk_builder_connect_signals(builder, NULL); g_object_unref(builder); gtk_widget_show(window); gtk_main(); return 0; }
test.glade:
<?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.22.1 --> <interface> <requires lib="gtk+" version="3.20"/> <object class="GtkWindow" id="window_main"> <property name="can_focus">False</property> <child> <placeholder/> </child> <child> <object class="GtkEntry"> <property name="visible">True</property> <property name="can_focus">True</property> </object> </child> </object> </interface>
-
Execute
g++ test.cpp -o a $(pkg-config --cflags --libs gtk+-3.0)
-
Execute
./a
(a window with GtkEntry widget should pop up) -
Type in appeared window
test
-
Press Ctrl+z
Expected
test
text should disappear
Actual
Nothing happens.