A new logout dialog (v3)

Manu Cornet manu.cornet at gmail.com
Sat Dec 17 22:08:38 GMT 2005


Hi !

> Good job thanks. Is the current code on your page?

Yep, here :

	http://www.manucornet.net/GNOME/code/logout_dialog/

The diff file is ugly : since this is unfinished work, it has lots of
commented stuff I don't want any more (in case we need it again). Don't
be scared, this is not what my patches usually look like. But it
works :)

The dialog appearance is unchanged.

> Two notes:
> - We said we will start by having the dialog modal (ie: no possibility
> to switch to other windows while it's open)

All right, I managed to grab all keyboard events, but I can't manage to
get all mouse events. The previous code did this right, but using
XGrabServer in my case causes an X error. That might be related to the
fact that the previous window was a "POPUP" one, and mine is
"TOPLEVEL" (so that I can get borders). Any idea ?

Making the window modal (gtk_window_set_modal) is not enough, since it
is local to each application.

Anyway, why do we need to grab all events ? Windows does, Mac OS X
doesn't, and I would prefer not to. Only my opinion, but I hate to be
"made prisonner" inside a small window : if I want to open the logout
dialog, then "oops, I forgot to..." settle a few last details and save a
few documents, why not ? I tried it and it works without needing any
special changes to the code ; the user makes his decision when he wants.
Otherwise it feels a little like "Hands up, don't move and respond at
once !".

> - Is the title useful? Jeff pointed to the type or window with a thin
> border all around, is that possible to use this hint for the dialog?

Well, this is a bit more complicated than it seems. Jeff pointed me to
metacity-theme-viewer, so I took a look at the code there. The window
with only borders is a GtkEventBox, which is not a child of the
GtkWindow object. This makes many things much harder, and even sometimes
impossible to do : it's not a GtkDialog anymore (response management
trouble), not a GtkWindow (can't center it on the screen easily), and
countless other small issues. I began to change everything into a
GtkEventBox, but after some time it appeared that this may just not be
the right way to do it, and a few problems just can't be solved with a
GtkEvent.

If anybody knows how to make a GtKDialog or GtkWindow look the way we
want (only borders, no title bar), I'd love to hear his advice :)

Cheers,
Manu




More information about the ubuntu-desktop mailing list