Resource tree clicking behavior fix

Double / right clicking in the resource tree used to open whatever node was last selected. If an empty part of the tree was double or right clicked, e.g. at the very bottom or towards the rightmost edge, the operation would happen to the last selected node. This could be confusing if the selected node is nowhere near where the mouse was double or right clicked.

This commit changes the behavior by not opening a context menu or frame unless an actual node was double clicked or right clicked with the last mouse event.

Of course, if the previous behavior was intended do not pull this commit.