Gtk-3 windows cannot be moved on wayland

I have used gtk-3 for many years, but now Raspberry Pi OS 64 bit uses the Wayland windows manager, and on this manager my applications cannot be dragged around anymore. Is there a way to fix this? I have looked at several discussion groups and manuals, but could not find a solution.

The code is on github (line 492-555)

Solved by attaching mouse events to area instead of window.