The WM is the program that dispatches messages (like mouse events, keyboard events, close events, ...) to the windows they belong to. That means that the WM is the program that actually recognizes if a window is not responsive and determines which action to start.
I don't know about xfwm4, but I use wmii and that WM allows me to configure which message to display and what action to start when a window is not responsive. I use Python to customize the WM, in my configuration file it looks like this (if this is helpful for anyone here):
Code:
def unresponsive_client(client):
msg = 'The following client is not responding. What would you like to do?'
resp = call('wihack', '-transient', client.id,
'xmessage', '-nearmouse', '-buttons', 'Kill,Wait', '-print',
'%s\n %s' % (msg, client.label))
if resp == 'Kill':
client.slay()
This function is called from the WM if it detects a window that is not answering. Basically it does nothing more than displaying a message and asking if the user wants to wait for an answer or to kill the window.