-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various Cocoa improvements and fixes
Changed behaviour of vtkCocoaRenderWindowInteractor::TerminateApp(). It used to do one of two things: 1) terminate the application completely, or 2) close the NSWindow and stop the event loop. Now it never closes the NSWindow, never terminates the application, and always stops the event loop. Start() and TerminateApp() are now pairs, which is how other platforms already behave. Also refactored NSApplication runloop starting/stopping code into static functions that do only that. Makes more sense since there is only one event loop, there doesn't need to be an association with any class or instance. Thanks to Pat Marion for reporting this problem and creating a patch. Changed of behaviour observing for NSWindow closing. First, moved the private vtkCocoaServer class from vtkCocoaRenderWindowInteractor to vtkCocoaRenderWindow. Its job is to observe window closing. Since vtkCocoaRenderWindow creates the NSWindow, it make more sense there. We were previously careful to only observe NSWindows created by VTK, but are now also careful to *stop* observing only those same windows, whereas previously there was an outside chance of stopping observation of all window closes, which is something a library should not do (who knows what else the application is doing). Now when an observed NSWindow closes, we no longer stop the event loop, but merely remove our reference to it. Changed vtkCocoaRenderWindow::SetWindowName() to interpret its char* string parameter as UTF8 instead of ASCII. Fixed possible memory leaks in ~vtkCocoaRenderWindow. Replaced most invocations of 'autorelease' in favour of 'release'. The motivation being that VTK, as a library, might sometimes be called before an autorelease pool is even setup, so better to avoid autoreleased objects as much as possible. Fixed some whitespace and coding conventions (asterisk positioning, constness, etc.) Change-Id: I5a5d410012980ee9f6c637c340e98e3daa5aee74
- Loading branch information
Showing
6 changed files
with
314 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.