Created attachment 8065 screenshot See screenshot. The menu displayed by the applications menu plugin is incorrectly positioned. Instead of being aligned to the left of the plugin button it is centred. This is difficult to notice in default configurations because the menu will never move off screen. In default configurations the application menu is typically the first item on the panel and so there is almost no room for it to move to the left. But it does still happen. This only affects the application menu plugin. For example the places plugin, which looks very similar, is not affected.
Created attachment 8066 screenshot showing effect when menu is close to the edge of the screen
Several other plugins, some of which should have some logic to take care of this problem, also seem affected. https://git.xfce.org/apps/xfce4-notifyd/tree/panel-plugin/notification-plugin.c#n70
Created attachment 8137 vertical lay out
Created attachment 8138 horizontal layout asd
So the code you linked in the notification plugin explicitly defines the behaviour described in this bug. 1. If the panel is vertical, align the widget's western anchor with the menu's eastern anchor. Results in this happening: https://bugzilla.xfce.org/attachment.cgi?id=8137 2. Otherwise align the widget's northern anchor with the menu's southern anchor. Results in this happening: https://bugzilla.xfce.org/attachment.cgi?id=8138 The behaviour should probably actually be: 1. If the panel is vertical, align the widget's north (east) anchor with the menu's north (west) anchor. 2. Otherwise align the widget's (south) west anchor with the menu's (north) west anchor. The directions in brackets change depending whether the panel is on the top/bottom left/right screen edge. They can probably be left out entirely as the panel struts will force the menu onto the correct side, as long as the panel reserves space.
The same anti-pattern seems to have been copy-pasted all over the place, always inside the gtk 3.22 checks. In other places the logic is different. Lots of different versions and I am not sure why. None of them actually seem to be right.
Alistair Buxton referenced this bugreport in commit 0dba5bc9cfd35fe35e9d7acb5791b08b8e38cece Fix anchors for gtk_menu_popup_at_widget https://git.xfce.org/xfce/xfce4-panel/commit?id=0dba5bc9cfd35fe35e9d7acb5791b08b8e38cece