Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 48314
Collapse All | Expand All

(-)mozilla-orig/browser/app/profile/all.js (+22 lines)
Lines 531-536 Link Here
531
pref("mousewheel.withaltkey.numlines",1);
531
pref("mousewheel.withaltkey.numlines",1);
532
pref("mousewheel.withaltkey.sysnumlines",false);
532
pref("mousewheel.withaltkey.sysnumlines",false);
533
533
534
pref("mousewheel.horizscroll.withnokey.action",2);
535
pref("mousewheel.horizscroll.withnokey.numlines",-1);
536
pref("mousewheel.horizscroll.withnokey.sysnumlines",true);
537
pref("mousewheel.horizscroll.withcontrolkey.action",0);
538
pref("mousewheel.horizscroll.withcontrolkey.numlines",1);
539
pref("mousewheel.horizscroll.withcontrolkey.sysnumlines",true);
540
pref("mousewheel.horizscroll.withshiftkey.action",0);
541
pref("mousewheel.horizscroll.withshiftkey.numlines",1);
542
pref("mousewheel.horizscroll.withshiftkey.sysnumlines",false);
543
pref("mousewheel.horizscroll.withaltkey.action",2);
544
pref("mousewheel.horizscroll.withaltkey.numlines",-1);
545
pref("mousewheel.horizscroll.withaltkey.sysnumlines",false);
546
547
pref("mousebuttonsextended.buttons.6.action.up", 2);
548
pref("mousebuttonsextended.buttons.6.numlines.up", -1);
549
pref("mousebuttonsextended.buttons.6.action.down", -1);
550
pref("mousebuttonsextended.buttons.6.numlines.down", -1);
551
pref("mousebuttonsextended.buttons.7.action.up", 2);
552
pref("mousebuttonsextended.buttons.7.numlines.up", 1);
553
pref("mousebuttonsextended.buttons.7.action.down", -1);
554
pref("mousebuttonsextended.buttons.7.numlines.down", -1);
555
534
pref("profile.confirm_automigration",true);
556
pref("profile.confirm_automigration",true);
535
pref("profile.allow_automigration", false);   // setting to false bypasses automigration in the profile code
557
pref("profile.allow_automigration", false);   // setting to false bypasses automigration in the profile code
536
558
(-)mozilla-orig/content/events/src/nsEventStateManager.cpp (-88 / +174 lines)
Lines 22-27 Link Here
22
 * Contributor(s):
22
 * Contributor(s):
23
 *   Makoto Kato  <m_kato@ga2.so-net.ne.jp>
23
 *   Makoto Kato  <m_kato@ga2.so-net.ne.jp>
24
 *   Dean Tessman <dean_tessman@hotmail.com>
24
 *   Dean Tessman <dean_tessman@hotmail.com>
25
 *   Andrew Wellington <proton@wiretapped.net>
26
 *   Graham Dennis <u3952328@anu.edu.au>
27
 *   Thomas Kleffel <thomas.kleffel@maintech.de>
25
 *
28
 *
26
 * Alternatively, the contents of this file may be used under the terms of
29
 * Alternatively, the contents of this file may be used under the terms of
27
 * either the GNU General Public License Version 2 or later (the "GPL"), or
30
 * either the GNU General Public License Version 2 or later (the "GPL"), or
Lines 1536-1549 Link Here
1536
  return NS_OK;
1539
  return NS_OK;
1537
}
1540
}
1538
1541
1542
nsresult
1543
nsEventStateManager::DoScrollHistory(PRInt32 direction)
1544
{
1545
  nsCOMPtr<nsISupports> pcContainer;
1546
  mPresContext->GetContainer(getter_AddRefs(pcContainer));
1547
  if (pcContainer) {
1548
    nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(pcContainer));
1549
    if (webNav) {
1550
      // negative direction to go back one step, nonneg to go forward
1551
      if (direction < 0)
1552
        webNav->GoBack();
1553
      else
1554
        webNav->GoForward();
1555
    }
1556
  }
1557
  return NS_OK;
1558
}
1559
1560
nsresult
1561
nsEventStateManager::DoScrollTextsize(nsIFrame *aTargetFrame,
1562
                                      PRInt32 adjustment)
