mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 22:00:38 +00:00
Implement NSApplication's -context method.
Add global variable to NSApplication to prevent -release loops when it is being dealloced. Remove debugging information. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@1634 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ec1a865b4b
commit
f5813d015b
6 changed files with 48 additions and 48 deletions
|
@ -79,26 +79,21 @@ NSString *NSViewFocusChangedNotification;
|
|||
{
|
||||
NSThread *current_thread = [NSThread currentThread];
|
||||
|
||||
NSLog(@"NSView: +pushFocusView\n");
|
||||
// Obtain lock so we can edit the dictionary
|
||||
[gnustep_gui_nsview_lock lock];
|
||||
NSLog(@"NSView: enter critical section\n");
|
||||
|
||||
// If no context then remove from dictionary
|
||||
if (!focusView)
|
||||
{
|
||||
NSLog(@"NSView: remove from dictionary\n");
|
||||
[gnustep_gui_nsview_thread_dict removeObjectForKey: current_thread];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"NSView: add to dictionary\n");
|
||||
[gnustep_gui_nsview_thread_dict setObject: focusView
|
||||
forKey: current_thread];
|
||||
}
|
||||
|
||||
[gnustep_gui_nsview_lock unlock];
|
||||
NSLog(@"NSView: exit critical section\n");
|
||||
NSLog(@"NSView: return from +pushFocusView\n");
|
||||
}
|
||||
|
||||
+ (NSView *)popFocusView
|
||||
|
@ -109,23 +104,14 @@ NSString *NSViewFocusChangedNotification;
|
|||
NSThread *current_thread = [NSThread currentThread];
|
||||
NSView *current_view = nil;
|
||||
|
||||
NSLog(@"NSView: +focusView\n");
|
||||
// Get focused view for current thread
|
||||
[gnustep_gui_nsview_lock lock];
|
||||
NSLog(@"NSView: enter critical section\n");
|
||||
current_view = [gnustep_gui_nsview_thread_dict objectForKey: current_thread];
|
||||
NSLog(@"NSView: Looked in view dictionary\n");
|
||||
|
||||
// If not in dictionary then no focused view
|
||||
if (!current_view)
|
||||
NSLog(@"NSView: Did not find a view\n");
|
||||
else
|
||||
NSLog(@"NSView: Found a view\n");
|
||||
// current_view is nil if no focused view
|
||||
current_view = [gnustep_gui_nsview_thread_dict objectForKey: current_thread];
|
||||
|
||||
[gnustep_gui_nsview_lock unlock];
|
||||
NSLog(@"NSView: exit critical section\n");
|
||||
|
||||
NSLog(@"NSView: return from +focusView\n");
|
||||
return current_view;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue