I spent about 3 hours trying to figure this out, and it's really annoying. I was writing a simple plugin that just has a GtkMenuBar in it, and that's it. I figured, since I don't do custom icon resizing or anything, I didn't need to handle XfcePanelPlugin::size-changed, and it would just give the plugin the size it requests. But it doesn't. If you don't handle size-changed at all, the panel forces a square area for the plugin equal to the panel's size (24x24 in my case), despite the fact that the GtkMenuBar in the plugin was returning 44x23 in its size-request handler. Handling size-request and just doing a simple gtk_widget_set_size_request(widget, -1, size) (or the reverse for ORIENTATION_VERTICAL) in there fixes the problem. Why doesn't the panel do this for us if we don't need to do anything special and decide not to handle size-changed? At the very least, this should be documented in the libxfce4panel API docs, unless it can be changed without breaking things. Appears to apply to both the 4.6 panel and the 4.7 git panel.
Jasper and I decided we force a size if False is returned from the size-changed signal, but I can't exactly remember why we did that. IIRC it was because some plugins were too big to fit in the panel because they did not set proper sizes, but that is fixed in the new panel (and maybe in trunk too, must check) by using a fixed plugin size in the child allocation code. So returning TRUE is enough to disable size handling of the panel and the only reason this is useful is that *most* plugins are squared buttons...
Oh, so doing: g_signal_connect(plugin, "size-changed", G_CALLBACK(gtk_true), NULL); should be enough? Ah yeah, that does work, cool. Good enough for me ^_^.
The question is, should I change the function to a VOID:INT since plugins that overflow are now handled in the allocation code. On the other hand, that will break the current behavior, so plugins that do not handle the size signal, are probably non-square. Guess that's not a great idea. I'll improve the documentation of the size change signal and also mention the gtk_true trick.
Devel branch has been merged in master. A 4.7.0 release will follow soon. If you think this bug is not fixed? Feel free to reopen the bug.