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 155917 - gnome-session should set the env variable GTK_MODULES for a11y
gnome-session should set the env variable GTK_MODULES for a11y
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
git master
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
AP1
Depends on:
Blocks:
 
 
Reported: 2004-10-20 07:30 UTC by Muktha
Modified: 2006-01-10 00:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (392 bytes, patch)
2004-10-20 07:34 UTC, Muktha
none Details | Review
Modified the patch so as not to override the env variable (775 bytes, patch)
2004-10-30 05:25 UTC, Muktha
needs-work Details | Review
Patch fixes the bug (3.05 KB, patch)
2005-03-17 14:19 UTC, Muktha
needs-work Details | Review
Modified patch (3.74 KB, patch)
2005-11-23 04:33 UTC, Muktha
accepted-commit_now Details | Review

Description Muktha 2004-10-20 07:30:11 UTC
Currently, non gnome based gtk apps will not load the a11y libraries (gail,
atk-bridge). In order to get the accessible info from such apps, the user needs
to export the GTK_MODULES env variable from command line and then start the app. 

However, this should be done automatically at login if the accessibility key
(/desktop/gnome/interface/accessibility) is turned on. The user should not be
expected to set the env variable explicitly.
Comment 1 Muktha 2004-10-20 07:33:19 UTC
Attaching a patch which exports GTK_MODULES to gail:atk-bridge if the
accessibility key is turned on, while starting gnome-session.
Comment 2 Muktha 2004-10-20 07:34:17 UTC
Created attachment 32816 [details] [review]
Proposed patch
Comment 3 Calum Benson 2004-10-21 16:10:19 UTC
Marking AP1 to reflect accessibility impact.
Comment 4 Calum Benson 2004-10-21 16:41:08 UTC
Apologies for spam-- ensuring Sun a11y team are cc'ed on all current a11y bugs.
 Filter on "SUN A11Y SPAM" to ignore.
Comment 5 Muktha 2004-10-30 05:25:12 UTC
Created attachment 33238 [details] [review]
Modified the patch so as not to override the env variable
Comment 6 Muktha 2005-01-05 06:34:04 UTC
Mark: ok to commit?
Comment 7 Federico Mena Quintero 2005-03-07 19:20:43 UTC
Do we actually need this?  See bug #117236 for a more dynamic way of doing
things.  GTK+ supports an XSETTING via which you can tell running apps to load
accessibility modules.
Comment 8 bill.haneman 2005-03-07 22:01:04 UTC
We do need this, as far as I can tell.   But I still don't see how the approach
in 117236 works, i.e. I don't think it's actually 
Comment 9 bill.haneman 2005-03-07 22:01:52 UTC
... don't think it's compatible with our current solution which is to set
GTK_MODULES.  We need to retain compatibility with that previous solution.

Comment 10 bill.haneman 2005-03-07 22:08:12 UTC
Federico, you marked the patch 'needs work' but failed to explain your specific
issues with the patch... ;-)
Comment 11 Muktha 2005-03-17 14:19:26 UTC
Created attachment 38850 [details] [review]
Patch fixes the bug

modifiying the previous patch. moved the setting of the env variable before
gnome_program_init() so that b-a-s also gets it. solves issues raised in bug
#166534
Comment 12 Muktha 2005-03-17 14:21:55 UTC
leaving the patch in needs-work state based on Fedrico's previous comment, but
would like it to expanded to specifics in case we should be fixing in that approach.
Comment 13 bill.haneman 2005-10-12 08:45:03 UTC
please remove "needs work" as the current patch looks correct to me, it's what
we are using for Sun builds, and as I said in comments #8 through #10, the
XSETTING proposal doesn't maintain compatibility with our existing solution, nor
is it explained how it would work.
Comment 14 bill.haneman 2005-10-12 08:45:57 UTC
Comment on attachment 38850 [details] [review]
Patch fixes the bug

Can this patch please be applied to CVS?  It solves a long-standing
accessibility issue with applications which do not use gnome_program_init.
Comment 15 Mike Pedersen 2005-11-02 16:06:38 UTC
As a user of access technologies as well as someone working on access 
technology for the gnome desktop I'm finding this issue to be quite 
frustrating.  It would be great if this patch could be applied as it would mean 
one less thing a blind person has to fight with when trying to get up and 
running with a new install.  
Comment 16 Federico Mena Quintero 2005-11-14 21:32:36 UTC
OK, I'm confused.

- If I enable a11y in GNOME, restart my session, and run a gtk-only app that
doesn't use gnome_program_init(), will my app be a11y-enabled?

- Does Muktha's patch fix that?

- Or is your patch only for GTK+ stuff that gets launched through
bonobo-activation-server?

- Can this be done without setting an env. var. in gnome-session, but solely
with the XSETTING that was added?

- If so, is gnome-settings-daemon not turning on that setting or something?
Comment 17 Mark McLoughlin 2005-11-15 08:48:43 UTC
> - If I enable a11y in GNOME, restart my session, and run a gtk-only app that
>   doesn't use gnome_program_init(), will my app be a11y-enabled?

