I'm submitting this fast-track with Solaris minor binding, scheduled to
timeout at 09/18/2009. I think the one pager explains the case for a 
re-integration of this library. API info is put into materials directory.

Thanks,
Suresh

Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
         libxklavier re-integration
    1.2. Name of Document Author/Supplier:
         Author:  Suresh Chandrasekharan
    1.3  Date of This Document:
        10 September, 2009
4. Technical Description
2. Project Summary
   2.1. Project Description:
        
        X keyboard extension or XKB extends the ability to control
        the keyboard over what is offered by the X Window System core
        protocol.  libxklavier, which's a utility library to make working
        with XKB easier. We need this library for providing keyboard
        selection support at GDM and for gnome keyboard switching 
        mechanism in the gnome desktop.

        This one pager proposes re-integration of this library to
        OpenSolaris 2010.02

   2.2. Risks and Assumptions:
                
                Solaris libxklavier and the dependent functionality of
        gnome keyboard switching was enabled in S10 timeframe and
        was later removed due to many customer complains of this
        functionality not working as expected.

        libxklavier is only extensively tested with Xorg based X
        servers. Does not work well with Xsun. Also does not work with
        remote displays.
        
        Sparc Nevada systems which still have Xsun as the default
        xserver will be EOLed soon. We are not planning to port
        this to S10 updates. So the case for supporting Xsun based
        servers directly is weaker than before.

        Keyboard switching functionality was tested on Sunrays having
        Xnewt xserver (derived from Xorg codebase) and found to be
        working well.

        For more information, look into the technical discussion of the
        project in Section 4.1

3. Business Summary
        
   3.1. Problem Area:

        OpenSolaris marketing requires to modernize the input method
        framework in the OpenSolaris PCD (INT-3 - Ensure maximum
        compatibility with Linux based offerings in the area of input
        methods and keyboard support.)

        G11N is planning on transitioning the input method framework
        from iiimf to ibus in OpenSolaris Next. Though ibus is a modern
        input method framework with large community following, the 
        support for European input method is weak without the ability
        to select the many available keyboard layouts using gnome
        keyboard switcher.

        Another requirement to have libxklavier delivered stems from
        an effort to enhance LiveCD experience by providing the 
        keyboard/language selection in GDM screen. This also requires
        libxklavier bindings.

   3.2. Market/Requester:
        OpenSolaris Marketing

   3.3. Business Justification:

        Needed for OpenSolaris modernization effort. LiveCD 
        modernization and input method framework change from
        iiimf to ibus depends on this.

   3.4. Competitive Analysis:
        All the Linux distros which have Gnome as their desktop includes
        libxklavier.

   3.5. Opportunity Window/Exposure:
        OpenSolaris 2010.02, gnome-2.28

   3.6. How will you know when you are done?:

        When libxklavier is integrated to OpenSolaris without any 
        P1/P2 open bugs at the time of integration.

