Re: Screen saver support patches




Laurent:

I'd like to use GDM to start a screen saver-like program.
This would allow the machine to join a distributed computing
system when the machine is idle.

Currently in GDM one can specify a program using
greeter/BackgroundProgram. There are two shortcomings, however:

- The program is run immediately after GDM is started.

- The program is not restarted after a while when it has exited.

I patched gdmlogin to implement the following features:

- You can specify greeter/BackgroundProgramInitialDelay
  which controls when the program is run after GDM is started.
- You can specify greeter/BackgroundProgramNextDelay
  which controls when the program is restarted after it has
  exited.
Essentially, I use a timeout to start the program when it is
time, and a watcher to detect when the program has exited.
I replaced calls to gdm_run_command(), run_backgrounds(), and
gdm_kill_thingies() with their equivalents in the new API.
The logic of the program did not change much.

The above seems reasonable.

I'm sending diffs against version 2.6.0.8 of gdm. The
integration is not complete. In particular,

- Need to remove backgroundpid, gdm_run_command(),
  run_backgrounds() and gdm_kill_thingies() (commented out).

Please clean up your patches.  Also submit a bug under category
gdm in http://bugzilla.gnome.org and attach your patch there.
Why is it necessary to remove gdm_kill_thingies()

- Must no longer ignore SIGCHLD (commented out).

Why is this necessary?

- Maybe let user specify -1 to disallow restarting?

No, there should be an extra configuration option to turn this
feature on/off.  Much like TimedLoginEnable.

- Documentation for the user.

The patched version works almost correctly on my system, but
there is still one problem. While the program always get
mouse focus, it does not always receive keyboard focus.
Sometimes you can login while the screen saver is running
(the screen saver gets killed, but it should go when the
user is typing).

This problem will need to be corrected before we should apply
the patch, I think.  I'm not sure how to fix this, but perhaps
someone else might have a comment.  You might take a look at
the gdmwm.c file.  GDM uses a light window manager.  It might
be necessary to add some code to tell the window manager to
deal with focus issues.  Perhaps something like
gdm_wm_focus_window is what you need?

Also, you didn't update docs/C/gdm.xml with information about the
new feature, which is necessary before a patch would be accepted.
The documentation should highlight that this is a feature for
the GTK+ Greeter.

Brian



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