Drag and drop to status items breaks after switching to fullscreen apps

Originator:john
Number:rdar://10438463 Date Originated:2011-11-13
Status:Open Resolved:
Product:Mac OS X Product Version:10.7.2
Classification:Serious Bug Reproducible:Always
 
Summary:

Switching to a fullscreen application causes dragging onto a status item that registers for drag and drop events to no longer work.

Steps to Reproduce:

1) Try dragging a file onto a status item that supports drag and drop. Here are some applications that support drag and drop on their status items:

-Cloud
-DropIn
-Facebook Notifications

Cloud & DropIn are both available on the Mac App Store.
Initially, the drag and drop operation should behave as expected.

2) Now open an application in fullscreen mode (e.g. iTunes) and switch to it using either the trackpad gesture or Ctrl + → 

3) Now switch back to the main space and try and drag and drop onto a status item that supports it. Note that drag and drop now no longer works. Clicking on the status item will make drag and drop work again.

Expected Results:

Drag and drop operations should always work with status items that register for dragging events, regardless of whether the user has switched to a fullscreen application.

Actual Results:

Drag and drop breaks for status items after switching to a fullscreen application and then a click on the status item is needed before drag and drop operations will work with that status item again.

Regression:

This did not happen on Mac OS X 10.6.


Notes:

I have found a short term workaround for this issue that I am using in my app until this is resolved, I initialize the status item with the following code:

statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];
StatusItemView *statusItemView = [[StatusItemView alloc] initWithFrame:NSMakeRect(0, 0, 26, 16)];

I then set the view for the status item to my own custom view as follows:

[statusItem setView:statusItemView];

This statusItemView registers for dragging events using registerForDraggedTypes: and in this view I setup a timer that fires once a second using the following code:

windowOrderingTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(windowOrderUpdate) userInfo:nil repeats:YES];

The code for the windowOrderUpdate code that this timer calls is as follows:

- (void)windowOrderUpdate
{	
    [[self window] orderFront:nil];
}

Calling this orderFront method on the window created for the status item seems to allow drag and drop to work after switching back from a fullscreen app.

A short video demonstrating the bug can be downloaded at http://cl.ly/460j1T3i0P242n2T0g3H

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!