Created attachment 5319 Patch to fix it. The tasklist widget has an option to only show windows from the current monitor. This works by calculating the centre pixel of the window, and then testing that against the monitor. However, it is possible to position a window such that the centre pixel does not appear on any monitor. Instead, the tasklist should test windows against every monitor to find which monitor contains the largest area of the windoww; this monitor is where the tasklist button should be displayed. If the window does not intersect any monitor, default to monitor 0.
Created attachment 5320 Refreshed patch
Created attachment 5321 Patch with g_new/g_renew instead of malloc/free
committed on master http://git.xfce.org/xfce/xfce4-panel/commit/?id=0e6c0208130a868f512264375c8e67eddbd5f6c8