Continuous Grab with pen tablet produces strange results when pen is lifted off tablet (using enter to start operation instead of clicking with tablet pen) and then moved outside of the view area
Open, Needs TriagePublic

Description

System Information
Win8, GTX1070

Blender Version
Broken: 2.79 master and official release, probably before that too

Short description of error

Continuous Grab with pen tablet produces strange results when pen is lifted off tablet (using enter to start operation instead of clicking with tablet pen) and then moved outside of the view. It works properly when you actually click things all of the time but sometimes you may want to press enter instead (typing on the keyboard to start/confirm an operator while holding the pen meaning the cursor is not "active").

Basically what happens is that you move the pen away from the tablet (to enable typing with both hands) which means it's stuck in that cursor location for now, start an operator (like edge crease) or confirm an operator (like adding a node in the node editor from the search and pressing enter), move back the pen to the tablet which instantly moves the cursor from the previous "inactive" position to the new position where you put the pen down in the tablet area and finally move the cursor outside of the view area/panel. This causes problems, it's fine if you return the pen to the tablet area so the cursor is active before invoking/confirming the operator. This is not very natural though because it means you have to either type with one hand (with the pen over the tablet area so it's active) or type with both hands, then before confirming the operator return the pen over the tablet area and press enter with your left hand for example. This is inconvenient and you would ideally just type as normal before returning the pen to the tablet area.

Normal behavior: https://imgur.com/RvgyrMg (clicking so the cursor is active before starting the operator). The panel is to the left of the video and you can see it behaves normally you can drag it outside of the view.

Bugged behavior: https://imgur.com/vpRWtGx (pressing enter while holding the pen). As you can see the view goes a bit crazy, the cursor starts blinking (alternating between two positions) and there are five digit numbers in the translation which shouldn't happen. You can also see this in the scrollbars and the node is completely gone from the view.

Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps

  1. Have a tablet with absolute position (also called tablet mode, the default).
  2. Enable Continous Grab if it wasn't already.
  3. Add a mesh, add a material and check Use Nodes.
  4. In the node editor (material view) search for a node, hold the pen over the tablet are so the cursor is active. Press enter with the left hand. You get the expected behavior, you can move the node outside of the view area.
  5. As above, search for a node and click it with the pen. Again it works fine (expected behavior).
  6. As above, but hold the pen away from the tablet when pressing enter, then return the pen to the tablet area. At first it works fine (you can drag the node around in the view area) but as soon as you try to leave the view area it goes crazy and scrolls extremely far outside of the view. Also note that when you return to the view area (cursor stops blinking) you are translating the node at a normal pace, but whenever you go outside of the view the cursor starts blinking and you're translating at a highly accelerated rate.

My theory is that the position of the inactive cursor is saved, but when going outside of the view you get an offset between the old saved location and the new location (from where you returned the pen over the tablet area), so for example if you had an offset of 100 pixels between the old location and the new location it moves 100 pixels for every pixel outside of the view area. No idea is this is true or not though.

Details

Type
Bug