Re: UI change of "Languge" selection in gdm2



Hi Bob,

> 
> Chookij Vanatham wrote:
> 
> >Hi Bob,
> >>
> >It affects only "current display". That means only "greeter" process
> >of current display will be changed (re-forked).
> >
> >"gdm2 slave process" will restart only greeter process in different
> > language. There is nothing changed to "gdm2 master process". It won't die.
> >"gdm2 slave process" which takes care of current display (for X, greeter)
> >won't be restarted (re-forked).
> >  
> Even after somebody logs in/out?
That's correct.


> 
> >Basically, greeter sends "message" as part of protocol to gdm2 slave process
> >to tell "gdm2 slave" to restart the new greeter process with the new
> >language passed through protocol. "gdm2 slave" process won't be restarted
> >but gdm2 slave, itself, will need to change its own current locale to
> >the new one.
> >
> This information is never stored to disk and re-used in future 
> instantiations, as it is in dtlogin?
>
Nop. There is no information stored to disk as it does in dtlogin.

Here is an exact coding doing this.
Basically, greeter pass "string" which is in the form of
STX BEL GDM_INTERRUPT_REFRESH_GREETER <locale> to "gdm2 slave process"
through PIPE as shown below.

gui/greeter_action_language.c
-----------------------------
void
greeter_action_language () {
...
    case GTK_RESPONSE_OK:
      if (dialog_selected_language) {
          current_language = g_strdup (dialog_selected_language);
          tmp = ve_locale_to_utf8 (current_language);
          printf ("%c%c%c%s\n", STX, BEL,
                    GDM_INTERRUPT_REFRESH_GREETER, tmp);
          fflush(stdout);
          g_free(tmp);
      }
      break;
...
}

On the gdm2 slave process, when it gets the "string", it will
extract <locale> from the string and set itself to the new locale
(as ve_setenv (LC_ALL, <locale>)) and turn the flag "do_restart_greeter"
on to refork the new greeter with the new locale as shown below.

slave.c
-------
static gboolean
check_for_interruption (const char *msg) {
...
    case GDM_INTERRUPT_REFRESH_GREETER:
            ve_setenv ("LANG", &msg[2], TRUE); 
            ve_setenv ("LC_ALL", &msg[2], TRUE);
            ve_setenv ("LC_CTYPE", &msg[2], TRUE);
            ve_setenv ("LC_NUMERIC", &msg[2], TRUE);
            ve_setenv ("LC_TIME", &msg[2], TRUE);
            ve_setenv ("LC_COLLATE", &msg[2], TRUE);
            ve_setenv ("LC_MONETARY", &msg[2], TRUE);
            ve_setenv ("LC_MESSAGES", &msg[2], TRUE);
            do_restart_greeter = TRUE;
            break;
...
}

That's why we don't need to store this information into disk.


Chooki V.

