src/windows/native/sun/windows/awt_Window.cpp

Print this page

        

*** 1475,1485 **** static jclass wClassEvent; if (wClassEvent == NULL) { if (env->PushLocalFrame(1) < 0) return; ! wClassEvent = env->FindClass("java/awt/event/WindowEvent"); if (wClassEvent != NULL) { wClassEvent = (jclass)env->NewGlobalRef(wClassEvent); } env->PopLocalFrame(0); if (wClassEvent == NULL) { --- 1475,1485 ---- static jclass wClassEvent; if (wClassEvent == NULL) { if (env->PushLocalFrame(1) < 0) return; ! wClassEvent = env->FindClass("sun/awt/TimedWindowEvent"); if (wClassEvent != NULL) { wClassEvent = (jclass)env->NewGlobalRef(wClassEvent); } env->PopLocalFrame(0); if (wClassEvent == NULL) {
*** 1489,1499 **** static jmethodID wEventInitMID; if (wEventInitMID == NULL) { wEventInitMID = env->GetMethodID(wClassEvent, "<init>", ! "(Ljava/awt/Window;ILjava/awt/Window;II)V"); DASSERT(wEventInitMID); if (wEventInitMID == NULL) { return; } } --- 1489,1499 ---- static jmethodID wEventInitMID; if (wEventInitMID == NULL) { wEventInitMID = env->GetMethodID(wClassEvent, "<init>", ! "(Ljava/awt/Window;ILjava/awt/Window;IIJ)V"); DASSERT(wEventInitMID); if (wEventInitMID == NULL) { return; } }
*** 1530,1540 **** if (awtOpposite != NULL) { jOpposite = awtOpposite->GetTarget(env); } } jobject event = env->NewObject(wClassEvent, wEventInitMID, target, id, ! jOpposite, oldState, newState); DASSERT(!safe_ExceptionOccurred(env)); DASSERT(event != NULL); if (jOpposite != NULL) { env->DeleteLocalRef(jOpposite); jOpposite = NULL; } --- 1530,1540 ---- if (awtOpposite != NULL) { jOpposite = awtOpposite->GetTarget(env); } } jobject event = env->NewObject(wClassEvent, wEventInitMID, target, id, ! jOpposite, oldState, newState, TimeHelper::getMessageTimeUTC()); DASSERT(!safe_ExceptionOccurred(env)); DASSERT(event != NULL); if (jOpposite != NULL) { env->DeleteLocalRef(jOpposite); jOpposite = NULL; }
*** 1557,1581 **** env->DeleteLocalRef(event); } BOOL AwtWindow::AwtSetActiveWindow(BOOL isMouseEventCause, UINT hittest) { ! // Fix for 6458497. ! // Retreat if current foreground window is out of both our and embedder process. ! // The exception is when activation is requested due to a mouse event. ! if (!isMouseEventCause) { ! HWND fgWindow = ::GetForegroundWindow(); ! if (NULL != fgWindow) { ! DWORD fgProcessID; ! ::GetWindowThreadProcessId(fgWindow, &fgProcessID); ! if (fgProcessID != ::GetCurrentProcessId() ! && !AwtToolkit::GetInstance().IsEmbedderProcessId(fgProcessID)) ! { ! return FALSE; ! } ! } ! } HWND proxyContainerHWnd = GetProxyToplevelContainer(); HWND proxyHWnd = GetProxyFocusOwner(); if (proxyContainerHWnd == NULL || proxyHWnd == NULL) { --- 1557,1568 ---- env->DeleteLocalRef(event); } BOOL AwtWindow::AwtSetActiveWindow(BOOL isMouseEventCause, UINT hittest) { ! // We used to reject non mouse window activation if our app wasn't active. ! // This code since has been removed as the fix for 7185280 HWND proxyContainerHWnd = GetProxyToplevelContainer(); HWND proxyHWnd = GetProxyFocusOwner(); if (proxyContainerHWnd == NULL || proxyHWnd == NULL) {