GtkEntry undo undoes things I never did
Steps to reproduce
- In software, create a GtkEntry, and set its text to "abcde". For example, in gtk-4-demo's
do_entry_undo
, add the line:gtk_editable_set_text(GTK_EDITABLE(entry), "abcde");
near the bottom, somewhere after theentry = gtk_entry_new ();
line. - Run the program, and click on the right side to put the cursor after the "e". Type some more letters, like "fgh".
- Press control-Z.
Current behavior
Pressing control-Z makes the entire GtkEntry go blank. In fact, even if I didn't type any new text, pressing control-Z makes it go blank.
Also, even if gtk_editable_set_editable
was used to make it non-editable, the user can press control-Z to make it go blank.
Expected outcome
The GtkEntry should undo only the change which the user performed, i.e., it should go back to "abcde". Similarly, if the user didn't type any new text, pressing control-Z should do nothing at all.
When the entry box is in the "non-editable" state, undo/redo shouldn't do anything.
Version information
I'm using Debian sid/unstable, with X11 ("amdgpu"). I'm using the system GTK, which is version 4.8.3.
Additional information
Undo in GtkEntry seems to be a relatively new feature: #1690 (closed).
Someone on IRC suggested setting the entry's (GtkEditable) text versus appending to the text's buffer directly, but that made no difference.