1563
{
1564
  // Exclude form controls and XUL content.
1565
  nsIContent *content = aTargetFrame->GetContent();
1566
  if (content &&
1567
      !content->IsContentOfType(nsIContent::eHTML_FORM_CONTROL) &&
1568
      !content->IsContentOfType(nsIContent::eXUL))
1569
    {
1570
      // positive adjustment to increase text size, non-positive to decrease
1571
      ChangeTextSize((adjustment > 0) ? 1 : -1);
1572
    }
1573
  return NS_OK;
1574
}
1539
1575
1540
//
1576
//
1541
nsresult
1577
nsresult
1542
nsEventStateManager::DoWheelScroll(nsIPresContext* aPresContext,
1578
nsEventStateManager::DoScrollText(nsIPresContext* aPresContext,
1543
                                   nsIFrame* aTargetFrame,
1579
                                  nsIFrame* aTargetFrame,
1544
                                   nsMouseScrollEvent* aMSEvent,
1580
                                  nsInputEvent* aEvent,
1545
                                   PRInt32 aNumLines, PRBool aScrollHorizontal, PRBool aScrollPage,
1581
                                  PRInt32 aNumLines,
1546
                                   PRBool aUseTargetFrame)
1582
                                  PRBool aScrollHorizontal,
1583
                                  PRBool aScrollPage,
1584
                                  PRBool aUseTargetFrame)
1547
{
1585
{
1548
  nsCOMPtr<nsIContent> targetContent = aTargetFrame->GetContent();
1586
  nsCOMPtr<nsIContent> targetContent = aTargetFrame->GetContent();
1549
  if (!targetContent)
1587
  if (!targetContent)
Lines 1570-1580 Link Here
1570
      }
1608
      }
1571
    }
1609
    }
1572
1610
1573
    mouseEvent->InitMouseEvent(NS_LITERAL_STRING("DOMMouseScroll"), PR_TRUE, PR_TRUE, 
1611
    mouseEvent->InitMouseEvent(NS_LITERAL_STRING("DOMMouseScroll"),
1612
                               PR_TRUE, PR_TRUE, 
1574
                               view, aNumLines,
1613
                               view, aNumLines,
1575
                               aMSEvent->refPoint.x, aMSEvent->refPoint.y,
1614
                               aEvent->refPoint.x, aEvent->refPoint.y,
1576
                               aMSEvent->point.x, aMSEvent->point.y,
1615
                               aEvent->point.x,    aEvent->point.y,
1577
                               aMSEvent->isControl, aMSEvent->isAlt, aMSEvent->isShift, aMSEvent->isMeta,
1616
                               aEvent->isControl,  aEvent->isAlt,
1617
                               aEvent->isShift,    aEvent->isMeta,
1578
                               0, nsnull);
1618
                               0, nsnull);
1579
    PRBool allowDefault;
1619
    PRBool allowDefault;
1580
    nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(targetContent));
1620
    nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(targetContent));
Lines 1595-1601 Link Here
1595
  nsMouseEvent mouseOutEvent;
1635
  nsMouseEvent mouseOutEvent;
1596
  mouseOutEvent.eventStructType = NS_MOUSE_EVENT;
1636
  mouseOutEvent.eventStructType = NS_MOUSE_EVENT;
1597
  mouseOutEvent.message = NS_MOUSE_EXIT;
1637
  mouseOutEvent.message = NS_MOUSE_EXIT;
1598
  mouseOutEvent.widget = aMSEvent->widget;
1638
  mouseOutEvent.widget = aEvent->widget;
1599
  mouseOutEvent.clickCount = 0;
1639
  mouseOutEvent.clickCount = 0;
1600
  mouseOutEvent.point = nsPoint(0,0);
1640
  mouseOutEvent.point = nsPoint(0,0);
1601
  mouseOutEvent.refPoint = nsPoint(0,0);
1641
  mouseOutEvent.refPoint = nsPoint(0,0);
Lines 1676-1683 Link Here
1676
          return NS_ERROR_FAILURE;
1716
          return NS_ERROR_FAILURE;
1677
        nsRect portRect = portView->GetBounds();
1717
        nsRect portRect = portView->GetBounds();
1678
1718
1679
        passToParent = aScrollHorizontal ? (xPos + portRect.width >= scrolledSize.width)
1719
        passToParent = (aScrollHorizontal ?
1680
          : (yPos + portRect.height >= scrolledSize.height);
1720
                        (xPos + portRect.width >= scrolledSize.width) :
1721
                        (yPos + portRect.height >= scrolledSize.height));
1681
      }
1722
      }
1682
    }
1723
    }
1683
1724
Lines 1710-1720 Link Here
1710
    nsIFrame* newFrame = nsnull;
1751
    nsIFrame* newFrame = nsnull;
1711
    nsCOMPtr<nsIPresContext> newPresContext;
