Apply the hack only when the relatedTarget is the canvas

Test [here](http://mf-geoadmin3.dev.bgdi.ch/fix_fix/)