I suppose it would be better if this were handled automatically instead. I'll leave this open in connection with #76 and #147, but I think eventually only #147 should be implemented and #76 and #271 considered duplicates.
Oh, sorry, I see that my panel is not actually a "vertical" panel but rather a "deskbar". So then I agree that autodetecting which type of panel is being used would allow for automatic handling to give a good behavior in all cases.
I tried to implement this using xfce_panel_plugin_get_mode (button->priv->plugin);, but it seems that (on my setup) this function always returns XFCE_PANEL_PLUGIN_MODE_HORIZONTAL regardless of the actual panel mode. I am guessing this is because at the time the plugin is created it is perhaps not assigned to the panel yet so the property is not available?