I don't think so

> - Does Muktha's patch fix that?

I think so

> - Or is your patch only for GTK+ stuff that gets launched through
>   bonobo-activation-server?

No, its for all apps not using gnome_program_init()

> - Can this be done without setting an env. var. in gnome-session, but solely
>   with the XSETTING that was added?

The "Gtk/Modules" XSETTING ?

I think we could do it this way, but my worry is that these modules would have
to be loaded at the very start of each program because we can't handle
gtk_widget_get_accessible() returning NULL at one point in the program and
returning an AtkObject later.

I'm not even sure what would happen if you loaded the a11y modules into a
running app ...

> - If so, is gnome-settings-daemon not turning on that setting or something?

So, we could do it in g-s-d, but we'd need to be confident that a) the XSETTING
would be set before any apps are launched and b) that apps don't get hosed if we
change the XSETTING while they are running.

If we did it this way, we could probably get rid of the a11y stuff in
gnome_program_init() too ...

Also, right now g-s-d only runs per-user, per-machine rather than per-display
(bug #94049) so a11y wouldn't work on multi-display systems. Now would be a good
time to fix that.



As far as patch review goes:

  - Why are you doing this before gnome_program_init() ? gnome-session doesn't
    need to load the a11y modules this way because its done in 
    gnome_program_init(), right?

  - Why aren't we loading the "gail-gnome" module? Is the idea that if the
    app doesn't use gnome_program_init(), it musn't be using Bonobo controls?

  - Move the code for setting GTK_MODULES into gsm-at.c into a function like:

void
gsm_at_set_gtk_modules (void)
{

  GSList      *modules_list;
  GSList      *l;
  const char  *old;
  char       **modules;
  char        *new;
  gboolean     found_gail;
  gboolean     found_atk_bridge;
  int          n;

  n                = 0;
  modules_list     = NULL;
  found_gail       = FALSE;
  found_atk_bridge = FALSE;

  if ((old = g_getenv ("GTK_MODULES")) != NULL)
    {
      modules = g_strsplit (old, ":", -1);
      for (n = 0; modules[n]; n++)
        {
          if (!strcmp (modules[i], "gail"))
            found_gail = TRUE;
          else if (!strcmp (modules[i], "atk_bridge"))
            found_atk_bridge = TRUE;

          modules_list = g_slist_prepend (modules_list, modules[n]);
          modules[n] = NULL;
        }

      g_free (modules);
    }

  if (!found_gail)
    {
      modules_list = g_slist_prepend (modules_list, "gail");
      ++n;
    }

  if (!found_atk_bridge)
    {
      modules_list = g_slist_prepend (modules_list, "atk-bridge");
      ++n;
    }

  modules = g_new (char *, n + 1);
  modules[n--] = NULL;
  for (l = modules_list; l; l = l->next)
    modules[n--] = l->data;

  g_setenv ("GTK_MODULES", 
            g_strjoinv (":", modules),
            TRUE);

  g_strfreev (modules);
  g_slist_free (modules_list);
}

  - and then put

  if (a_t_support)
    gsm_at_set_gtk_modules ();

    just before gsm_gsd_start ();
Comment 18 bill.haneman 2005-11-15 14:23:08 UTC
Thanks Mark:

>> - If I enable a11y in GNOME, restart my session, and run a gtk-only app that
>>   doesn't use gnome_program_init(), will my app be a11y-enabled?

>I don't think so

Correct.

>> - Does Muktha's patch fix that?

>I think so

Yes.
...

>I'm not even sure what would happen if you loaded the a11y modules into a
>running app ...

Probably not what you would want.  ATM a11y isn't dynamically loadable, sorry,
that's a good RFE.

Sounds like you (Mark) have a very good handle on the issues.
...
>
>  - Why aren't we loading the "gail-gnome" module? Is the idea that if the
>    app doesn't use gnome_program_init(), it musn't be using Bonobo controls?

Yes.  AFAIK this is currently true of all Bonobofied apps.  
Comment 19 Muktha 2005-11-23 04:32:32 UTC
Hi Mark,

1. The file gsm-at.c is not present in the gnome-session sources. Hence I have 
   put the code which sets the GTK_MODULES into gsm-at-startup.c. I guess you 
   meant the same file.

2. By the time gnome_program_init() is over in gnome-session the b-a-s is  
   started and does not have the GTK_MODULES. Hence any gtk apps that get 
   invoked by the applets are not accessible (#166534). So I have moved the env 
   setting before gnome_program_init() in gnome-session. 
   Please let know if I am missing something.

I'm attaching the modified patch.
Comment 20 Muktha 2005-11-23 04:33:45 UTC
Created attachment 55130 [details] [review]
Modified patch
Comment 21 Federico Mena Quintero 2006-01-09 20:58:58 UTC
Please go ahead and commit the patch in comment #20.
Comment 22 Kjartan Maraas 2006-01-10 00:48:27 UTC
I commited this.