From 5f1a4898c02582a95c3b877f051344bb033fe93e Mon Sep 17 00:00:00 2001 From: "saari%netscape.com" Date: Sun, 20 Aug 2000 01:14:34 +0000 Subject: [PATCH] Fix for 45006, key events going to select boxes when they're at 0,0. Stop dispatching key events to frame 0,0 when we don't have focused content. git-svn-id: svn://10.0.0.236/trunk@76740 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresShell.cpp | 7 ++++--- mozilla/layout/html/base/src/nsPresShell.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 23291390c2f..680c925de01 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -3898,7 +3898,7 @@ PresShell::HandleEvent(nsIView *aView, // coordinates as the frame's own Rect, so mRect.Contains(aPoint) // works. However, this point is relative to the frame's rect, so // we need to add on the origin of the rect. - nsPoint eventPoint; +/* nsPoint eventPoint; frame->GetOrigin(eventPoint); eventPoint += aEvent->point; rv = frame->GetFrameForPoint(mPresContext, eventPoint, NS_FRAME_PAINT_LAYER_FOREGROUND, &mCurrentEventFrame); @@ -3907,13 +3907,13 @@ PresShell::HandleEvent(nsIView *aView, if (rv != NS_OK) { rv = frame->GetFrameForPoint(mPresContext, eventPoint, NS_FRAME_PAINT_LAYER_BACKGROUND, &mCurrentEventFrame); if (rv != NS_OK) { -#ifdef XP_MAC +#ifdef XP_MAC*/ // On the Mac it is possible to be running with no windows open, only the native menu bar. // In this situation, we need to handle key board events but there are no frames, so // we set mCurrentEventContent and that works itself out in HandleEventInternal. mCurrentEventContent = mDocument->GetRootContent(); mCurrentEventFrame = nsnull; -#else +/*#else if (aForceHandle) { mCurrentEventFrame = frame; } @@ -3926,6 +3926,7 @@ PresShell::HandleEvent(nsIView *aView, } } } + */ } } else { diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 23291390c2f..680c925de01 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -3898,7 +3898,7 @@ PresShell::HandleEvent(nsIView *aView, // coordinates as the frame's own Rect, so mRect.Contains(aPoint) // works. However, this point is relative to the frame's rect, so // we need to add on the origin of the rect. - nsPoint eventPoint; +/* nsPoint eventPoint; frame->GetOrigin(eventPoint); eventPoint += aEvent->point; rv = frame->GetFrameForPoint(mPresContext, eventPoint, NS_FRAME_PAINT_LAYER_FOREGROUND, &mCurrentEventFrame); @@ -3907,13 +3907,13 @@ PresShell::HandleEvent(nsIView *aView, if (rv != NS_OK) { rv = frame->GetFrameForPoint(mPresContext, eventPoint, NS_FRAME_PAINT_LAYER_BACKGROUND, &mCurrentEventFrame); if (rv != NS_OK) { -#ifdef XP_MAC +#ifdef XP_MAC*/ // On the Mac it is possible to be running with no windows open, only the native menu bar. // In this situation, we need to handle key board events but there are no frames, so // we set mCurrentEventContent and that works itself out in HandleEventInternal. mCurrentEventContent = mDocument->GetRootContent(); mCurrentEventFrame = nsnull; -#else +/*#else if (aForceHandle) { mCurrentEventFrame = frame; } @@ -3926,6 +3926,7 @@ PresShell::HandleEvent(nsIView *aView, } } } + */ } } else {