Changeset 522 for trunk/Cocoa/Pester/Source/PSApplication.m
- Timestamp:
- 05/25/09 03:21:44 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/Pester/Source/PSApplication.m
r364 r522 18 18 #import "PSTimer.h" 19 19 #import "NJRHotKey.h" 20 #import "NSWindowCollectionBehavior.h" 20 21 21 22 #import <Carbon/Carbon.h> … … 49 50 - (IBAction)orderFrontSetAlarmPanel:(id)sender; 50 51 { 52 NSWindow *window = [alarmSetController window]; 53 if ([window respondsToSelector: @selector(setCollectionBehavior:)]) { // 10.5-only 54 // XXX bug workaround - NSWindowCollectionBehaviorMoveToActiveSpace is what we want, but it doesn't work correctly, probably because we have a "chicken and egg" problem as the panel isn't visible when the app is hidden 55 [window setCollectionBehavior: NSWindowCollectionBehaviorCanJoinAllSpaces]; 56 [alarmSetController showWindow: self]; 57 [window performSelector: @selector(setCollectionBehavior:) withObject: 58 (id)NSWindowCollectionBehaviorDefault afterDelay: 0]; 59 [NSApp activateIgnoringOtherApps: YES]; // XXX causes title bar to flash 60 return; 61 } 51 62 [NSApp activateIgnoringOtherApps: YES]; 52 63 [alarmSetController showWindow: self]; … … 68 79 } 69 80 [preferencesController showWindow: self]; 81 } 82 83 #pragma mark Spaces interaction 84 85 - (void)orderOutSetAlarmPanelIfHidden; 86 { 87 // prevent set alarm panel from "yanking" focus from an alarm notification, thereby obscuring the notification 88 if ([NSApp isActive]) 89 return; 90 91 NSWindow *window = [alarmSetController window]; 92 if (![window isVisible]) 93 return; 94 95 [window orderOut: self]; 70 96 } 71 97
Note:
See TracChangeset
for help on using the changeset viewer.