Mouse up events ignored when sandboxing is turned on?

  • I tried searching and did not see anyone else having this problem. I tried turning on sandboxing in my LSUIElement application that normally does not activate, and found that, for some strange reason, the app receives mouse down events, but never receives mouse up events while tracking the mouse if the window was not active when it was clicked. Because the app never receives the event, and the app uses NSTableView (which does its own event tracking instead of using -mouseUp:), then NSTableView gets stuck waiting for something that's never going to happen.

    With event tracing turned on, if I turn off sandboxing, or if I make the window active first, then it works correctly:

    2011-12-30 12:30:05.974 MyApp[54520:b03] Received event: LMouseDown at: 1818.0,158.0 time: 241491984611000 flags: 0x180 win: 16938 ctxt: 2c113 data: 8176,1
    2011-12-30 12:30:05.974 MyApp[54520:b03]    In Application: NSEvent: type=LMouseDown loc=(78,937) time$1492.0 flags=0x180 win=0x0 winNum938 ctxt=0x0 evNum76 click=1 buttonNumber=0 pressure=1
    2011-12-30 12:30:05.974 MyApp[54520:b03]    In Window: NSEvent: type=LMouseDown loc=(78,937) time$1492.0 flags=0x180 win=0x10143f3d0 winNum938 ctxt=0x0 evNum76 click=1 buttonNumber=0 pressure=1
    2011-12-30 12:30:05.976 MyApp[54520:b03] timeout = 62766937794.023842 seconds, mask = 1005c, dequeue = 1, mode = NSEventTrackingRunLoopMode
    2011-12-30 12:30:05.980 MyApp[54520:b03] Received event: LMouseUp at: 1818.0,158.0 time: 241491990904000 flags: 0x180 win: 16938 ctxt: 2c113 data: 8176,1
    2011-12-30 12:30:05.998 MyApp[54520:b03] timeout = 62766937794.001602 seconds, mask = ffffffffffffffff, dequeue = 1, mode = kCFRunLoopDefaultMode

    But once I turn on sandboxing, this is all I get before the application freezes:

    2011-12-30 12:20:25.816 MyApp[54446:b03] Received event: LMouseDown at: 1826.0,463.0 time: 240911808500000 flags: 0x180 win: 16929 ctxt: 1e9df data: 8155,1
    2011-12-30 12:20:25.816 MyApp[54446:b03]    In Application: NSEvent: type=LMouseDown loc=(86,331) time$0911.8 flags=0x180 win=0x0 winNum929 ctxt=0x0 evNum55 click=1 buttonNumber=0 pressure=1
    2011-12-30 12:20:25.816 MyApp[54446:b03]    In Window: NSEvent: type=LMouseDown loc=(86,331) time$0911.8 flags=0x180 win=0x102959ae0 winNum929 ctxt=0x0 evNum55 click=1 buttonNumber=0 pressure=1
    2011-12-30 12:20:25.818 MyApp[54446:b03] timeout = 62766938374.181313 seconds, mask = 1005c, dequeue = 1, mode = NSEventTrackingRunLoopMode

    The really strange thing is, this works as expected when sandboxing is turned off. It also works as expected if the window was active. But I can't ship the application with sandboxing on unless I can figure out how to fix or work around this. Has anyone seen this before, and if so, then how do I make this work?

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • On Dec 30, 2011, at 12:49 PM, Nick Zitzmann wrote:

    > The really strange thing is, this works as expected when sandboxing is turned off. It also works as expected if the window was active. But I can't ship the application with sandboxing on unless I can figure out how to fix or work around this. Has anyone seen this before, and if so, then how do I make this work?

    Well, I reproduced the problem in a sample app, and filed the problem & sample as bug #10636986.

    Nick Zitzmann
    <http://www.chronosnet.com/>
previous month december 2011 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Go to today