libxfce4panel could position panel plugin menus

Nick Schermer nickschermer at gmail.com
Fri Sep 28 16:49:40 CEST 2007


2007/9/28, Diego Ongaro <ongardie at gmail.com>:
> On 9/28/07, Nick Schermer <nickschermer at gmail.com> wrote:
> >
> > I don't see why there it is not just another GtkMenuPositionFunc.
> > Because that's what you want, popup a menu... Or am I stupid or
> > something?
>
> These patches solved more problems than a GtkMenuPositionFunc would
> have. Specifically, in no particular order:
> 1) Arrow directions
> 2) Positioning arbitrary widgets (see Alexandre's email)
> 3) Registering the menu ONLY when it's not already visible (see Harold's email)
> 4) Benefit from #3 even when the plugin wants its menu on the cursor

2) can still be fixed with the same function, since you calculate with
the widgets allocated size, so what won't differ.
3) also possible with the GtkMenuPositionFunc function.
4) not really something we should care about.

> I won't agree that you're stupid, but I like to think that a
> GtkMenuPositionFunc would have been insufficient and awkward to
> include in the API. Also, it would have been more productive for you
> to bring up a suggestion like this for discussion after my *first*
> email.

Maybe, but I didn't expect the patches were committed so quickly. I'd
preferer to take a look at the patches, not the discussion.

> > If you want to calculate the arrow direction, fine, but don't do this
> > in the same function.
>
> I don't see why that's such a bad thing. After all, the logic to know
> where the popup will be placed and the logic to know in which
> direction it will be placed are identical. I'll admit it's strange to
> have those functions return GtkArrowType to represent directions, but
> it was the most convenient type to use.

So that also means you can call the arrow position function inside the
popup position function? Right? That way would make more sense to me.

Nick



More information about the Xfce4-dev mailing list