GNOME Bugzilla – Bug 304178
GtkEntry selection lost when focused
Last modified: 2008-10-02 04:47:19 UTC
gtk_entry_grab_focus in gtkentry.c does not check if the GtkEntry already has a region of text selected and blindly resets the selection to be all text. For example in my app a GtkEntry is updated to contain a filename, with all but the extension selected with gtk_editable_select_region. But when the user tabs the focus to the entry the act of placing the focus on the entry then selects all the text. To reproduce in gtk-demo, open the clipboard dialog and type some text into the first entry. Then use shift+arrows to select _some_ of the text. Now press tab to cycle the focus back around to that entry - notice your selection is now lost. Yes, I know about 'gtk-entry-select-on-focus', but an existing selection should not be lost regardless of this (user) setting. I propose the 'selection of all text upon focus' behavior should only occur if there is no existing selection.
I think this is a duplicate of 68174
*** This bug has been marked as a duplicate of 68174 ***