1752
    nsCOMPtr<nsIPresContext> newPresContext;
1712
1753
1713
    rv = GetParentScrollingView(aMSEvent, aPresContext, newFrame,
1754
    rv = GetParentScrollingView(aEvent, aPresContext, newFrame,
1714
                                *getter_AddRefs(newPresContext));
1755
                                *getter_AddRefs(newPresContext));
1715
    if (NS_SUCCEEDED(rv) && newFrame)
1756
    if (NS_SUCCEEDED(rv) && newFrame)
1716
      return DoWheelScroll(newPresContext, newFrame, aMSEvent, aNumLines,
1757
      return DoScrollText(newPresContext, newFrame, aEvent, aNumLines,
1717
                           aScrollHorizontal, aScrollPage, PR_TRUE);
1758
                          aScrollHorizontal, aScrollPage, PR_TRUE);
1718
    else
1759
    else
1719
      return NS_ERROR_FAILURE;
1760
      return NS_ERROR_FAILURE;
1720
  }
1761
  }
Lines 1723-1729 Link Here
1723
}
1764
}
1724
1765
1725
nsresult
1766
nsresult
1726
nsEventStateManager::GetParentScrollingView(nsMouseScrollEvent *aEvent,
1767
nsEventStateManager::GetParentScrollingView(nsInputEvent *aEvent,
1727
                                            nsIPresContext* aPresContext,
1768
                                            nsIPresContext* aPresContext,
1728
                                            nsIFrame* &targetOuterFrame,
1769
                                            nsIFrame* &targetOuterFrame,
1729
                                            nsIPresContext* &presCtxOuter)
1770
                                            nsIPresContext* &presCtxOuter)
Lines 1911-1916 Link Here
1911
      }
1952
      }
1912
    }
1953
    }
1913
    break;
1954
    break;
1955
  case NS_MOUSE_EXTENDED_BUTTON:
1956
    {
1957
      nsMouseEvent *mEvent = (nsMouseEvent* )aEvent;
1958
      nsresult rv;
1959
      nsCAutoString actionKey, numLinesKey;
1960
      PRInt32 action;
1961
      PRInt32 numLines;
1962
1963
      NS_NAMED_LITERAL_CSTRING(prefbase, "mousebuttonsextended.buttons.");
1964
      NS_NAMED_LITERAL_CSTRING(prefaction, ".action");
1965
      NS_NAMED_LITERAL_CSTRING(prefnumlines, ".numlines");
1966
1967
      nsCAutoString prefstatus(((mEvent->status == nsMouseEventStatus_up)
1968
                                ? ".up" : ".down"));
1969
1970
      rv = getPrefBranch();
1971
      if (NS_FAILED(rv)) return rv;
1972
      
1973
      actionKey = prefbase;
1974
      actionKey.AppendInt(mEvent->button);
1975
      actionKey.Append(prefaction);
1976
      actionKey.Append(prefstatus);
1977
      rv = mPrefBranch->GetIntPref(PromiseFlatCString(actionKey).get(),
1978
                                   &action);
1979
      if (NS_FAILED(rv)) break;
1980
1981
      numLinesKey = prefbase;
1982
      numLinesKey.AppendInt(mEvent->button);
1983
      numLinesKey.Append(prefnumlines);
1984
      numLinesKey.Append(prefstatus);
1985
      rv = mPrefBranch->GetIntPref(PromiseFlatCString(numLinesKey).get(),
1986
                                   &numLines);
1987
      if (NS_FAILED(rv)) break;
1988
      
1989
      switch (action) {
1990
1991
      case MOUSE_SCROLL_N_LINES:
1992
      case MOUSE_SCROLL_PAGE:
1993
        {
1994
          DoScrollText(aPresContext, aTargetFrame, mEvent, numLines,
1995
                       0, (action == MOUSE_SCROLL_PAGE), PR_FALSE);
1996
        }
1997
        break;
1998
1999
      case MOUSE_SCROLL_HISTORY:
2000
        {
2001
          DoScrollHistory(numLines);
2002
        }
2003
        break;
2004
2005
      case MOUSE_SCROLL_TEXTSIZE:
2006
        {
2007
          DoScrollTextsize(aTargetFrame, numLines);
2008
        }
2009
        break;
2010
2011
      default:  // Including -1 (do nothing)
2012
        break;
2013
      }          
2014
    }
2015
    break;
1914
  case NS_MOUSE_SCROLL:
2016
  case NS_MOUSE_SCROLL:
