Apply the hack only when the relatedTarget is the canvas
Merge pull request #1774 from geoadmin/fix_fix

Apply the hack only when the relatedTarget is the canvas