> 
> Thanks,
>    Bob
> 
> >(Bugzilla id: 108820 explaines exact detail of change (which is little)
> > for the protocol added between greeter and gdm2 slave process)
> >
> >  
> >
> >>Does it affect future sessions on the current display?
> >>
> >>    
> >>
> >No. "greeter language" is basically for locale/languge of greeter.
> >Nothing related to "users sessions".
> >There is only one thing at the choice of users' session will effect.
> >At the entry "Default" language for users's session will mean
> >the same lanugage as "greeter language".
> >
> >Chookij V.
> >
> >
> >  
> >
> >>-Bob
> >>
> >>Chookij Vanatham wrote:
> >>
> >>    
> >>
> >>>Hi George,
> >>>
> >>>I have been working on enhancement of "Language" selection in gdm2
> >>>(bugzilla id: 108820) and I have got some snapshots of UI
> >>>change. I'd like to ask help to review the UI change and any feedback
> >>>would be really appreciated to get this work done.
> >>>
> >>>Here are the reasons of UI change.
> >>>
> >>>1) Once gdm2 starts up, there is NO-WAY to switch its greeter GUIs
> >>>  to any other languages without restarting gdm2 with the new
> >>>  languages/locales (before users loggining to the system).
> >>>2) "Language" menu at greeter is using for the case when users want
> >>>  to have their own sessions running in different languages(locales)
> >>>  other than the language (locales) specified in ~/.dmrc user
> >>>  configuration file and also, greeter doesn't restart/refresh GUI
> >>>  to be displayed in that particular language on the fly.
> >>>
> >>>  Ex:  ~/.dmrc
> >>>       [Desktop]
> >>>       Session=gnome.desktop
> >>>       Language=ja_JP.SJIS
> >>>
> >>>   In CDE, dtlogin/dtgreeter has the same feature but, dtgreeter
> >>>   is also restarted/refreshed on the fly when users select new
> >>>   language from "language" menu, even the language selected is
> >>>   actually using for users's own session after users's logging-in.
> >>>
> >>>   I'd like to point out that this behavior in dtlogin/dtgreeter is
> >>>   causing the demand to have gdm greeter to restart greeter's GUI
> >>>   on the fly after selecting new language. The point is that,
> >>>   actually, there are two different things which can be applied
> >>>   with "language".
> >>>
> >>>       1) Language applying to greeter (gdmlogin, gdmgreeter)
> >>>       2) Language applying to users' session
> >>>
> >>>   Another word is that "Language" menu GUI is a little bit easier
> >>>   to confuse users' behavior between greeter's GUI and users'
> >>>   session GUI.
> >>>
> >>>Here are the list of UI change (feature changed/added).
> >>>
> >>>1) Language selection for log-in screen (greeter) and users's session
> >>>  is seperated at the "Language" menu which will have 2 options,
> >>>  "Greeter Language" and "Users' session Language".
> >>>
> >>>  Attached snapshots:
> >>>  o gdmgreeter_lang_stock_button_action.jpeg.gz
> >>>    When "Language" stock button clicked, there will be the
> >>>    pop-up window for users to select if language is for greeter
> >>>    or for user's session.
> >>>
> >>>2) "Greeter Language" will restart log-in screen in new language
> >>>   selected.
> >>>
> >>>  Attached snapshots:
> >>>  o gdmlogin_greeter_lang.jpeg.gz
> >>>    When selected, gdmlogin will be restarted to the new language
> >>>    selected. There are no "Last" and "System Default" entries.
> >>>  o gdmgreeter_lang.jpeg.gz
> >>>    If user chooses language for greeter, language selection window
> >>>    will be pop-uped. There are no "Last" and "System Default"
> >>>    entries. After new language selected and "Ok" button clicked,
> >>>    gdmgreeter will be restarted with new language.
> >>>
> >>>3) "Users' session Language" will have the new extra pop-up sub-menu
> >>>  for experience users to select their preference of "character set"
> >>>  they want for their session, otherwise, gdm2 will assign the
> >>>  default character set associated with language users select for
> >>>  their session.
> >>>
> >>>  Attached snapshots:
> >>>  o gdmlogin_usr_sess_lang.jpeg.gz
> >>>    When selected, gdmlogin will use the language selected for
> >>>    user's session. gdmlogin won't be restarted.
> >>>    There are "Last" and "System Default" entries.
> >>>  o gdmlogin_usr_sess_charset.jpeg.gz
> >>>    User can choose "character set @ modifier" for particurlar
> >>>    language selected for user's session, otherwise "character
> >>>    set @ modifier" will be default (according to
> >>>    /etc/X11/gdm/locale.alias)
> >>>  o gdmgreeter_usr_sess_lang.jpeg.gz
> >>>    If user choose language for user's session, language
> >>>    selection window will be pop-uped. There are "Last" and
> >>>    "System Deafult" entries. There is new stock button named
> >>>    "Information" at the dialog. When "Information" stock button
> >>>    clicked, users can change "character set @ modifier" of
> >>>    language selected for user's session.
> >>>  o gdmgreeter_usr_sess_charset.jpeg.gz
> >>>    Users can choose "character set @ modifier" for language
> >>>    used within session.
> >>>
> >>>4) A new tab called "Session Languages" tab is for customizing the
> >>>  default detail information of each language for users's session
> >>>  by super-user through the gdmsetup tool.
> >>>
> >>>  Attached snapshots:
> >>>  o gdmsetup_lang_tab.jpeg.gz
> >>>    This new session language tab is used to change the default
> >>>    "character set @ modifier" for any languages which will be used
> >>>    as the default for users' session if users don't activate
> >>>    "Information" stock button.
> >>>
> >>>Please let me know any suggestion. In the next week or so, I'll
> >>>give you the patch.
> >>>
> >>>PS:
> >>>snapshot.tar.gz contains 8 jpeg files.
> >>>a ./gdmgreeter_lang.jpeg 313K
> >>>a ./gdmgreeter_lang_stock_button_action.jpeg 282K
> >>>a ./gdmgreeter_usr_sess_charset.jpeg 311K
> >>>a ./gdmgreeter_usr_sess_lang.jpeg 308K
> >>>a ./gdmlogin_greeter_lang.jpeg 171K
> >>>a ./gdmlogin_usr_sess_charset.jpeg 69K
> >>>a ./gdmlogin_usr_sess_lang.jpeg 208K
> >>>a ./gdmsetup_lang_tab.jpeg 87K
> >>>
> >>>
> >>>
> >>>Thanks,
> >>>
> >>>Chookij V.
> >>>
> >>> 
> >>>
> >>>      
> >>>
> >>    
> >>
> >
> >
> >  
> >
> 
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]