Re: Freezing X?

[ccing the gdm mailing list since it may be of intrest to others]

On Wed, Apr 07, 2004 at 05:33:16PM +0200, axel c wrote:
> Hi George,
> I'm working on a little environment for an internet caffe, with a daemon
> that keeps track of time left on the computer and blocks the display
> when time runs out. The daemon is started per-session from GDM
> PostSession script, and it works nicely.
> My problem comes with the display freezing. So far my approach has been
> using a modified version of the DrWright break window (a gdkwindow as
> big as the display + hard keyboard grab), but that is rather tricky
> because i need to mess with xauth stuff to feed user's X authorization
> cookies to the daemon so it can output the window to the X display of
> the user. I also know shit about the X protocol and i'm sure there is
> some way the user can kill that window somehow and keep going...

The user cannot kill anything really, they could at most switch a console
or some such other nonsense, but you could really prevent that (I think you
can turn that off in the X config file but I could be wrong).  If the user
cannot run anything, they cannot interact with the X protocol.

> So, my question is, is there any hook i can use in GDM to block the X
> display in a way that cannot be bypassed by the user (unless he hits the
> power button of course)?. It'd be nice to have something that freezes
> the display temporarily (and possibly show a dialog), but can be
> reverted, ie the client can stand up, walk to the counter and pay for
> extra time without losing his work.
> I've been looking at the socket stuff in gdm but i couldn't understand
> anything about it and i'm afraid to mess with that.

Your solution with the gdkwindow and the grab should be good.  If you do a
server grab then no other client will be able to do anything and so they
won't be able to do anything with that window.

In any case, it would be nice to then post your results to the gdm mailing
list since I suppose it could be useful for others.


George <jirka 5z com>
   History will be kind to me for I intend to write it.
                       -- Winston Churchill

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