Re: Third-party sessioning requests [was Re: Session Management Proposal]



Ray Strode wrote:

Hi Bill,

One significant issue that we (GNOME Accessibility Team) have had so far is the lack of a clean way to add a 'startup client' from an external app, i.e. a means of requesting that a not-yet-running client be added to subsequent sessions.

So you are saying that certain accessibility programs can only be run
after gnome has been restarted with AT support turned on, so you want a way to say, "Session manager, I've enabled AT support, so next time gnome starts
make sure that a11y program 'foo' also gets started" ?

You should be able to do that by giving each AT program a "queued restart" mode that's only purposes in life are to register with the session manager,
save the current session, then exit.  When the user enables the support
you would just run the program in the "queued restart" mode.

I don't see this as a good solution; it requires and and all programs to
add a special codepath for restart, as opposed to creating a mechanism for
adding a program directly to a session from a third entity.

This is important for bootstrapping of accessibility support; since
assistive technologies are clients which are essential to a user's session, it's difficult or impossible for end-users to carry out the normal "invoke and save session" procedure for configuring a desktop.

Oh, are you saying that some users require accessibility support to use
gnome at all, and so having the "on switch" for accessiblity support only
available to those already using gnome poses a significant barrier for
the aforementioned users.  If so, then are you wanting a way for a user
logged into a console with a screen reader (or whatever) to be able to
turn on a11y support for gnome before it is started for the first time? Unfortunately, there isn't really much a session manager can do in this
case because it won't be running yet.

Frederic was on-the-mark here; most/all desktops currently use some mechanism for specifying 'startup programs' (outside of the existing 'sessioning' mechanism). The full-blown sessioning/save-yourself protocol of course requires client interaction, etc. but this request isn't about saving state, it's just about adding a client to the exec list.

I am saying that we need IMO a standard mechanism for doing this
(i.e. what gnome does with session-manual and KDE does with
autostart) just as we are working on a standard sessioning mechanism.

I have a feeling i'm not understanding your problem right, though. If
that's the case, then if you could provide relevent bug numbers, a mailing
list thread, or a specific scenario, so that I can understand the problem
better that would be great.

Bug numbers?  It's not clear what to log bugs against, though there was a
GNOME bug which I cannot locate at the moment which requested supported
API for adding stuff to startup (session-manual is a hackish solution which
one isn't really encouraged to use as API, it's treated as a private-internal
sort of thing ATM).

Scenario 1:

GNOME assistive technology support dialog wants to allow user to
specify assistive technologies to launch at startup. ATM this is special-cased in gnome-session, and the user has no general ability to specify additional/new ATs, or specify the path to an executable which will invoke the user's desired screenreader, onscreen-keyboard, etc. One would like to allow advanced users
to specify a path and command-line args to a startup assistive technology.

Scenario 2:

User who needs AT such as a screenreader wants to be able to
start GNOME with the AT running.  There's a bootstrapping problem here,
so user needs to run some utility, script, or command-line program which
adds an AT to the startup list (as above) prior to first running GNOME, or
perhaps from a terminal session while a GNOME setting is running on another
console/tty.

In scenario 2, it'd be nice to be able to do this without the session manager running, but not strictly necessary since if the user has access to their login session at all, they probably can access a shell while GNOME is running. i.e. in scenario 2, user logs into desktop (which they can't use yet, but they can
start the GNOME/KDE session), then invokes some client/CLI from another
tty/console which adds the specified AT to their user startup profile. User can
then log out of GNOME remotely (maybe by invoking a logout
script) and when they log back in, their AT should get started.

There will be ATs (and other programs!) that don't use the session-client stuff yet,
requiring them to not only be fully session-aware but also include a 'queued
restart' codepath seems like an inefficient way to achieve what's
needed here.  Also, if the AT (accidentally?) quits, using
queued-restart+standard-sessioning looks to me like a problem since the AT
wouldn't get restarted next time (unless we made the ATs always immortal,
which would clearly be bad for testers and shared-sessions,  etc.)

--Ray

------------------------------------------------------------------------

#include <gnome.h>

static void queue_restart (GnomeClient *client)
{
 char *program[] = { "foo" };

/* Restart despite the fact program won't be running when session ends */ gnome_client_set_restart_style (client, GNOME_RESTART_ANYWAY);

 /* When the program is restarted, restart it in normal mode instead of
  * this queue-restart mode
  */
gnome_client_set_restart_command (client, 1, program); /* Exit the next time the session manager is saves. */ g_signal_connect (G_OBJECT (client), "save_complete",
                   G_CALLBACK (gtk_main_quit), NULL);

 /* Request save so session manager writes program restart information to
  * disk.
  */
gnome_client_request_save (client, GNOME_SAVE_LOCAL, FALSE, GNOME_INTERACT_NONE, FALSE, TRUE);
}

int main (int argc, char **argv)
{ GnomeClient *client;
 gnome_program_init ("foo", "0.0", LIBGNOMEUI_MODULE, argc, argv, NULL);

 client = gnome_master_client ();

 if (!client)
   return 1;

 if (argc > 1 && !strcmp (argv[1], "--queue-restart"))
   {
     g_print ("Program will be started on next login\n");
     queue_restart (client);

     /* Program is queued for restart on next login; wait until it goes
      * session manager says its done saving.
      */
     gtk_main ();
     return 0;
   }

 /* Normal program operation goes here */
 g_print ("Program is running normally\n");

gnome_client_set_restart_command (client, argc, argv); gtk_main ();
 return 0;
}





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