Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Verwiebe <info@jensverwiebe.de>2013-09-28 21:55:22 +0400
committerJens Verwiebe <info@jensverwiebe.de>2013-09-28 21:55:22 +0400
commit1a30e52142c52010f889113cf4d3669f3461f668 (patch)
tree7e513ac1e75255b1eae26763bf83e35c6406b1cf /intern/ghost
parent99837ea844882f3d9ff0d0e035b88c587e9ece47 (diff)
OSX: make sure closing the mainwindow forewards to the quitdialog - todo: check if m_window now public is a problem
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm10
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.h7
2 files changed, 14 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 37b698c8d3d..c5d906d6073 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1018,12 +1018,20 @@ void GHOST_SystemCocoa::notifyExternalEventProcessed()
//Note: called from NSWindow delegate
GHOST_TSuccess GHOST_SystemCocoa::handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window)
{
+ NSArray *windowsList;
+ windowsList = [NSApp orderedWindows];
if (!validWindow(window)) {
return GHOST_kFailure;
}
switch (eventType) {
case GHOST_kEventWindowClose:
- pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowClose, window) );
+ // make sure index 1 exists and compare window adress
+ if ([windowsList count] > 1 && (window->m_window != [windowsList objectAtIndex:1])) {
+ pushEvent( new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowClose, window) );
+ }
+ else {
+ handleQuitRequest(); // -> quit dialog
+ }
break;
case GHOST_kEventWindowActivate:
m_windowManager->setActiveWindow(window);
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.h b/intern/ghost/intern/GHOST_WindowCocoa.h
index fe0830edeae..af8aa4b0062 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.h
+++ b/intern/ghost/intern/GHOST_WindowCocoa.h
@@ -269,6 +269,9 @@ public:
GHOST_TSuccess beginFullScreen() const {return GHOST_kFailure;}
GHOST_TSuccess endFullScreen() const {return GHOST_kFailure;}
+
+ /** The window containing the OpenGL view */
+ CocoaWindow *m_window;
protected:
@@ -318,8 +321,8 @@ protected:
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
- /** The window containing the OpenGL view */
- CocoaWindow *m_window;
+// /** The window containing the OpenGL view */
+// CocoaWindow *m_window;
/** The openGL view */
CocoaOpenGLView *m_openGLView;