In polite circles it would be considered offensive, yes.
There are a couple of geographically related, non-offensive alternatives:
What on earth ... ?
What in heaven's name ... ?
Less offensive (but still not to be said in front of mum):
What the heck ... ?
Contrary to other opinions, I think there is nothing wrong with adding some extra emphasis to what you are trying to say, and attempting to do this while not offending the listener is an admirable goal. 'What on earth' What on earth? isn't pussyfooting'pussyfooting around swearingswearing' at all - it's totally non swearing, but still gets the message across. As a for instancean example, when the boss says 'what are you doing?', you'd let him know your about your current tasks, but when he says 'what on earth are you doing?', you know you have to justify why you're goofing off.