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

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



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'll attach a program that should demonstrate this using the gnome-client
api. Note the program doesn't handle cancelling the "queued restart" which
is something you will probably need to handle (in case a user enables it
then changes their mind and disables it before they log out).

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.


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.

--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]