Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 29612 Details for
Bug 48314
Enabling forward/back side mouse buttons in Firefox
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
configurable support for forward/back buttons in firefox
mozilla-patch-comment-fixed.diff (text/plain), 23.68 KB, created by
Simon Smith
on 2004-04-19 05:57:25 UTC
(
hide
)
Description:
configurable support for forward/back buttons in firefox
Filename:
MIME Type:
Creator:
Simon Smith
Created:
2004-04-19 05:57:25 UTC
Size:
23.68 KB
patch
obsolete
>diff -u -r mozilla-orig/browser/app/profile/all.js mozilla/browser/app/profile/all.js >--- mozilla-orig/browser/app/profile/all.js 2004-02-09 00:24:53.000000000 -0800 >+++ mozilla/browser/app/profile/all.js 2004-03-21 15:15:14.000000000 -0800 >@@ -531,6 +531,28 @@ > pref("mousewheel.withaltkey.numlines",1); > pref("mousewheel.withaltkey.sysnumlines",false); > >+pref("mousewheel.horizscroll.withnokey.action",2); >+pref("mousewheel.horizscroll.withnokey.numlines",-1); >+pref("mousewheel.horizscroll.withnokey.sysnumlines",true); >+pref("mousewheel.horizscroll.withcontrolkey.action",0); >+pref("mousewheel.horizscroll.withcontrolkey.numlines",1); >+pref("mousewheel.horizscroll.withcontrolkey.sysnumlines",true); >+pref("mousewheel.horizscroll.withshiftkey.action",0); >+pref("mousewheel.horizscroll.withshiftkey.numlines",1); >+pref("mousewheel.horizscroll.withshiftkey.sysnumlines",false); >+pref("mousewheel.horizscroll.withaltkey.action",2); >+pref("mousewheel.horizscroll.withaltkey.numlines",-1); >+pref("mousewheel.horizscroll.withaltkey.sysnumlines",false); >+ >+pref("mousebuttonsextended.buttons.6.action.up", 2); >+pref("mousebuttonsextended.buttons.6.numlines.up", -1); >+pref("mousebuttonsextended.buttons.6.action.down", -1); >+pref("mousebuttonsextended.buttons.6.numlines.down", -1); >+pref("mousebuttonsextended.buttons.7.action.up", 2); >+pref("mousebuttonsextended.buttons.7.numlines.up", 1); >+pref("mousebuttonsextended.buttons.7.action.down", -1); >+pref("mousebuttonsextended.buttons.7.numlines.down", -1); >+ > pref("profile.confirm_automigration",true); > pref("profile.allow_automigration", false); // setting to false bypasses automigration in the profile code > >diff -u -r mozilla-orig/content/events/src/nsEventStateManager.cpp mozilla/content/events/src/nsEventStateManager.cpp >--- mozilla-orig/content/events/src/nsEventStateManager.cpp 2003-11-18 18:23:25.000000000 -0800 >+++ mozilla/content/events/src/nsEventStateManager.cpp 2004-03-21 15:15:14.000000000 -0800 >@@ -22,6 +22,9 @@ > * Contributor(s): > * Makoto Kato <m_kato@ga2.so-net.ne.jp> > * Dean Tessman <dean_tessman@hotmail.com> >+ * Andrew Wellington <proton@wiretapped.net> >+ * Graham Dennis <u3952328@anu.edu.au> >+ * Thomas Kleffel <thomas.kleffel@maintech.de> > * > * Alternatively, the contents of this file may be used under the terms of > * either the GNU General Public License Version 2 or later (the "GPL"), or >@@ -1536,14 +1539,49 @@ > return NS_OK; > } > >+nsresult >+nsEventStateManager::DoScrollHistory(PRInt32 direction) >+{ >+ nsCOMPtr<nsISupports> pcContainer; >+ mPresContext->GetContainer(getter_AddRefs(pcContainer)); >+ if (pcContainer) { >+ nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(pcContainer)); >+ if (webNav) { >+ // negative direction to go back one step, nonneg to go forward >+ if (direction < 0) >+ webNav->GoBack(); >+ else >+ webNav->GoForward(); >+ } >+ } >+ return NS_OK; >+} >+ >+nsresult >+nsEventStateManager::DoScrollTextsize(nsIFrame *aTargetFrame, >+ PRInt32 adjustment) >+{ >+ // Exclude form controls and XUL content. >+ nsIContent *content = aTargetFrame->GetContent(); >+ if (content && >+ !content->IsContentOfType(nsIContent::eHTML_FORM_CONTROL) && >+ !content->IsContentOfType(nsIContent::eXUL)) >+ { >+ // positive adjustment to increase text size, non-positive to decrease >+ ChangeTextSize((adjustment > 0) ? 1 : -1); >+ } >+ return NS_OK; >+} > > // > nsresult >-nsEventStateManager::DoWheelScroll(nsIPresContext* aPresContext, >- nsIFrame* aTargetFrame, >- nsMouseScrollEvent* aMSEvent, >- PRInt32 aNumLines, PRBool aScrollHorizontal, PRBool aScrollPage, >- PRBool aUseTargetFrame) >+nsEventStateManager::DoScrollText(nsIPresContext* aPresContext, >+ nsIFrame* aTargetFrame, >+ nsInputEvent* aEvent, >+ PRInt32 aNumLines, >+ PRBool aScrollHorizontal, >+ PRBool aScrollPage, >+ PRBool aUseTargetFrame) > { > nsCOMPtr<nsIContent> targetContent = aTargetFrame->GetContent(); > if (!targetContent) >@@ -1570,11 +1608,13 @@ > } > } > >- mouseEvent->InitMouseEvent(NS_LITERAL_STRING("DOMMouseScroll"), PR_TRUE, PR_TRUE, >+ mouseEvent->InitMouseEvent(NS_LITERAL_STRING("DOMMouseScroll"), >+ PR_TRUE, PR_TRUE, > view, aNumLines, >- aMSEvent->refPoint.x, aMSEvent->refPoint.y, >- aMSEvent->point.x, aMSEvent->point.y, >- aMSEvent->isControl, aMSEvent->isAlt, aMSEvent->isShift, aMSEvent->isMeta, >+ aEvent->refPoint.x, aEvent->refPoint.y, >+ aEvent->point.x, aEvent->point.y, >+ aEvent->isControl, aEvent->isAlt, >+ aEvent->isShift, aEvent->isMeta, > 0, nsnull); > PRBool allowDefault; > nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(targetContent)); >@@ -1595,7 +1635,7 @@ > nsMouseEvent mouseOutEvent; > mouseOutEvent.eventStructType = NS_MOUSE_EVENT; > mouseOutEvent.message = NS_MOUSE_EXIT; >- mouseOutEvent.widget = aMSEvent->widget; >+ mouseOutEvent.widget = aEvent->widget; > mouseOutEvent.clickCount = 0; > mouseOutEvent.point = nsPoint(0,0); > mouseOutEvent.refPoint = nsPoint(0,0); >@@ -1676,8 +1716,9 @@ > return NS_ERROR_FAILURE; > nsRect portRect = portView->GetBounds(); > >- passToParent = aScrollHorizontal ? (xPos + portRect.width >= scrolledSize.width) >- : (yPos + portRect.height >= scrolledSize.height); >+ passToParent = (aScrollHorizontal ? >+ (xPos + portRect.width >= scrolledSize.width) : >+ (yPos + portRect.height >= scrolledSize.height)); > } > } > >@@ -1710,11 +1751,11 @@ > nsIFrame* newFrame = nsnull; > nsCOMPtr<nsIPresContext> newPresContext; > >- rv = GetParentScrollingView(aMSEvent, aPresContext, newFrame, >+ rv = GetParentScrollingView(aEvent, aPresContext, newFrame, > *getter_AddRefs(newPresContext)); > if (NS_SUCCEEDED(rv) && newFrame) >- return DoWheelScroll(newPresContext, newFrame, aMSEvent, aNumLines, >- aScrollHorizontal, aScrollPage, PR_TRUE); >+ return DoScrollText(newPresContext, newFrame, aEvent, aNumLines, >+ aScrollHorizontal, aScrollPage, PR_TRUE); > else > return NS_ERROR_FAILURE; > } >@@ -1723,7 +1764,7 @@ > } > > nsresult >-nsEventStateManager::GetParentScrollingView(nsMouseScrollEvent *aEvent, >+nsEventStateManager::GetParentScrollingView(nsInputEvent *aEvent, > nsIPresContext* aPresContext, > nsIFrame* &targetOuterFrame, > nsIPresContext* &presCtxOuter) >@@ -1911,6 +1952,67 @@ > } > } > break; >+ case NS_MOUSE_EXTENDED_BUTTON: >+ { >+ nsMouseEvent *mEvent = (nsMouseEvent* )aEvent; >+ nsresult rv; >+ nsCAutoString actionKey, numLinesKey; >+ PRInt32 action; >+ PRInt32 numLines; >+ >+ NS_NAMED_LITERAL_CSTRING(prefbase, "mousebuttonsextended.buttons."); >+ NS_NAMED_LITERAL_CSTRING(prefaction, ".action"); >+ NS_NAMED_LITERAL_CSTRING(prefnumlines, ".numlines"); >+ >+ nsCAutoString prefstatus(((mEvent->status == nsMouseEventStatus_up) >+ ? ".up" : ".down")); >+ >+ rv = getPrefBranch(); >+ if (NS_FAILED(rv)) return rv; >+ >+ actionKey = prefbase; >+ actionKey.AppendInt(mEvent->button); >+ actionKey.Append(prefaction); >+ actionKey.Append(prefstatus); >+ rv = mPrefBranch->GetIntPref(PromiseFlatCString(actionKey).get(), >+ &action); >+ if (NS_FAILED(rv)) break; >+ >+ numLinesKey = prefbase; >+ numLinesKey.AppendInt(mEvent->button); >+ numLinesKey.Append(prefnumlines); >+ numLinesKey.Append(prefstatus); >+ rv = mPrefBranch->GetIntPref(PromiseFlatCString(numLinesKey).get(), >+ &numLines); >+ if (NS_FAILED(rv)) break; >+ >+ switch (action) { >+ >+ case MOUSE_SCROLL_N_LINES: >+ case MOUSE_SCROLL_PAGE: >+ { >+ DoScrollText(aPresContext, aTargetFrame, mEvent, numLines, >+ 0, (action == MOUSE_SCROLL_PAGE), PR_FALSE); >+ } >+ break; >+ >+ case MOUSE_SCROLL_HISTORY: >+ { >+ DoScrollHistory(numLines); >+ } >+ break; >+ >+ case MOUSE_SCROLL_TEXTSIZE: >+ { >+ DoScrollTextsize(aTargetFrame, numLines); >+ } >+ break; >+ >+ default: // Including -1 (do nothing) >+ break; >+ } >+ } >+ break; > case NS_MOUSE_SCROLL: > if (nsEventStatus_eConsumeNoDefault != *aStatus) { > nsresult rv; >@@ -1920,95 +2022,79 @@ > nsMouseScrollEvent *msEvent = (nsMouseScrollEvent*) aEvent; > PRInt32 action = 0; > PRInt32 numLines = 0; >- PRBool aBool; >- if (msEvent->isShift) { >- mPrefBranch->GetIntPref("mousewheel.withshiftkey.action", &action); >- mPrefBranch->GetBoolPref("mousewheel.withshiftkey.sysnumlines", >- &aBool); >- if (aBool) { >- numLines = msEvent->delta; >- if (msEvent->scrollFlags & nsMouseScrollEvent::kIsFullPage) >- action = MOUSE_SCROLL_PAGE; >- } >- else >- mPrefBranch->GetIntPref("mousewheel.withshiftkey.numlines", >- &numLines); >- } else if (msEvent->isControl) { >- mPrefBranch->GetIntPref("mousewheel.withcontrolkey.action", &action); >- mPrefBranch->GetBoolPref("mousewheel.withcontrolkey.sysnumlines", >- &aBool); >- if (aBool) { >- numLines = msEvent->delta; >- if (msEvent->scrollFlags & nsMouseScrollEvent::kIsFullPage) >- action = MOUSE_SCROLL_PAGE; >- } >- else >- mPrefBranch->GetIntPref("mousewheel.withcontrolkey.numlines", >- &numLines); >- } else if (msEvent->isAlt) { >- mPrefBranch->GetIntPref("mousewheel.withaltkey.action", &action); >- mPrefBranch->GetBoolPref("mousewheel.withaltkey.sysnumlines", &aBool); >- if (aBool) { >- numLines = msEvent->delta; >- if (msEvent->scrollFlags & nsMouseScrollEvent::kIsFullPage) >- action = MOUSE_SCROLL_PAGE; >- } >- else >- mPrefBranch->GetIntPref("mousewheel.withaltkey.numlines", >- &numLines); >- } else { >- mPrefBranch->GetIntPref("mousewheel.withnokey.action", &action); >- mPrefBranch->GetBoolPref("mousewheel.withnokey.sysnumlines", &aBool); >- if (aBool) { >- numLines = msEvent->delta; >- if (msEvent->scrollFlags & nsMouseScrollEvent::kIsFullPage) >- action = MOUSE_SCROLL_PAGE; >- } >- else >- mPrefBranch->GetIntPref("mousewheel.withnokey.numlines", &numLines); >- } >+ PRBool useSysNumLines; > >- if ((msEvent->delta < 0) && (numLines > 0)) >+ NS_NAMED_LITERAL_CSTRING(prefmousewheel, "mousewheel"); >+ NS_NAMED_LITERAL_CSTRING(prefhoriz, ".horizscroll"); >+ NS_NAMED_LITERAL_CSTRING(prefvert, ""); >+ NS_NAMED_LITERAL_CSTRING(prefnodir, ""); >+ NS_NAMED_LITERAL_CSTRING(prefnokey, ".withnokey"); >+ NS_NAMED_LITERAL_CSTRING(prefshiftkey, ".withshiftkey"); >+ NS_NAMED_LITERAL_CSTRING(prefctrlkey, ".withcontrolkey"); >+ NS_NAMED_LITERAL_CSTRING(prefaltkey, ".withaltkey"); >+ NS_NAMED_LITERAL_CSTRING(prefaction, ".action"); >+ NS_NAMED_LITERAL_CSTRING(prefsysnumlines, ".sysnumlines"); >+ NS_NAMED_LITERAL_CSTRING(prefnumlines, ".numlines"); >+ >+ nsCString prefDirection; >+ nsCString prefModifier; >+ >+ //if delta==0 we have nothing to do! >+ if(msEvent->delta == 0) break; >+ >+ prefDirection = prefnodir; >+ switch(msEvent->scrollFlags) { >+ case nsMouseScrollEvent::kIsHorizontal: >+ prefDirection = prefhoriz; break; >+ case nsMouseScrollEvent::kIsVertical: >+ prefDirection = prefvert; break; >+ } >+ >+ prefModifier = prefnokey; >+ if(msEvent->isAlt) prefModifier = prefaltkey; >+ if(msEvent->isControl) prefModifier = prefctrlkey; >+ if(msEvent->isShift) prefModifier = prefshiftkey; >+ >+ rv = mPrefBranch->GetIntPref(PromiseFlatCString(prefmousewheel + >+ prefDirection + prefModifier + prefaction).get(), >+ &action); >+ if(NS_FAILED(rv)) break; >+ >+ rv = mPrefBranch->GetIntPref(PromiseFlatCString(prefmousewheel + >+ prefDirection + prefModifier + prefnumlines).get(), >+ &numLines); >+ >+ rv = mPrefBranch->GetBoolPref(PromiseFlatCString(prefmousewheel + >+ prefDirection + prefModifier + prefsysnumlines).get(), >+ &useSysNumLines); >+ if(NS_FAILED(rv)) break; >+ >+ // if numlines == 0 take the system value >+ if(numLines == 0 || useSysNumLines) >+ numLines = msEvent->delta; >+ // invert the given value if the system delta is negative >+ else if(msEvent->delta < 0) > numLines = -numLines; > > switch (action) { > case MOUSE_SCROLL_N_LINES: > case MOUSE_SCROLL_PAGE: > { >- DoWheelScroll(aPresContext, aTargetFrame, msEvent, numLines, >- (msEvent->scrollFlags & nsMouseScrollEvent::kIsHorizontal), >- (action == MOUSE_SCROLL_PAGE), PR_FALSE); >- >+ DoScrollText(aPresContext, aTargetFrame, msEvent, numLines, >+ (msEvent->scrollFlags & nsMouseScrollEvent::kIsHorizontal), >+ (action == MOUSE_SCROLL_PAGE), PR_FALSE); > } >- > break; > > case MOUSE_SCROLL_HISTORY: > { >- nsCOMPtr<nsISupports> pcContainer; >- mPresContext->GetContainer(getter_AddRefs(pcContainer)); >- if (pcContainer) { >- nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(pcContainer)); >- if (webNav) { >- if (msEvent->delta > 0) >- webNav->GoBack(); >- else >- webNav->GoForward(); >- } >- } >+ DoScrollHistory(numLines); > } > break; > > case MOUSE_SCROLL_TEXTSIZE: > { >- // Exclude form controls and XUL content. >- nsIContent* content = aTargetFrame->GetContent(); >- if (content && >- !content->IsContentOfType(nsIContent::eHTML_FORM_CONTROL) && >- !content->IsContentOfType(nsIContent::eXUL)) >- { >- ChangeTextSize((msEvent->delta > 0) ? 1 : -1); >- } >+ DoScrollTextsize(aTargetFrame, numLines); > } > break; > } >diff -u -r mozilla-orig/content/events/src/nsEventStateManager.h mozilla/content/events/src/nsEventStateManager.h >--- mozilla-orig/content/events/src/nsEventStateManager.h 2003-07-03 13:34:52.000000000 -0700 >+++ mozilla/content/events/src/nsEventStateManager.h 2004-03-21 15:15:14.000000000 -0800 >@@ -212,18 +212,23 @@ > void GetPrevDocShell(nsIDocShellTreeNode* aNode, > nsIDocShellTreeItem** aResult); > >- // These functions are for mousewheel scrolling >+ // These functions are for mousewheel scrolling and extended mouse buttons > nsIScrollableView* GetNearestScrollingView(nsIView* aView); >- nsresult GetParentScrollingView(nsMouseScrollEvent* aEvent, >+ nsresult GetParentScrollingView(nsInputEvent* aEvent, > nsIPresContext* aPresContext, > nsIFrame* &targetOuterFrame, > nsIPresContext* &presCtxOuter); >- nsresult DoWheelScroll(nsIPresContext* aPresContext, >- nsIFrame* aTargetFrame, >- nsMouseScrollEvent* aMSEvent, PRInt32 aNumLines, >- PRBool aScrollHorizontal, PRBool aScrollPage, PRBool aUseTargetFrame); >+ nsresult DoScrollText(nsIPresContext* aPresContext, >+ nsIFrame* aTargetFrame, >+ nsInputEvent* aEvent, >+ PRInt32 aNumLines, >+ PRBool aScrollHorizontal, >+ PRBool aScrollPage, >+ PRBool aUseTargetFrame); > void ForceViewUpdate(nsIView* aView); > nsresult getPrefBranch(); >+ nsresult DoScrollHistory(PRInt32 direction); >+ nsresult DoScrollTextsize(nsIFrame *aTargetFrame, PRInt32 adjustment); > nsresult ChangeTextSize(PRInt32 change); > // end mousewheel functions > >diff -u -r mozilla-orig/modules/libpref/src/init/all.js mozilla/modules/libpref/src/init/all.js >--- mozilla-orig/modules/libpref/src/init/all.js 2003-12-16 17:42:18.000000000 -0800 >+++ mozilla/modules/libpref/src/init/all.js 2004-03-21 15:15:14.000000000 -0800 >@@ -758,6 +758,28 @@ > pref("mousewheel.withaltkey.numlines",1); > pref("mousewheel.withaltkey.sysnumlines",false); > >+pref("mousewheel.horizscroll.withnokey.action",2); >+pref("mousewheel.horizscroll.withnokey.numlines",-1); >+pref("mousewheel.horizscroll.withnokey.sysnumlines",true); >+pref("mousewheel.horizscroll.withcontrolkey.action",0); >+pref("mousewheel.horizscroll.withcontrolkey.numlines",1); >+pref("mousewheel.horizscroll.withcontrolkey.sysnumlines",true); >+pref("mousewheel.horizscroll.withshiftkey.action",0); >+pref("mousewheel.horizscroll.withshiftkey.numlines",1); >+pref("mousewheel.horizscroll.withshiftkey.sysnumlines",false); >+pref("mousewheel.horizscroll.withaltkey.action",2); >+pref("mousewheel.horizscroll.withaltkey.numlines",-1); >+pref("mousewheel.horizscroll.withaltkey.sysnumlines",false); >+ >+pref("mousebuttonsextended.buttons.6.action.up", 2); >+pref("mousebuttonsextended.buttons.6.numlines.up", -1); >+pref("mousebuttonsextended.buttons.6.action.down", -1); >+pref("mousebuttonsextended.buttons.6.numlines.down", -1); >+pref("mousebuttonsextended.buttons.7.action.up", 2); >+pref("mousebuttonsextended.buttons.7.numlines.up", 1); >+pref("mousebuttonsextended.buttons.7.action.down", -1); >+pref("mousebuttonsextended.buttons.7.numlines.down", -1); >+ > pref("profile.confirm_automigration",true); > // profile.migration_behavior determines how the profiles root is set > // 0 - use NS_APP_USER_PROFILES_ROOT_DIR >diff -u -r mozilla-orig/widget/public/nsGUIEvent.h mozilla/widget/public/nsGUIEvent.h >--- mozilla-orig/widget/public/nsGUIEvent.h 2003-04-30 18:01:03.000000000 -0700 >+++ mozilla/widget/public/nsGUIEvent.h 2004-03-21 15:21:26.000000000 -0800 >@@ -22,6 +22,8 @@ > * Contributor(s): > * Makoto Kato <m_kato@ga2.so-net.ne.jp> > * Dean Tessman <dean_tessman@hotmail.com> >+ * Andrew Wellington <proton@wiretapped.net> >+ * Graham Dennis <u3952328@anu.edu.au> > * > * Alternatively, the contents of this file may be used under the terms of > * either the GNU General Public License Version 2 or later (the "GPL"), or >@@ -273,14 +275,57 @@ > * Mouse event > */ > >+/* >+ * Mozilla has to track a bunch of different information about mouse >+ * events: >+ * >+ * 1. The fact that it's a mouse event rather than some other input event. >+ * 2. The button that was pressed. >+ * 3. Whether the button went up or down. >+ * 4. The number of times the button has been clicked in close succession. >+ * >+ * The typical representation encodes everything into subtle >+ * variations on item 1. A symbol like NS_MOUSE_LEFT_BUTTON_DOWN >+ * expresses 1, 2 and 3, while NS_MOUSE_RIGHT_DOUBLECLICK expresses 1, >+ * 2 and 4. >+ * >+ * The symbol NS_MOUSE_EXTENDED_BUTTON (used by Gtk1 to handle mouse >+ * buttons 6, 7 and beyond) only expresses item 1. We have to store >+ * the other data about the event in an auxiliary structure. >+ * >+ * Note that this structure is passed along for all mouse events, >+ * whether or not they are "extended". But for "standard" mouse >+ * events, the "button" and "status" fields will have garbage. >+ * >+ * Gtk2 treats buttons 6 and 7 as horizontal scrollwheel movement, >+ * so it doesn't use the extended events. I don't know how it handles >+ * nine-button mice. >+ */ > struct nsMouseEvent : public nsInputEvent { >- /// The number of mouse clicks >- PRUint32 clickCount; >+ /// The number of mouse clicks; for both normal and extended >+ /// events >+ PRUint16 clickCount; >+ >+ /// button that got pressed; only for extended events; >+ /// this is exactly the button number in the X11 event. >+ PRUint8 button; >+ >+ /// whether the button went up/down; only for extended events; >+ /// use nsMouseEventStatus_* enumeration >+ PRUint8 status; >+ > /// Special return code for MOUSE_ACTIVATE to signal >- /// if the target accepts activation (1), or denies it (0) >+ /// if the target accepts activation (1), or denies it (0); >+ /// for both normal and extended events > PRBool acceptActivation; > }; > >+enum { >+ /// different types of events >+ nsMouseEventStatus_up, >+ nsMouseEventStatus_down >+}; >+ > /** > * Accessible event > */ >@@ -416,7 +461,6 @@ > nsDragDropEventStatus_eDrop > }; > >- > /** > * GUI MESSAGES > */ >@@ -510,6 +554,7 @@ > #define NS_MOUSE_ACTIVATE (NS_MOUSE_MESSAGE_START + 30) > #define NS_MOUSE_ENTER_SYNTH (NS_MOUSE_MESSAGE_START + 31) > #define NS_MOUSE_EXIT_SYNTH (NS_MOUSE_MESSAGE_START + 32) >+#define NS_MOUSE_EXTENDED_BUTTON (NS_MOUSE_MESSAGE_START + 33) > > #define NS_CONTEXTMENU_MESSAGE_START 500 > #define NS_CONTEXTMENU (NS_CONTEXTMENU_MESSAGE_START) >diff -u -r mozilla-orig/widget/src/gtk/nsWidget.cpp mozilla/widget/src/gtk/nsWidget.cpp >--- mozilla-orig/widget/src/gtk/nsWidget.cpp 2003-09-24 22:34:25.000000000 -0700 >+++ mozilla/widget/src/gtk/nsWidget.cpp 2004-03-21 15:15:14.000000000 -0800 >@@ -20,6 +20,8 @@ > * the Initial Developer. All Rights Reserved. > * > * Contributor(s): >+ * Andrew Wellington <proton@wiretapped.net> >+ * Graham Dennis <u3952328@anu.edu.au> > * > * Alternatively, the contents of this file may be used under the terms of > * either the GNU General Public License Version 2 or later (the "GPL"), or >@@ -1884,9 +1886,14 @@ > Release(); > return; > >- // Single-click default. > default: >- eventType = NS_MOUSE_LEFT_BUTTON_DOWN; >+ // No old-style mouse event is appropriate. >+ // Use the extended button event. >+ { >+ eventType = NS_MOUSE_EXTENDED_BUTTON; >+ event.button = aGdkButtonEvent->button; >+ event.status = nsMouseEventStatus_down; >+ } > break; > } > break; >@@ -1956,11 +1963,16 @@ > return; > > default: >- eventType = NS_MOUSE_LEFT_BUTTON_UP; >+ // No old-style mouse event is appropriate. >+ // Use the extended button event. >+ { >+ eventType = NS_MOUSE_EXTENDED_BUTTON; >+ event.status = nsMouseEventStatus_up; >+ event.button = aGdkButtonEvent->button; >+ } > break; > } > >- > InitMouseEvent(aGdkButtonEvent, event, eventType); > > if (sButtonMotionTarget) { >@@ -2082,6 +2094,7 @@ > nsMouseEvent &anEvent, > PRUint32 aEventType) > { >+ PRUint16 clickCount; > anEvent.message = aEventType; > anEvent.widget = this; > >@@ -2100,18 +2113,18 @@ > switch(aGdkButtonEvent->type) > { > case GDK_BUTTON_PRESS: >- anEvent.clickCount = 1; >+ clickCount = 1; > break; > case GDK_2BUTTON_PRESS: >- anEvent.clickCount = 2; >+ clickCount = 2; > break; > case GDK_3BUTTON_PRESS: >- anEvent.clickCount = 3; >+ clickCount = 3; > break; > default: >- anEvent.clickCount = 1; >- } >- >+ clickCount = 1; >+ } >+ anEvent.clickCount = clickCount; > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48314
: 29612