Fix [#25442]: (Ghost Cocoa) Add missing initialization of associated object pointer...
authorDamien Plisson <damien.plisson@yahoo.fr>
Sat, 1 Jan 2011 19:48:14 +0000 (19:48 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Sat, 1 Jan 2011 19:48:14 +0000 (19:48 +0000)
intern/ghost/intern/GHOST_WindowCocoa.mm

index 0b6393c06b6e40c888fc59504f6dc43fade341af..db08f238045675812bbb0643f4539b2047388eb3 100644 (file)
@@ -143,6 +143,7 @@ extern "C" {
        GHOST_TDragnDropTypes m_draggedObjectType;
 }
 - (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa;
+- (GHOST_SystemCocoa*)systemCocoa;
 @end
 @implementation CocoaWindow
 - (void)setSystemAndWindowCocoa:(GHOST_SystemCocoa *)sysCocoa windowCocoa:(GHOST_WindowCocoa *)winCocoa
@@ -150,6 +151,10 @@ extern "C" {
        systemCocoa = sysCocoa;
        associatedWindow = winCocoa;
 }
+- (GHOST_SystemCocoa*)systemCocoa
+{
+       return systemCocoa;
+}
 
 -(BOOL)canBecomeKeyWindow
 {
@@ -777,6 +782,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                                [tmpWindow setReleasedWhenClosed:NO];
                                [tmpWindow setAcceptsMouseMovedEvents:YES];
                                [tmpWindow setDelegate:[m_window delegate]];
+                               [tmpWindow setSystemAndWindowCocoa:[m_window systemCocoa] windowCocoa:this];
                                [tmpWindow registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
                                                                                                   NSStringPboardType, NSTIFFPboardType, nil]];
                                
@@ -837,6 +843,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                                [tmpWindow setReleasedWhenClosed:NO];
                                [tmpWindow setAcceptsMouseMovedEvents:YES];
                                [tmpWindow setDelegate:[m_window delegate]];
+                               [tmpWindow setSystemAndWindowCocoa:[m_window systemCocoa] windowCocoa:this];
                                [tmpWindow registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType,
                                                                                                   NSStringPboardType, NSTIFFPboardType, nil]];
                                //Forbid to resize the window below the blender defined minimum one