From 545c8c6a7ec2ffa296bb9b9749ac6ccc9aad1e45 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Fri, 25 Aug 2000 13:25:50 +0000 Subject: [PATCH] Only let left btn clicks through for popping up the dialog b=49904 r=kmcclusk git-svn-id: svn://10.0.0.236/trunk@77202 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsFileControlFrame.cpp | 13 +++++++++++++ .../layout/html/forms/src/nsFileControlFrame.cpp | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 603c82d09af..9a997675f2b 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -53,6 +53,7 @@ #include "nsIComponentManager.h" #include "nsIDOMWindow.h" #include "nsIFilePicker.h" +#include "nsIDOMMouseEvent.h" static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID); @@ -236,6 +237,18 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext) nsresult nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) { + // only allow the left button + nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); + if (mouseEvent) { + PRUint16 whichButton; + if (NS_SUCCEEDED(mouseEvent->GetButton(&whichButton))) { + if (whichButton != 1) { + return NS_OK; + } + } + } + + nsresult result; // Get parent nsIDOMWindow object. diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp index 603c82d09af..9a997675f2b 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp @@ -53,6 +53,7 @@ #include "nsIComponentManager.h" #include "nsIDOMWindow.h" #include "nsIFilePicker.h" +#include "nsIDOMMouseEvent.h" static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID); @@ -236,6 +237,18 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext) nsresult nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) { + // only allow the left button + nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); + if (mouseEvent) { + PRUint16 whichButton; + if (NS_SUCCEEDED(mouseEvent->GetButton(&whichButton))) { + if (whichButton != 1) { + return NS_OK; + } + } + } + + nsresult result; // Get parent nsIDOMWindow object.