reminded by @Herschel :
When doing games/apps in browser and or windowed mode, dragging outside the window can cause sticky state behaviour, because mouse up is never fired.
Rather, if the mouse is down on leave, fire mouse up. There will be a config flag to disable the behavior but it's common enough to consider as default enabled.