Bug 1227 - GtkEntry::"hildon-input-mode" should default to off
: GtkEntry::"hildon-input-mode" should default to off
Status: RESOLVED WONTFIX
Product: UI Specification
General
: 4.1.2 (4.2008.36-5)
: All Maemo
: Low enhancement (vote)
: ---
Assigned To: Mikko Nurmi
: ui-specification-bugs
:
:
:
:
  Show dependency tree
 
Reported: 2007-04-20 15:05 UTC by Murray Cumming
Modified: 2009-06-19 10:27 UTC (History)
6 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Murray Cumming (reporter) 2007-04-20 15:05:27 UTC
Maemo adds a GtkEntry::"hildon-input-mode" property to disallow some characters
and to do auto-capitalization. This feature should not be on by default, but at
least HILDON_GTK_INPUT_MODE_AUTOCAP does seem to be used by default somehow.

Actually the source code even hardcodes "9" as the default instead of using the
#defines, which is rather ugly.
Comment 1 Xan López nokia 2007-08-23 15:09:00 UTC
Actually I agree, but I guess this is deeply rooted in our specs. Not sure if
I'll manage to do anything about it, but I'll try.
Comment 2 Kristian Rietveld 2008-02-27 14:42:28 UTC
(In reply to comment #1)
> Actually I agree, but I guess this is deeply rooted in our specs. Not sure if
> I'll manage to do anything about it, but I'll try.

Did you try?  If it's indeed deeply rooted in the specs, this probably won't be
fixed any time soon ...
Comment 3 Andre Klapper maemo.org 2008-06-06 17:46:33 UTC
reassigning Tommi's bugs to Rodrigo.
Comment 4 Andre Klapper maemo.org 2008-11-24 14:59:12 UTC
Murray: Which exact source file does hardcode the value to 9?

(WONTFIX for Diablo.)
Comment 5 Murray Cumming (reporter) 2008-11-24 15:10:44 UTC
(In reply to comment #4)
> Murray: Which exact source file does hardcode the value to 9?

I don't know. I can't find it now. I assume it was in gtkentry.c, though I
can't find any relevant change in svn:
https://stage.maemo.org/viewcvs.cgi/projects/haf/trunk/gtk%2B/gtk/gtkentry.c?root=maemo&view=log

Anyway, the very bad default is still there:

  /**
   * GtkEntry:hildon-input-mode:
   *
   * Allowed characters and input mode for the entry. See #HildonGtkInputMode.
   *
   * Since: maemo 2.0
   * Stability: Unstable
   **/
  g_object_class_install_property (gobject_class,
                                   PROP_HILDON_INPUT_MODE,
                                   g_param_spec_flags ("hildon-input-mode",
                                                       P_("Hildon input mode"),
                                                       P_("Define widget's
input mode"),
                                                      
HILDON_TYPE_GTK_INPUT_MODE,
                                                      
HILDON_GTK_INPUT_MODE_FULL |
                                                      
HILDON_GTK_INPUT_MODE_AUTOCAP |
                                                      
HILDON_GTK_INPUT_MODE_DICTIONARY,
                                                       GTK_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
Comment 6 Murray Cumming (reporter) 2008-11-24 15:11:50 UTC
And I would be surprised if any specs say what the defaults for the widget
should be. I think it's more likely that the specs say what the behaviour
should be for specific uses of widgets in specific parts of specific
applications.
Comment 7 Andre Klapper maemo.org 2008-11-24 15:22:48 UTC
Yepp, correct file - found it in
https://stage.maemo.org/svn/maemo/projects/haf/branches/gtk+/maemo-gtk-2-6/gtk/gtkentry.c
:

  /**
   * GtkEntry:input-mode:
   * Allowed characters for the entry, specified by HILDON_INPUT_MODE_HINT_*
   * Since: maemo 1.0
   * @Deprecated: Use hildon-input-mode instead.
   **/
  g_object_class_install_property (gobject_class,
                      PROP_INPUT_MODE,
                      g_param_spec_int ("input-mode",
                                  P_("input mode"),
                                  P_("Define widget's input mode"),
                                  0,
                                  9, /* keep me updated */
                                  0,
                                  GTK_PARAM_READABLE | GTK_PARAM_WRITABLE));
Comment 8 Andre Klapper maemo.org 2008-11-24 20:19:27 UTC
It's actually not THAT deeply rooted in the Text Input Spec.

To clarify the current state:
The option to determine whether auto-capitalization is on or off is a property
of the widgets. The default setting for the text input widgets is "on".
Application developers must set this property to be suitable to the occasion.


I currently see this as an enhancement request.
If it's not, please convince me. ;-)
Comment 9 Roope Rainisto nokia 2008-11-27 10:08:13 UTC
Sorry, why should this feature be on by default?
Comment 10 Andre Klapper maemo.org 2008-11-27 12:43:33 UTC
(In reply to comment #9)
> Sorry, why should this feature be on by default? 

I certainly won't advocate that - I just can't judge which usecase
(autocapitalize or not) happens more often, so I hoped the current default
value was chosen with a reason.
Comment 11 Andre Klapper maemo.org 2009-02-20 19:50:07 UTC
Roope: If it is not planned to change the default setting, and if the default
setting has been chosen with a reason, should we close this as WONTFIX?
Comment 12 Roope Rainisto nokia 2009-02-23 09:55:38 UTC
Yes - if this hasn't been changed for Fremantle. I'm no longer doing text input
specs, so ... let's check them. Yes, it's still on. I would say wontfix. It was
set on by default because ... well, it's easy for developers to notice if they
want it to be off. If auto-capitalization would be off by default, then some
developers would perhaps miss to turn it on. (Well, it's a weak reason, but
anyway.)
Comment 13 Murray Cumming (reporter) 2009-02-23 10:51:56 UTC
I am disappointed that this was closed with no rationale for why the bad
default must be the default or why this obstacle to porting is not documented
in a porting guide.
Comment 14 Andre Klapper maemo.org 2009-02-23 11:52:35 UTC
Documenting it would be worth a separate bug report, yes.
Comment 15 Roope Rainisto nokia 2009-02-27 12:23:54 UTC
For the default issue, changing the default could possibly make us have to
check each of our applications (all the views) to see whether the change would
set the auto-cap to be off when we still want it to be on.
Comment 16 Murray Cumming (reporter) 2009-02-27 13:14:13 UTC
Yes. I think you should do that.

At moment you are instead forcing all applications to unset the default for
most Entries when porting to Maemo.
Comment 17 Eero Tamminen nokia 2009-03-09 19:40:30 UTC
(In reply to comment #16)
> Yes. I think you should do that.
> 
> At moment you are instead forcing all applications to unset the default for
> most Entries when porting to Maemo.

Isn't autocap useful/non-harmful in most entries?   I think it's mostly an
issue only to password entries (earlier there was a separate widget for those
which set autocap off).
Comment 18 Murray Cumming (reporter) 2009-03-09 22:36:44 UTC
(In reply to comment #17)
> Isn't autocap useful/non-harmful in most entries?   I think it's mostly an
> issue only to password entries (earlier there was a separate widget for those
> which set autocap off).

I think it's annoying and unexpected for most uses of GtkEntry, because
GtkEntry is typically not used for whole sentences - GtkTextEntry would be used
for that.

If you really thought it was a good idea, I think you'd be suggesting it for
regular upstream GTK+.
Comment 19 Murray Cumming (reporter) 2009-06-19 10:27:57 UTC
(In reply to comment #18)
> GtkTextEntry would be used for that.

I mean GtkTextView, of course.