After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 304178 - GtkEntry selection lost when focused
GtkEntry selection lost when focused
Status: RESOLVED DUPLICATE of bug 68174
Product: gtk+
Classification: Platform
Component: Widget: Other
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-05-14 15:58 UTC by John Ellis
Modified: 2008-10-02 04:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description John Ellis 2005-05-14 15:58:49 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.
Comment 1 Daniel Holbach 2006-04-12 12:25:20 UTC
I think this is a duplicate of 68174
Comment 2 Matthias Clasen 2008-10-02 04:47:19 UTC

*** This bug has been marked as a duplicate of 68174 ***