fixed check for virtual buttons when handling gadgets
Before, when handling finger events, a flag was set to indicate if
any virtual button was pressed to prevent handling gadgets at the
same screen position. This check was broken, because button events
(including gadget checks) may be processed before the corresponding
finger events are handled, in which case this flag will be set too
late.
Now, checking if virtual buttons are pressed is done directly before
attempting to handle gadgets at the same screen position, so it does
not make a difference if button events or finger events are handled
first.