**System Information**
Windows 10, NVidia Ge Force 770M
**Blender Version**
Broken: 2.76b f337fea
**Short description of error**
Clicking RMB (which is used in Sculpt mode for manipulating stencil texture) without stencil mode active causes Blender to freeze for a brief moment (but long enough to be frustrating when using pen&tablet and accidentally clicking small pen button)
**Exact steps for others to reproduce the error**
1. Add sculptable mesh with at least subdivision of ~700k tris (7-8 level for a sample subdivided cube)
2. Press RMB anywhere in viewport while there is no STENCIL mode active for brush (any brush works)
3. Blender freezes for a 1-2s (easily to feel when you try to quickly do something else straight after click)
4. DOES NOT HAPPEN when stencil mode is active even if clicked outside of stencil texture
5. Seems to be affected by size of mesh, lower subdivisions don't cause visible freeze
While debugging, when clicking RMB in Sculpt mode without stencil active it reports "ED_undo_push: Activate / Select" in Blender console, so I suspect that Blender does some fallback when it can't manipulate stencil texture and tries to do some select action (hence pushing it on undo stack). Somehow this action doesn't do anything obvious, but still takes a while to perform and that's where this freeze comes from.
Solution: I suppose just ignoring RMB when there is no stencil active would solve the problem, and I think that's how it tries to work, but something happens on the way ;)