1915
    if (nsEventStatus_eConsumeNoDefault != *aStatus) {
2017
    if (nsEventStatus_eConsumeNoDefault != *aStatus) {
1916
      nsresult rv;
2018
      nsresult rv;
Lines 1920-2014 Link Here
1920
      nsMouseScrollEvent *msEvent = (nsMouseScrollEvent*) aEvent;
2022
      nsMouseScrollEvent *msEvent = (nsMouseScrollEvent*) aEvent;
1921
      PRInt32 action = 0;
2023
      PRInt32 action = 0;
1922
      PRInt32 numLines = 0;
2024
      PRInt32 numLines = 0;
1923
      PRBool aBool;
2025
      PRBool useSysNumLines;
1924
      if (msEvent->isShift) {
1925
        mPrefBranch->GetIntPref("mousewheel.withshiftkey.action", &action);
1926
        mPrefBranch->GetBoolPref("mousewheel.withshiftkey.sysnumlines",
1927
                                 &aBool);
1928
        if (aBool) {
1929
          numLines = msEvent->delta;
1930
          if (msEvent->scrollFlags & nsMouseScrollEvent::kIsFullPage)
1931
            action = MOUSE_SCROLL_PAGE;
1932
        }
1933
        else
1934
          mPrefBranch->GetIntPref("mousewheel.withshiftkey.numlines",
1935
                                  &numLines);
1936
      } else if (msEvent->isControl) {
1937
        mPrefBranch->GetIntPref("mousewheel.withcontrolkey.action", &action);
1938
        mPrefBranch->GetBoolPref("mousewheel.withcontrolkey.sysnumlines",
1939
                                 &aBool);
1940
        if (aBool) {
1941
          numLines = msEvent->delta;
1942
          if (msEvent->scrollFlags & nsMouseScrollEvent::kIsFullPage)
1943
            action = MOUSE_SCROLL_PAGE;          
1944
        }
1945
        else
1946
          mPrefBranch->GetIntPref("mousewheel.withcontrolkey.numlines",
1947
                                  &numLines);
1948
      } else if (msEvent->isAlt) {
1949
        mPrefBranch->GetIntPref("mousewheel.withaltkey.action", &action);
1950
        mPrefBranch->GetBoolPref("mousewheel.withaltkey.sysnumlines", &aBool);
1951
        if (aBool) {
1952
          numLines = msEvent->delta;
1953
          if (msEvent->scrollFlags & nsMouseScrollEvent::kIsFullPage)
1954
            action = MOUSE_SCROLL_PAGE;
1955
        }
1956
        else
1957
          mPrefBranch->GetIntPref("mousewheel.withaltkey.numlines",
1958
                                  &numLines);
1959
      } else {
1960
        mPrefBranch->GetIntPref("mousewheel.withnokey.action", &action);
1961
        mPrefBranch->GetBoolPref("mousewheel.withnokey.sysnumlines", &aBool);
1962
        if (aBool) {
1963
          numLines = msEvent->delta;
1964
          if (msEvent->scrollFlags & nsMouseScrollEvent::kIsFullPage)
1965
            action = MOUSE_SCROLL_PAGE;
1966
        }
1967
        else
1968
          mPrefBranch->GetIntPref("mousewheel.withnokey.numlines", &numLines);
1969
      }
1970
2026
1971
      if ((msEvent->delta < 0) && (numLines > 0))
2027
      NS_NAMED_LITERAL_CSTRING(prefmousewheel, "mousewheel");
2028
      NS_NAMED_LITERAL_CSTRING(prefhoriz, ".horizscroll");
2029
      NS_NAMED_LITERAL_CSTRING(prefvert, "");
2030
      NS_NAMED_LITERAL_CSTRING(prefnodir, "");
2031
      NS_NAMED_LITERAL_CSTRING(prefnokey, ".withnokey");
2032
      NS_NAMED_LITERAL_CSTRING(prefshiftkey, ".withshiftkey");
2033
      NS_NAMED_LITERAL_CSTRING(prefctrlkey, ".withcontrolkey");
2034
      NS_NAMED_LITERAL_CSTRING(prefaltkey, ".withaltkey");
2035
      NS_NAMED_LITERAL_CSTRING(prefaction, ".action");
2036
      NS_NAMED_LITERAL_CSTRING(prefsysnumlines, ".sysnumlines");
2037
      NS_NAMED_LITERAL_CSTRING(prefnumlines, ".numlines");
2038
2039
      nsCString prefDirection;
2040
      nsCString prefModifier;
2041
2042
      //if delta==0 we have nothing to do!
2043
      if(msEvent->delta == 0) break;
2044
2045
      prefDirection = prefnodir;
2046
      switch(msEvent->scrollFlags) {
2047
        case nsMouseScrollEvent::kIsHorizontal:
2048
          prefDirection = prefhoriz; break;
2049
        case nsMouseScrollEvent::kIsVertical:
2050
          prefDirection = prefvert; break;
2051
      }
2052
2053
      prefModifier = prefnokey;
2054
      if(msEvent->isAlt)       prefModifier = prefaltkey;
2055
      if(msEvent->isControl)   prefModifier = prefctrlkey;
2056
      if(msEvent->isShift)     prefModifier = prefshiftkey;
2057
2058
      rv = mPrefBranch->GetIntPref(PromiseFlatCString(prefmousewheel + 
2059
			  prefDirection + prefModifier + prefaction).get(),
2060
		      &action);
2061
      if(NS_FAILED(rv)) break;
2062
2063
      rv = mPrefBranch->GetIntPref(PromiseFlatCString(prefmousewheel + 
2064
			  prefDirection + prefModifier + prefnumlines).get(),
2065
		      &numLines);
2066
2067
      rv = mPrefBranch->GetBoolPref(PromiseFlatCString(prefmousewheel + 
2068
			  prefDirection + prefModifier + prefsysnumlines).get(),
2069
		      &useSysNumLines);
2070
      if(NS_FAILED(rv)) break;
2071
2072
      // if numlines == 0 take the system value
2073
      if(numLines == 0 || useSysNumLines) 
2074
        numLines = msEvent->delta;
2075
      // invert the given value if the system delta is negative
2076
      else if(msEvent->delta < 0)
1972
        numLines = -numLines;
2077
        numLines = -numLines;
1973
2078
1974
      switch (action) {
2079
      switch (action) {
1975
      case MOUSE_SCROLL_N_LINES:
2080
      case MOUSE_SCROLL_N_LINES:
1976
      case MOUSE_SCROLL_PAGE:
2081
      case MOUSE_SCROLL_PAGE:
1977
        {
2082
        {
1978
          DoWheelScroll(aPresContext, aTargetFrame, msEvent, numLines,
2083
          DoScrollText(aPresContext, aTargetFrame, msEvent, numLines,
1979
                        (msEvent->scrollFlags & nsMouseScrollEvent::kIsHorizontal),
2084
                       (msEvent->scrollFlags & nsMouseScrollEvent::kIsHorizontal),
1980
                        (action == MOUSE_SCROLL_PAGE), PR_FALSE);
2085
                       (action == MOUSE_SCROLL_PAGE), PR_FALSE);
1981
1982
        }
2086
        }
1983
1984
        break;
2087
        break;
1985
2088
1986
      case MOUSE_SCROLL_HISTORY:
2089
      case MOUSE_SCROLL_HISTORY:
1987
        {
2090
        {
1988
          nsCOMPtr<nsISupports> pcContainer;
2091
          DoScrollHistory(numLines);
1989
          mPresContext->GetContainer(getter_AddRefs(pcContainer));
1990
          if (pcContainer) {
1991
            nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(pcContainer));
1992
            if (webNav) {
1993
              if (msEvent->delta > 0)
1994
                 webNav->GoBack();
1995
              else
1996
                 webNav->GoForward();
1997
            }
1998
          }
1999
        }
2092
        }
2000
        break;
2093
        break;
2001
2094
2002
      case MOUSE_SCROLL_TEXTSIZE:
2095
      case MOUSE_SCROLL_TEXTSIZE:
2003
        {
2096
        {
2004
          // Exclude form controls and XUL content.
2097
          DoScrollTextsize(aTargetFrame, numLines);
2005
          nsIContent* content = aTargetFrame->GetContent();
2006
          if (content &&
2007
              !content->IsContentOfType(nsIContent::eHTML_FORM_CONTROL) &&
2008
              !content->IsContentOfType(nsIContent::eXUL))
2009
            {
2010
              ChangeTextSize((msEvent->delta > 0) ? 1 : -1);
2011
            }
2012
        }
2098
        }
2013
        break;
2099
        break;
2014
      }
2100
      }
(-)mozilla-orig/content/events/src/nsEventStateManager.h (-6 / +11 lines)
Lines 212-229 Link Here
212
  void GetPrevDocShell(nsIDocShellTreeNode* aNode,
212
  void GetPrevDocShell(nsIDocShellTreeNode* aNode,
213
                       nsIDocShellTreeItem** aResult);
213
                       nsIDocShellTreeItem** aResult);
214
214
215
  // These functions are for mousewheel scrolling
215
  // These functions are for mousewheel scrolling and extended mouse buttons
216
  nsIScrollableView* GetNearestScrollingView(nsIView* aView);
216
  nsIScrollableView* GetNearestScrollingView(nsIView* aView);
217
  nsresult GetParentScrollingView(nsMouseScrollEvent* aEvent,
217
  nsresult GetParentScrollingView(nsInputEvent* aEvent,
218
                                  nsIPresContext* aPresContext,
218
                                  nsIPresContext* aPresContext,
219
                                  nsIFrame* &targetOuterFrame,
219
                                  nsIFrame* &targetOuterFrame,
220
                                  nsIPresContext* &presCtxOuter);
220
                                  nsIPresContext* &presCtxOuter);
221
  nsresult DoWheelScroll(nsIPresContext* aPresContext,
221
  nsresult DoScrollText(nsIPresContext* aPresContext,
222
                         nsIFrame* aTargetFrame,
222
                        nsIFrame* aTargetFrame,
223
                         nsMouseScrollEvent* aMSEvent, PRInt32 aNumLines,
223
                        nsInputEvent* aEvent,
224
                         PRBool aScrollHorizontal, PRBool aScrollPage, PRBool aUseTargetFrame);
224
                        PRInt32 aNumLines,
225
                        PRBool aScrollHorizontal,
226
                        PRBool aScrollPage,
227
                        PRBool aUseTargetFrame);
225
  void ForceViewUpdate(nsIView* aView);
228
  void ForceViewUpdate(nsIView* aView);
226
  nsresult getPrefBranch();
229
  nsresult getPrefBranch();
230
  nsresult DoScrollHistory(PRInt32 direction);
231
  nsresult DoScrollTextsize(nsIFrame *aTargetFrame, PRInt32 adjustment);
227
  nsresult ChangeTextSize(PRInt32 change);
232
  nsresult ChangeTextSize(PRInt32 change);
228
  // end mousewheel functions
233
  // end mousewheel functions
229
234
(-)mozilla-orig/modules/libpref/src/init/all.js (+22 lines)
Lines 758-763 Link Here
758
pref("mousewheel.withaltkey.numlines",1);
758
pref("mousewheel.withaltkey.numlines",1);
759
pref("mousewheel.withaltkey.sysnumlines",false);
759
pref("mousewheel.withaltkey.sysnumlines",false);
760
760
761
pref("mousewheel.horizscroll.withnokey.action",2);
762
pref("mousewheel.horizscroll.withnokey.numlines",-1);	
763
pref("mousewheel.horizscroll.withnokey.sysnumlines",true);
764
pref("mousewheel.horizscroll.withcontrolkey.action",0);
765
pref("mousewheel.horizscroll.withcontrolkey.numlines",1);
766
pref("mousewheel.horizscroll.withcontrolkey.sysnumlines",true);
767
pref("mousewheel.horizscroll.withshiftkey.action",0);
768
pref("mousewheel.horizscroll.withshiftkey.numlines",1);
769
pref("mousewheel.horizscroll.withshiftkey.sysnumlines",false);
770
pref("mousewheel.horizscroll.withaltkey.action",2);
771
pref("mousewheel.horizscroll.withaltkey.numlines",-1);
772
pref("mousewheel.horizscroll.withaltkey.sysnumlines",false);
773
774
pref("mousebuttonsextended.buttons.6.action.up", 2);
775
pref("mousebuttonsextended.buttons.6.numlines.up", -1);
776
pref("mousebuttonsextended.buttons.6.action.down", -1);
777
pref("mousebuttonsextended.buttons.6.numlines.down", -1);
778
pref("mousebuttonsextended.buttons.7.action.up", 2);
779
pref("mousebuttonsextended.buttons.7.numlines.up", 1);
780
pref("mousebuttonsextended.buttons.7.action.down", -1);
781
pref("mousebuttonsextended.buttons.7.numlines.down", -1);
782
761
pref("profile.confirm_automigration",true);
783
pref("profile.confirm_automigration",true);
762
// profile.migration_behavior determines how the profiles root is set
784
// profile.migration_behavior determines how the profiles root is set
763
// 0 - use NS_APP_USER_PROFILES_ROOT_DIR
785
// 0 - use NS_APP_USER_PROFILES_ROOT_DIR
(-)mozilla-orig/widget/public/nsGUIEvent.h (-4 / +49 lines)
Lines 22-27 Link Here
22
 * Contributor(s):
22
 * Contributor(s):
23
 *   Makoto Kato  <m_kato@ga2.so-net.ne.jp>
23
 *   Makoto Kato  <m_kato@ga2.so-net.ne.jp>
24
 *   Dean Tessman <dean_tessman@hotmail.com>
24
 *   Dean Tessman <dean_tessman@hotmail.com>
25
 *   Andrew Wellington <proton@wiretapped.net>
26
 *   Graham Dennis <u3952328@anu.edu.au>
25
 *
27
 *
26
 * Alternatively, the contents of this file may be used under the terms of
28
 * Alternatively, the contents of this file may be used under the terms of
27
 * either the GNU General Public License Version 2 or later (the "GPL"), or 
29
 * either the GNU General Public License Version 2 or later (the "GPL"), or 
Lines 273-286 Link Here
273
 * Mouse event
275
 * Mouse event
274
 */
276
 */
275
277
278
/*
279
 * Mozilla has to track a bunch of different information about mouse
280
 * events:
281
 *
282
 * 1. The fact that it's a mouse event rather than some other input event.
283
 * 2. The button that was pressed.
284
 * 3. Whether the button went up or down.
285
 * 4. The number of times the button has been clicked in close succession.
286
 *
287
 * The typical representation encodes everything into subtle
288
 * variations on item 1.  A symbol like NS_MOUSE_LEFT_BUTTON_DOWN
289
 * expresses 1, 2 and 3, while NS_MOUSE_RIGHT_DOUBLECLICK expresses 1,
290
 * 2 and 4.
291
 *
292
 * The symbol NS_MOUSE_EXTENDED_BUTTON (used by Gtk1 to handle mouse
293
 * buttons 6, 7 and beyond) only expresses item 1.  We have to store
294
 * the other data about the event in an auxiliary structure.
295
 *
296
 * Note that this structure is passed along for all mouse events,
297
 * whether or not they are "extended".  But for "standard" mouse
298
 * events, the "button" and "status" fields will have garbage.
299
 *
300
 * Gtk2 treats buttons 6 and 7 as horizontal scrollwheel movement,
301
 * so it doesn't use the extended events.  I don't know how it handles
302
 * nine-button mice.
303
 */
276
struct nsMouseEvent : public nsInputEvent {
304
struct nsMouseEvent : public nsInputEvent {
277
                /// The number of mouse clicks
305
                /// The number of mouse clicks; for both normal and extended
278
    PRUint32        clickCount;          
306
                /// events
307
    PRUint16        clickCount;          
308
309
                /// button that got pressed; only for extended events;
310
                /// this is exactly the button number in the X11 event.
311
    PRUint8         button;
312
313
                /// whether the button went up/down; only for extended events;
314
                /// use nsMouseEventStatus_* enumeration
315
    PRUint8         status;
316
279
                /// Special return code for MOUSE_ACTIVATE to signal
317
                /// Special return code for MOUSE_ACTIVATE to signal
280
                /// if the target accepts activation (1), or denies it (0)
318
                /// if the target accepts activation (1), or denies it (0);
319
                /// for both normal and extended events
281
    PRBool          acceptActivation;           
320
    PRBool          acceptActivation;           
282
};
321
};
283
322
323
enum {
324
  /// different types of events
325
  nsMouseEventStatus_up,
326
  nsMouseEventStatus_down
327
};
328
284
/**
329
/**
285
 * Accessible event
330
 * Accessible event
286
 */
331
 */
Lines 416-422 Link Here
416
  nsDragDropEventStatus_eDrop  
461
  nsDragDropEventStatus_eDrop  
417
};
462
};
418
463
419
420
/**
464
/**
421
 * GUI MESSAGES
465
 * GUI MESSAGES
422
 */
