[Sugar-devel] State of Palettes for GTK+ 3.x
Benjamin Berg
benzea at sugarlabs.org
Thu Nov 3 16:59:13 EDT 2011
Hello,
Palettes are still very broken in the sugar-toolkit-gtk3 branch. The
problem is not very simple, and there is some unexpected trouble that we
have not been able to figure out yet.
For those that haven't heard any details, I'll try to explain what is
going on here.
In GTK+ 3.x we are not able to use the current hack to embed menus into
normal palettes. The idea that we came up with during the Hackfest was
to create two separate implementations (the API stays the same). So that
either a sugar palette is popped up, or a sugarized GTK+ menu.
Alone the fact that we are using a normal GTK+ menu means, that we need
to handle grabbing correctly (ie. the opened menu/palette gets all the
events). At the same time, doing this also results in proper touchscreen
support because palettes can be dismissed by clicking anywhere on the
screen.
What happens during a grab is, that one widget receives all events.
These can be forwarded to other widgets so that they can act upon them.
The palettegroup already forwards the mouse-enter/mouse-leave events to
all invokers; the idea is that they can keep track of their state.
The behaviour that we are currently trying to achive is, that the
palette should close after a while when the mouse is outside of the
invoker/palette. The trouble is, that we have not been able to figure
out how the mouse-enter/mouse-leave events to achieve this. The result
of this is that the menu palettes will continuously pop up and down
again.
I am actually thinking about removing the popdown when the user leaves
the palette with the mouse.
My idea for the following steps and bugfixes would be:
1. Make normal palettes grab the input, as the menu palette does.
2. Forward mouse click events to the invoker so that it is still
possible to interact with them (this is not possible right now)
3. Remove the popdown on mouse leave (only makes sense if 1. is
done)
4. Add the title to the menu palette (menuitem likely to be set to
insensitive so that it cannot be selected)
At that point we should we should have usable palettes, that need to be
dismissed by clicking somewhere outside.
Hrm, this was longer than expected; I hope it makes sense without too
much background,
Benjamin
More information about the Sugar-devel
mailing list