Ok, so a bit further down the debugging road I know that this issue is related to libxinput2.
I noticed that the enter/leave-notify events were firing because the panel's extents start at 0x0 but moving the pointer towards the top of the screen in combination with the sub-pixel handling of xinput2 produces negative coordinates, e.g. -0.6185, so a leave-notify event is fired, even though the panel should not have lost focus.
If you export "GDK_CORE_DEVICE_EVENTS=1" the problem goes away (this switches to the gtk2 style input instead of xinput2).
Ok, so a bit further down the debugging road I know that this issue is related to libxinput2.
I noticed that the enter/leave-notify events were firing because the panel's extents start at 0x0 but moving the pointer towards the top of the screen in combination with the sub-pixel handling of xinput2 produces negative coordinates, e.g. -0.6185, so a leave-notify event is fired, even though the panel should not have lost focus.
If you export "GDK_CORE_ DEVICE_ EVENTS= 1" the problem goes away (this switches to the gtk2 style input instead of xinput2).