4. Technical Description:
    4.1. Details:

        libxklavier is slightly controversial, but a very useful
        library for keyboard swtiching.

        libxklavier was integrated to Solaris in S10 timeframe, which
        was removed later due to many complaints of the keyboard switching
        functionality not working as expected.

        From http://sac.sfbay/LSARC/2005/734/opinion.txt

        ........

        4.8 libxklavier

             libxklavier uses private XKB configuration files [22] that
             are not safe to use, so if a user has a non-standard Xserver
             or if a user is remote logged into a computer running a
             different Xserver, keyboard switching will break.  However,
             many users who are use a supported Xserver obviously find
             the ability to switch keyboard layout very useful.

             "LSARC 2004/576 libxkbfile update for GNOME 2.6" discusses
             the fact that Sun is now exposing the X header files used
             by libxklavier, but this case does not highlight the fact
             that this interface is considered private and unsupported
             by X.org.  Nor does this case discuss the issues caused by
             using this interface discussed in this section.

             The project team is Advised to drive resolution on this issue
             with the community.  The Xorg team is currently working on
             a more Stable solution which the GNOME team should adopt
             when it becomes available.

             The project team is Advised to work with the Xorg Sun team
             and the external Xorg and GNOME communities to facilitate
             this work.  The committee recommends that the Sun GNOME
             team facilitate the adoption of a more stable interface to
             support libxklavier functionality.

        ........

        There has not been much progress in removing the limitations of
        libxklavier in the community even after more than 4 years has
        passed since the above case. Even though there are limitations
        the advantages also seems to be too attractive to let this pass.
        So the project team is planning to integrate this to OS 2010.02.

        We currently have more than 460 keyboard layouts from the
        community in OpenSolaris which needs libxklavier for accessing
        them dynamically.

        We looked in to the various issues filed which resulted in gnome
        keyboard switcher mechanism and associated base library removal
        and found that these are the major issues.
        
        1. libxklavier does not work when XKB is disabled
        2. libxklavier not work on Xsun
        3. libxklavier does not work on remote displays
        4. libxklavier uses private functions provided in libxkbfile library

        All the above reported issues are right, they resulted from
        the following broader issues

        1. lack of adequate patches to fix/mask some of the issues 
           happening when XKB is disabled, Xsun is xserver and when
           remote Xservers was employed..

        2. lack of a opportunistic mechanism like dlopen/dlsym
           based loading of the libxklavier library APIs

        We think that through a combination of the above we can
        harness the power of libxklavier without succumbing to 
        it's limitations.

        For integration of the dependent functionality on libxklavier,
        the project team advices the future projects based on libxklavier 
        to follow a 'do no harm' policy. (in our knowledge only gnome
        keyboard switching and keyboard selection support at gdm are the 
        only 2 projects depending on this library however). This means
        we need to mask the dependent functionality or provide patches 
        in cases where it does not work well.
        
        Following are the issues and the solutions we foresee.

        1. libxklavier does not work when XKB is disabled

                libxklavier supports xkb and xmodmap through the use of
           a compiler flag. When compiled with the default 
           "--enable-xkb-support" and if XKB is disabled in Xserver
           keyboard switching does not work. 
           
           Advices project teams to tackle this by masking the keyboard
           switching functionality in case we find XKB extension is
           disabled in Xserver.
                
        2. libxklavier does not work on Xsun

                We are no longer constrained by Xsun as

                i. We are not porting this library into S10 updates
                   where we still support Xsun Xserver
               ii. OpenSolaris Xserver is based of Xorg, for both sparc/x86
                   Xsun is being EOFed.
              iii. Nevada sparc is still Xsun, which will go away soon by the
                   time this project is integrated. Even if it won't we will
                   make sure keyboard switching is not enabled in Nevada 
                   sparc systems
               iv. Sunray Xserver is Xnewt which is based on Xorg codebase
                   primary test results of the test packages of 
                   keyboard switching in Sunray seems to work fine.

        3. libxklavier does not work on remote displays
        
                libxklavier ignores the X-Window client-server model
                and only reads the keyboard configuration files in the
                client, not the xserver.

                It's the current design limitation of the library
                and a general limitation of X (and a security issue) when a
                X client is displayed on a remote server, there is
                no Xlib/XKB api's which will query for and read the
                XML configuration files in the server from the client side.
                Currently due to this issue the keyboard configuration 
                will be read from the client machine only. If server and client
                is in the same machine, this works, otherwise this does not
                unless the client and server machines are of identical
                Xorg based configurations.

                Disable keyboard switching functionality when the display
                is remote is the solution.

        4. libxklavier uses private functions provided in libxkbfile library

                This is one of the long standing pain point and the reason
                for libxklavier not tested and fixed in non-Xorg Xserver
                like Xsun. libxkbfile is a private library used by
                Xserver and some configuration utilities which never was
                supposed to be used by others. libxklavier uses some of
                the private APIs in libxkbfile.

                Though 'private APIs from library libxkbfile' does not
                seems to be right as LSARC/2004/576 gives 'External'
                classification to libxkbfile and the associated headers,
                which's not a private classification. Eventhough
                libxkbfile originally was supposed to be a private
                interface, it's not currently.
                
                Gnome keyboard switching is used by heavily the community
                and any change in the libxkbfile will cause an issue in
                libxklavier used by linux communities and will be fixed,
                we don't see this as a big enough issue which force us
                not to use gnome keyboard switching functionality.
        
        In addition to the above, project team is advicing future
        consumers of libxklavier to opportunistically load the library
        and APIs using dlopen/dlsym calls, instead of accessing the
        library directly so that the associated functionality can be
        disabled by either using an appropriate environment variable
        or by removing libxklavier from the system in case of any 
        potential issues.

        We are planning to bundle libxklavier 4.0 version with gnome 2.28

        libxklavier will be delivered in SUNWlibxklavier
        
    4.2. Bug/RFE Number(s):

         6868433 Add gnome keyboard switcher
    
    4.3. In Scope:
         None

    4.4. Out of Scope:
         None

    4.5. Interfaces:

        Imported Interfaces
        -------------------

        Interface                               Stability       Notes
        ---------                               ---------       -----

        From LSARC/2004/576/

        /usr/X11/lib/libxkbfile.so.5            External        X.Org open 
source implementation
        XKB*.h headers                          External        X.Org open 
source implementation

        Exported Interfaces
        -------------------

        SUNWlibxklavier
                /usr/lib/libxklavier.so.15.0.0  Volatile        library
                /usr/lib/libxklavier.so.15      Volatile        sym link 
                /usr/lib/libxklavier.so         Volatile        sym link

        SUNWlibxklavier-devel
                /usr/include/libxklavier/xkl-enum-types.h       Volatile   
Header File
                /usr/include/libxklavier/xkl_config_item.h      Volatile   
Header File
                /usr/include/libxklavier/xkl_config_rec.h       Volatile   
Header File
                /usr/include/libxklavier/xkl_config_registry.h  Volatile   
Header File
                /usr/include/libxklavier/xkl_engine.h           Volatile   
Header File
                /usr/include/libxklavier/xkl_engine_marshal.h   Volatile   
Header File
                /usr/include/libxklavier/xklavier.h             Volatile   
Header File

    4.6. Doc Impact:
        Documentation is provided with the SUNWlibxklavier-devel package, 
included in
        materials directory

6. Resources and Schedule
    6.4. Steering Committee requested information
        6.4.1. Consolidation C-team Name:
                G11N
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open

Reply via email to