466
 */
Lines 510-515 Link Here
510
#define NS_MOUSE_ACTIVATE               (NS_MOUSE_MESSAGE_START + 30)
554
#define NS_MOUSE_ACTIVATE               (NS_MOUSE_MESSAGE_START + 30)
511
#define NS_MOUSE_ENTER_SYNTH            (NS_MOUSE_MESSAGE_START + 31)
555
#define NS_MOUSE_ENTER_SYNTH            (NS_MOUSE_MESSAGE_START + 31)
512
#define NS_MOUSE_EXIT_SYNTH             (NS_MOUSE_MESSAGE_START + 32)
556
#define NS_MOUSE_EXIT_SYNTH             (NS_MOUSE_MESSAGE_START + 32)
557
#define NS_MOUSE_EXTENDED_BUTTON        (NS_MOUSE_MESSAGE_START + 33)
513
558
514
#define NS_CONTEXTMENU_MESSAGE_START    500
559
#define NS_CONTEXTMENU_MESSAGE_START    500
515
#define NS_CONTEXTMENU                  (NS_CONTEXTMENU_MESSAGE_START)
560
#define NS_CONTEXTMENU                  (NS_CONTEXTMENU_MESSAGE_START)
(-)mozilla-orig/widget/src/gtk/nsWidget.cpp (-10 / +23 lines)
Lines 20-25 Link Here
20
 * the Initial Developer. All Rights Reserved.
