Question: I've needed to do some things on Change event of jQuery Autocomplete. It's working as I expected (doing these things after changing and losing focus). 

However, if I click on submit button or press Enter (that submits too) the Autocomplete Change event is only firing after submit's done and I need it before submitting.

I've already tried some things like trigger change event on submitting event and other palliative things but nothing worked (using Select event is not an option).

Answer: 
You could do this instead:

```
   func applicationDidBecomeActive(notification: NSNotification) {

        NSApplication.sharedApplication().mainWindow?.movable = false
    }

```
From [the docs](https://developer.apple.com/library/mac//documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/index.html#//apple_ref/occ/instp/NSApplication/mainWindow):

> 
> The value in this property is `nil` when the app’s storyboard or nib file has not yet finished loading. It might also be `nil` when the app is inactive or hidden.
> 
> 
> 

So, this is a perfectly normal thing to have happen, depending on the circumstances.