views:

6

answers:

1

I need to be able to detect the browser loses focus in a webkit plugin I wrote. I thought I could implement the webViewUnfocus method from the WebUIDelegate protocol but that's not firing. Does anyone have a pointer to a code snippet for what should be a relatively simple problem?

A: 

The solution to this problem was to setup an observer that watched for NSApplicationDidBecomeActiveNotification and NSApplicationDidResignActiveNotification notifications. This let me cleanup and reinitialize when the app lost and regained focus.

snapdev