20
 * the Initial Developer. All Rights Reserved.
21
 *
21
 *
22
 * Contributor(s):
22
 * Contributor(s):
23
 *   Andrew Wellington <proton@wiretapped.net>
24
 *   Graham Dennis <u3952328@anu.edu.au>
23
 *
25
 *
24
 * Alternatively, the contents of this file may be used under the terms of
26
 * Alternatively, the contents of this file may be used under the terms of
25
 * either the GNU General Public License Version 2 or later (the "GPL"), or 
27
 * either the GNU General Public License Version 2 or later (the "GPL"), or 
Lines 1884-1892 Link Here
1884
      Release();
1886
      Release();
1885
      return;
1887
      return;
1886
1888
1887
      // Single-click default.
1888
    default:
1889
    default:
1889
      eventType = NS_MOUSE_LEFT_BUTTON_DOWN;
1890
      // No old-style mouse event is appropriate.
1891
      // Use the extended button event.
1892
      {
1893
        eventType = NS_MOUSE_EXTENDED_BUTTON;
1894
        event.button = aGdkButtonEvent->button;
1895
        event.status = nsMouseEventStatus_down;
1896
      }
1890
      break;
1897
      break;
1891
    }
1898
    }
1892
    break;
1899
    break;
Lines 1956-1966 Link Here
1956
    return;
