Fix #10297: compare tree event time with only mouse press time.

rebases #808

Test on both Mac and Windows.