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 700428 - Default input method should be chosen based on the input language, not the system-wide locale
Default input method should be chosen based on the input language, not the sy...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-05-16 08:39 UTC by Aleksander Morgado
Modified: 2013-08-31 18:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for the issue. (4.94 KB, patch)
2013-05-16 08:43 UTC, Aleksander Morgado
committed Details | Review

Description Aleksander Morgado 2013-05-16 08:39:33 UTC
GTK+ tries to automatically assign the best input module based on the 'system locale'. In the specific case of the IME input method, it will be the default for the whole GTK+ application if the system locale is either Japanese (ja), Korean (ko) or Chinese (zh). Other defaults are equally applicable, e.g. if system locale is Catalan (ca), the special 'Cedilla' input module is chosen.
    
System locale can be changed (e.g. Win7) through the following sequence (reboot required):
  Control Panel
    Region and Language
      Administrative
        Language for non-Unicode Programs
          Change system locale...
    
The problem with this behaviour is that changing the 'default input language' (e.g. from English to Japanese+IME) doesn't affect the GTK+ application. Therefore, I can have an English system locale (where GTK+ will choose Simple IM by default) but then have Japanese+IME as input language (which would expect the IME input method instead).
    
Default input language can be changed (e.g. Win7) through the following sequence (no reboot required):
  System locale can be changed (e.g. Win7) through:
    Control Panel
      Region and Language
        Keyboards and Languages
          Keyboards and other input languages
            Change keyboards...
    
Default input language can also be changed using the language bar directly.
    
So, instead of using the system-wide default locale to decide which input method to use as default, we should better use the input language specified by the user, which may be the same as the system-wide default locale, or different. Following the previous example, with an English system locale and a Japanese+IME input language, the default input method should be IME instead of Simple, which is closer to what's expected by the user.
Comment 1 Aleksander Morgado 2013-05-16 08:43:04 UTC
Created attachment 244378 [details] [review]
Patch for the issue.

The attached patch changes the logic to use the input language to decide which default input method to use. The logic is similar to what is done in other open source projects like the Chromium web browser.

The behaviour is changed so that we decide the default input method only during the program startup; it doesn't follow changes of the input language notified via WM_INPUTLANGCHANGE messages (which could also be done if this change is accepted).
Comment 2 Matthias Clasen 2013-08-13 22:49:53 UTC
Review of attachment 244378 [details] [review]:

looks ok, although I hate to have more ifdefed code spread through gtk