File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -208,15 +208,17 @@ - (void)setup {
208
208
[NSNotificationCenter .defaultCenter addObserver: self
209
209
selector: @selector (windowDidBecomeKey: )
210
210
name: NSWindowDidBecomeKeyNotification
211
- object: self .window ];
211
+ object: nil ];
212
212
[NSNotificationCenter .defaultCenter addObserver: self
213
213
selector: @selector (windowDidBecomeKey: )
214
214
name: NSWindowDidResignKeyNotification
215
- object: self .window ];
215
+ object: nil ];
216
216
}
217
217
218
- - (void )windowDidBecomeKey : (id )sender {
219
- self.needsDisplay = YES ;
218
+ - (void )windowDidBecomeKey : (NSNotification *)notification {
219
+ if (notification.object == self.window ) {
220
+ self.needsDisplay = YES ;
221
+ }
220
222
}
221
223
222
224
- (int )tabWidthForIndex : (int )tab {
Original file line number Diff line number Diff line change @@ -93,17 +93,19 @@ - (PlaylistHeaderView *)initWithFrame:(NSRect)rect {
93
93
[NSNotificationCenter .defaultCenter addObserver: self
94
94
selector: @selector (windowDidBecomeOrResignKey: )
95
95
name: NSWindowDidBecomeKeyNotification
96
- object: self .window ];
96
+ object: nil ];
97
97
[NSNotificationCenter .defaultCenter addObserver: self
98
98
selector: @selector (windowDidBecomeOrResignKey: )
99
99
name: NSWindowDidResignKeyNotification
100
- object: self .window ];
100
+ object: nil ];
101
101
102
102
return self;
103
103
}
104
104
105
105
- (void )windowDidBecomeOrResignKey : (NSNotification *)notification {
106
- self.needsDisplay = YES ;
106
+ if (notification.object == self.window ) {
107
+ self.needsDisplay = YES ;
108
+ }
107
109
}
108
110
109
111
- (void )drawColumnHeader : (DdbListviewCol_t)col inRect : (NSRect )rect {
Original file line number Diff line number Diff line change @@ -232,6 +232,9 @@ - (void)updateThumbColors {
232
232
}
233
233
234
234
- (void )becameKey : (NSNotification *)notification {
235
+ if (notification.object != self.window ) {
236
+ return ;
237
+ }
235
238
[CATransaction begin ];
236
239
[CATransaction setValue: (id )kCFBooleanTrue forKey: kCATransactionDisableActions ];
237
240
self.isKey = YES ;
@@ -242,6 +245,9 @@ - (void)becameKey:(NSNotification *)notification {
242
245
}
243
246
244
247
- (void )resignedKey : (NSNotification *)notification {
248
+ if (notification.object != self.window ) {
249
+ return ;
250
+ }
245
251
[CATransaction begin ];
246
252
[CATransaction setValue: (id )kCFBooleanTrue forKey: kCATransactionDisableActions ];
247
253
self.isKey = NO ;
You can’t perform that action at this time.
0 commit comments