1963
    return;
1957
1964
1958
  default:
1965
  default:
1959
    eventType = NS_MOUSE_LEFT_BUTTON_UP;
1966
      // No old-style mouse event is appropriate.
1967
      // Use the extended button event.
1968
    {
1969
      eventType = NS_MOUSE_EXTENDED_BUTTON;
1970
      event.status = nsMouseEventStatus_up;
1971
      event.button = aGdkButtonEvent->button;
1972
    }
1960
    break;
1973
    break;
1961
	}
1974
	}
1962
1975
1963
1964
  InitMouseEvent(aGdkButtonEvent, event, eventType);
1976
  InitMouseEvent(aGdkButtonEvent, event, eventType);
1965
1977
1966
  if (sButtonMotionTarget) {
1978
  if (sButtonMotionTarget) {
Lines 2082-2087 Link Here
2082
						 nsMouseEvent &anEvent,
2094
						 nsMouseEvent &anEvent,
2083
						 PRUint32   aEventType)
2095
						 PRUint32   aEventType)
2084
{
2096
{
2097
  PRUint16 clickCount;
2085
  anEvent.message = aEventType;
2098
  anEvent.message = aEventType;
2086
  anEvent.widget  = this;
2099
  anEvent.widget  = this;
2087
2100
Lines 2100-2117 Link Here
2100
    switch(aGdkButtonEvent->type)
2113
    switch(aGdkButtonEvent->type)
2101
      {
2114
      {
2102
      case GDK_BUTTON_PRESS:
2115
      case GDK_BUTTON_PRESS:
2103
        anEvent.clickCount = 1;
2116
        clickCount = 1;
2104
        break;
2117
        break;
2105
      case GDK_2BUTTON_PRESS:
2118
      case GDK_2BUTTON_PRESS:
2106
        anEvent.clickCount = 2;
2119
        clickCount = 2;
2107
        break;
2120
        break;
2108
      case GDK_3BUTTON_PRESS:
2121
      case GDK_3BUTTON_PRESS:
2109
        anEvent.clickCount = 3;
2122
        clickCount = 3;
2110
        break;
2123
        break;
2111
      default:
2124
      default:
2112
        anEvent.clickCount = 1;
2125
        clickCount = 1;
2113
    }
2126
      }
2114
2127
    anEvent.clickCount = clickCount;
2115
  }
2128
  }
2116
}
2129
}
2117
2130

Return to bug 48314