GNOME Bugzilla – Bug 657613
GtkEntry hides placeholder text when focused
Last modified: 2011-09-02 04:36:59 UTC
GtkEntry allows predefined text to be displayed in the field to give instructions to users. Search fields can include the text 'Search...' for example. This text is hidden when the text is focused. Hiding the predefined text is undesirable in some situations, however. When a GtkEntry widget is focused by default, the user will never see the text it includes. We encountered this problem with GNOME Contacts - the contact name field is automatically focused when a new contact is created, yet users will never see the 'Enter contact name...' text that is supposed to be displayed there.
This is just one of the reasons why the entire placeholder text concept is problematic. I only accepted this into GTK+ because people are used to this kind of crap from web uis
I'd actually close this as NOTABUG: the Entry is behaving exactly as requested. the aforementioned web UIs work because they don't assign focus to the entries. the toolkit cannot really have API to say "please focus this widget but don't really because we want to do $FOO". in this specific case, you can avoid setting the focus and attach a key-press-event signal handler and on the first key press redirect the focus to the entry and push the pressed key inside the widget - which is kind of what happens in the Shell (with the exception that the shell is just using a capture to re-assign the focus and doesn't need to push the key to the entry).
Lets keep this bug open for now, to maybe add a note about this to the ::placeholder-text docs
Added a note