Re: [gdm-list] opening context menu when clicking on an action label




Sebastien:

I'm trying to open the menu created by make_menubar() (the one opened
when pressing F10) when clicking on one of theme action labels on the
graphical greeter. I've defined a new kind of action to greeter_system.c
and greeter_parser.c and modified the theme to use that new action, that
works fine.
Now I would like to make associated ActionFunc open the menubar. Does
anybody has some hint on how to do that?

This sounds like a way cool feature.  I'd love to get this change into
GDM CVS.  What did you name the new button?  "options_button" seems a
good choice to me, although I'd accept any name that is reasonable.

We started with "Advanced" but "Options" has the preference of the few
people who replied on IRC so we changed it.

That sounds good.  I think Options is better than Advanced.

I think it is much nicer to have a single button with the menu choices
instead of the 3 buttons.  You've probably registered the action in
greeter_item_system_setup in greeter_system just like for the other
buttons.

Right, I did it that way first and then moved it to
greeter_canvas_item.c so it can use some canvas paramaters for its
action

That seems reasonable.

There's no way to programatically pop-up a menu without calling
gtk_widget_event or gtk_main_do_event to cause a "F10" key to be
synthesized which is a hacky way to implement this.  You could
make it work this way.  It's ugly, but no uglier than how the code
is already written.
In fact I've hacked that with a call to gtk_menu_popup() to open the
menu and function to replace it on the top of the label

Oh, I didn't think of that.  That sounds like a much better way to
deal with this.

It would probably be cleaner to get rid of the menu completely and
replace it with a pop-up window that has a single column of buttons.

Right, doing it that way would be less hack, but a row of buttons would
not look really neither. Maybe using a list with an icons column (I've
made a patch to add some icons to the current menu too, it looks nicer,
I'll attach it to bugzilla) and a labels one and acting on selecting?

Yes, please create an RFE in bugzilla in the gdm category and attach
the patch to the bug.

One concern is that this adds new API too the theme XML format by adding
a new button type.  Either you or I should probably ask the release team
if we can put this change into 2.13 even though the API freeze date has
passed.

I would recommend to the release team that this change should go in since
it is a cool feature, makes the GDM greeter themes look much better, and
the change to API is 100% backwards compatible.  The change will only
affect GDM themes that use the new butotn type.

After we put this change in, I think we should also change the default
GDm themes (happygnome, happygnome-list, and circles) to use this single
button instead of the 3 button style.  It just will make GDM look nicer.

However, if we can't get release team's permission to put this API change
in, then this change will have to wait until GDM 2.15 to go into CVS head,
I think.  We should wait until you've created the bug and the attachment
before we ping the release team about this.

Off topic, the happygnome/happygnome-list/circles themes could probably
use some UI/design attention to make them look nicer.

your new "options_button" should be straightforward.  I think this
would be a cleaner way to code the same solution, and would get
rid of the current hacky code.  Currently the System, Session,
and Language buttons pop-up windows like this, so you could
probably use similar code to pop-up the new window.

I've a patch working with the "hack" method at the moment, I'm attaching
it to the mail. It may need some adjustements for the placement method
though. Should I open a bug about that? Bugzilla is probably the right
place to comment on the code changes for it. I made the patch reusing
the same menu to not divert too much from upstream but making a new
dialog for those actions would be nicer. What do you think about the
list idea for it?

I think that the patch that you provided is reasonable and I would
accept it (although the release team will have to tell us if it can
go into 2.13 or 2.15).

I'm sure that the dialog could be made nicer and less hacky by using
a dialog with lists as you suggest.  If you are interested in working
on making this menu nicer, then that would be very much appreciated!

Regardless of which approach you take, it is probably necessary
to add a new choice to the popup that says something like
"Return to login" and makes the popup go away without doing
anything.

Usually pressing "esc" is an obvious way to close a dialog (that's how
GTK context menus do by example), an extra item is not required for
that.

I guess that is okay, but the other buttons (System/Session/Language)
all pop-up dialogs that have a clear "Cancel" button so the user knows
how to get back to the login screen without having to know to hit
"Esc" or F10 or whatever.  It seems a little bit of a usability concern
that this button works differently.  But I don't think it is a real
huge problem.  I'm just nit picking. It's something to think about, at
least.

Brian



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