libxfce4panel could position panel plugin menus

mmassonnet at gmail.com mmassonnet at gmail.com
Sun Sep 23 02:07:30 CEST 2007


On Fri, Sep 21, 2007 at 09:54:18AM +0200, Harold Aling wrote:
> 
> On Thu, 20 Sep 2007 18:00:58 -0500, "Diego Ongaro" <ongardie at gmail.com>
> wrote:
> > Many plugins use popup menus as their primary UI widget. To name a
> > few, there's xfdesktop (the Xfce Menu), launchers, window list, notes,
> > and places. Currently, each panel plugin with a popup menu needs to
> > call xfce_panel_plugin_register_menu(), then gtk_menu_popup(), and
> > most importantly, implement its own menu positioning function.
> > 
> > I think libxfce4panel should provide more support for this common
> > functionality. By wrapping gtk_menu_popup() with a new
> > xfce_panel_plugin_popup_menu(), libxfce4panel could take over the job
> > of positioning the menu. This has at least three clear advantages:
> > 
> > 1) Less code for new plugins using popup menus
> > 2) Less maintenance and duplication of effort among plugins
> > 3) Improved consistency, especially for floating panels
> > 
> > Regarding the behavior of where to popup the menu, Mike and I agree
> > that the Xfce Menu does a good job right now for fixed panels. For
> > floating panels, however, it pops the menu up just where the cursor
> > is, which isn't great.
> 
> I'm not sure if this info ads anything to this subject:
> 
> _Weird/buggy behavior on popups & an auto hidden panel_
> * When Xfce-menu is open and a application steals focus, the menu collapses
> bot the panel never will (restart panel)
> * Activating an item in the Clipman plugin closes the popup, but never
> closes the panel (hover on/off solves this)

For this the plugin has just to call the function
xfce_panel_plugin_register_menu() which handles the auto-hide behavior.
file:///usr/local/share/gtk-doc/html/libxfce4panel/XfcePanelPlugin.html#xfce-panel-plugin-register-menu

> * Places plugin: "Rightclick action pins autohidden panel" (FIXED[1])
> 
> As you've stated already, since the plugins must write their own 'methods'
> to open a popup, they all behave a little different...

What I find a bit of a pita is the handling of the orientation.  It
would be fine to have a default method which switches the orientation of
a XfceHVBox, with the possibility to override it by signals.  Something
like a signal that returns TRUE to stop other handlers from being
invoked for the event (verbatim sentence from the gtk api).

> 
> 
> -H-
> 
> 
> [1] http://bugzilla.xfce.org/show_bug.cgi?id=3471
> 

Just a $0.02 thought,
Mike



More information about the Xfce4-dev mailing list