Mystery behaviour of isWindowAtPoint


#1

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

static bool isWindowAtPoint (NSWindow* w, NSPoint screenPoint)
{
   #if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
    if ([NSWindow respondsToSelector: @selector (windowNumberAtPoint:belowWindowWithWindowNumber:)])
        return [NSWindow windowNumberAtPoint: screenPoint belowWindowWithWindowNumber: 0] == [w windowNumber];
   #endif

    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!


#2

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


#3

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


#4

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


#5

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


#6

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

Rail


#7

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.