src/macosx/native/sun/awt/AWTView.m

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 80,89 **** --- 80,90 ---- fEnablePressAndHold = shouldUsePressAndHold(); fInPressAndHold = NO; fPAHNeedsToSelect = NO; mouseIsOver = NO; + [self resetTrackingArea]; if (windowLayer != nil) { self.cglLayer = windowLayer; //Layer hosting view [self setLayer: cglLayer];
*** 147,157 **** [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() { [[self window] makeFirstResponder: self]; }]; if ([self window] != NULL) { ! [self resetTrackingRect]; } } - (BOOL) acceptsFirstMouse: (NSEvent *)event { return YES; --- 148,158 ---- [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() { [[self window] makeFirstResponder: self]; }]; if ([self window] != NULL) { ! [self resetTrackingArea]; } } - (BOOL) acceptsFirstMouse: (NSEvent *)event { return YES;
*** 378,411 **** static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_MEMBER_CACHE(jm_deliverMouseEvent, jc_PlatformView, "deliverMouseEvent", "(Lsun/lwawt/macosx/event/NSEvent;)V"); JNFCallVoidMethod(env, m_cPlatformView, jm_deliverMouseEvent, jEvent); } ! ! - (void) clearTrackingRect { ! if (rolloverTrackingRectTag > 0) { ! [self removeTrackingRect:rolloverTrackingRectTag]; ! rolloverTrackingRectTag = 0; } - } ! - (void) resetTrackingRect { ! [self clearTrackingRect]; ! rolloverTrackingRectTag = [self addTrackingRect:[self visibleRect] owner:self ! userData:NULL ! assumeInside:NO]; } - (void)updateTrackingAreas { [super updateTrackingAreas]; ! [self resetTrackingRect]; } - (void) resetCursorRects { [super resetCursorRects]; ! [self resetTrackingRect]; } -(void) deliverJavaKeyEventHelper: (NSEvent *) event { static NSEvent* sLastKeyEvent = nil; if (event == sLastKeyEvent) { --- 379,413 ---- static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView"); static JNF_MEMBER_CACHE(jm_deliverMouseEvent, jc_PlatformView, "deliverMouseEvent", "(Lsun/lwawt/macosx/event/NSEvent;)V"); JNFCallVoidMethod(env, m_cPlatformView, jm_deliverMouseEvent, jEvent); } ! - (void) resetTrackingArea { ! if (rolloverTrackingArea != nil) { ! [self removeTrackingArea:rolloverTrackingArea]; ! [rolloverTrackingArea release]; } ! int options = (NSTrackingActiveInActiveApp | NSTrackingMouseEnteredAndExited | ! NSTrackingMouseMoved | NSTrackingEnabledDuringMouseDrag); ! ! rolloverTrackingArea = [[NSTrackingArea alloc] initWithRect:[self visibleRect] ! options:options owner:self ! userInfo:nil ! ]; ! [self addTrackingArea:rolloverTrackingArea]; } - (void)updateTrackingAreas { [super updateTrackingAreas]; ! [self resetTrackingArea]; } - (void) resetCursorRects { [super resetCursorRects]; ! [self resetTrackingArea]; } -(void) deliverJavaKeyEventHelper: (NSEvent *) event { static NSEvent* sLastKeyEvent = nil; if (event == sLastKeyEvent) {