diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemCocoa.mm')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 4371d4d19c8..90dad2f1d96 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. @@ -1322,16 +1322,12 @@ bool GHOST_SystemCocoa::handleOpenDocumentRequest(void *filepathStr) GHOST_TSuccess GHOST_SystemCocoa::handleTabletEvent(void *eventPtr, short eventType) { NSEvent *event = (NSEvent *)eventPtr; - GHOST_IWindow* window = m_windowManager->getActiveWindow(); + GHOST_IWindow* window; + window = m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]); if (!window) { - /* If no active window found, still tries to find the window associated with the event - This may happen when Cocoa continues to send some events after the window deactivate one */ - window = m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]); - if (!window) { - //printf("\nW failure for event 0x%x",[event type]); - return GHOST_kFailure; - } + //printf("\nW failure for event 0x%x",[event type]); + return GHOST_kFailure; } GHOST_TabletData& ct=((GHOST_WindowCocoa*)window)->GetCocoaTabletData(); @@ -1381,16 +1377,12 @@ GHOST_TSuccess GHOST_SystemCocoa::handleTabletEvent(void *eventPtr, short eventT GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) { NSEvent *event = (NSEvent *)eventPtr; - GHOST_Window* window = (GHOST_Window*)m_windowManager->getActiveWindow(); + GHOST_Window* window; + window = (GHOST_Window*)m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]); if (!window) { - /* If no active window found, still tries to find the window associated with the event - This may happen when Cocoa continues to send some events after the window deactivate one */ - window = (GHOST_Window*)m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]); - if (!window) { - //printf("\nW failure for event 0x%x",[event type]); - return GHOST_kFailure; - } + //printf("\nW failure for event 0x%x",[event type]); + return GHOST_kFailure; } switch ([event type]) @@ -1586,7 +1578,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr) GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) { NSEvent *event = (NSEvent *)eventPtr; - GHOST_IWindow* window = m_windowManager->getActiveWindow(); + GHOST_IWindow* window; unsigned int modifiers; NSString *characters; NSData *convertedCharacters; @@ -1594,14 +1586,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) unsigned char ascii; NSString* charsIgnoringModifiers; + window = m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]); if (!window) { - /* If no active window found, still tries to find the window associated with the event - This may happen when Cocoa continues to send some events after the window deactivate one */ - window = m_windowManager->getWindowAssociatedWithOSWindow((void*)[event window]); - if (!window) { - //printf("\nW failure for event 0x%x",[event type]); - return GHOST_kFailure; - } + //printf("\nW failure for event 0x%x",[event type]); + return GHOST_kFailure; } switch ([event type]) { |