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

Re: shutdown from gnome logout dialog



On Sun, Oct 19, 2003 at 04:44:54PM +0200, Jarno Gassenbauer wrote:
> Agreed. Currently the buttons will not show up if neither the
> gdm-talk nor the Red Hat style script-calls work.
> 
> gdm-talk does not work if it was disabled at compile time or
> if no connection to GDM could be established.
> 
> Red Hat style script-calls does not work if it was disabled
> at compile time or if one of the scripts was not found/accessible/
> authorized/whatever.
> 
> If the communication with GDM shows that some buttons cannot work,
> it's already too late to remove them. I think, resizing the dialog
> (make smaller) might give ugly side effects with the 'iris', that
> is the background darkening that moved from the screen borders
> to the center. I assume the iris won't be redrawn if the dialog
> shrinks...
> 
> (I didn't want the dialog to have to wait for GDM's capability report.
> Can be changed, though.)
> 
> Best regards,
> Jarno
> 
> 
> PS: The suspend button will only show up if gdm-talk works. Its
> not implemented in Red Hat's solution.

Dudes!  You're getting WAAAAAY too complicated for just a logout/shutdown
dialog.  I don't think such patches (way too complex) are at all likely to
get official through to gnome-session.  You don't have the problems if you as
I proposed just

1) talk to gdm figure out what's possible to do
1.5) possibly get the list of users logged in on other screens from gdm.
2) show the dialog with the actions the user can do
3) the user clicks on Cancel -> the dialog closes nothing hapens
   the user clicks on OK ->
   3.5) talk to gdm and tell it what it should do when this session ends

The user spying doesn't really need to be all that real time.  You can do
polling, but since the logout dialog is not likely to stay up too long I
don't really see the point of it being in real time.  But you could poll say
every 5 seconds and update the list of users logged on.

Keeping the connection open will be error prone.  You should not expect the
connection will stay up.  GDM disposes of old connections when too many new
ones come in.

The above can be done with minimum code change to gnome-session (and thus it
has actual chance of getting into official gnome-session and has a chance of
not having too many bugs)  And really does all that you want.

Note that waiting for GDM to respond is NOT going to take long.  There's no
need for caching, there's no need for any performance enhancing and no need
for any asynchro stuff.  We're talking to a LOCAL process and a unix socket
is akin to a memcpy and few context switches.  Nothing that GDM does takes
any time at all.  Time this before trying to make it any more complex.

George

-- 
George <jirka@5z.com>
   If the facts don't fit the theory, change the facts.
                       -- Albert Einstein



Reply to: