Mystery behaviour of isWindowAtPoint

I’ve got an app which stops responding to mouse events after a minute or so on OSX. In particular this function in returns false, which seem to be pretty fatal for handling the mouse:

static bool isWindowAtPoint (NSWindow* w, NSPoint screenPoint)
    if ([NSWindow respondsToSelector: @selector (windowNumberAtPoint:belowWindowWithWindowNumber:)])
        return [NSWindow windowNumberAtPoint: screenPoint belowWindowWithWindowNumber: 0] == [w windowNumber];

    return true;

Any ideas how to debug this? The funny thing is if I have the app open a second window the second window stops responding to events and the first one carries on!

Actually - the bottom half of the window sometimes continues to respond, and the top half doesn’t!

It seems like [NSWindow windowNumberAtPoint: screenPoint belowWindowWithWindowNumber: 0] suddenly starts returning the window number of the window behind my window…

And if i call setBounds on the window it starts working again … confused as hell :slight_smile:

Okay … so I rebooted the computer and now I can’t repeat it. If anyone else has seen this I’m interested :slight_smile:

I haven’t seen that… but are you using native or JUCE title bars?


This was with a native title bar. The title bar still worked, just the rest of the application progressively stopped responding to clicks. Very odd.