I took a girl on a date some time ago at a bar and things were going fine, playing darts, etc.

And these two guys sat near us and one of the guys started talking to my date and sort of taking her attention from me. I knew that the fact she was willing to talk to this guy instead of me was a shit-test and that this was a major fuck-up that I was allowing to proceed, but I didn't know how to stop it without seeming butthurt and possessive in a beta-ish way. I ended up just talking to the other guy until my date and the first guy's convo trailed off and then brought things back to general (including all 4 of us) conversation.

What would you guys have done to maintain control of the situation while not seeming butthurt?