Tree item fails with ItemClickListener (#14388)

Patch for #14388: added modifications to remove the regression on #6845
(RIGHT, MIDDLE mouse buttons listeners)

Change-Id: I3ef95df68efa0a70bbe0d566ceea187505e2999a