Bug 1167239 - Make GTK button activity require hover. r=karlt
authorAndrew Comminos <acomminos@mozilla.com>
Tue, 16 Jun 2015 07:58:00 -0400
changeset 249163 709775ec03a28f0af8a3fea313435862f0e9800b
parent 249162 00113dc99ee970f54756e9e8a64caacfd5715db3
child 249164 05bd2af568e227f30bd4104a00f9939e8927140e
push id61153
push userryanvm@gmail.com
push dateTue, 16 Jun 2015 19:06:09 +0000
treeherdermozilla-inbound@e8b8cdc974ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1167239
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1167239 - Make GTK button activity require hover. r=karlt
widget/gtk/nsNativeThemeGTK.cpp
--- a/widget/gtk/nsNativeThemeGTK.cpp
+++ b/widget/gtk/nsNativeThemeGTK.cpp
@@ -254,16 +254,23 @@ nsNativeThemeGTK::GetGtkWidgetAndState(u
         aState->disabled = FALSE;
         aState->active  = FALSE;
         aState->inHover = FALSE;
         aState->isDefault = FALSE;
         aState->canDefault = FALSE;
 
         aState->focused = TRUE;
         aState->depressed = TRUE; // see moz_gtk_entry_paint()
+      } else if (aWidgetType == NS_THEME_BUTTON ||
+                 aWidgetType == NS_THEME_TOOLBAR_BUTTON ||
+                 aWidgetType == NS_THEME_TOOLBAR_DUAL_BUTTON ||
+                 aWidgetType == NS_THEME_TOOLBAR_BUTTON_DROPDOWN ||
+                 aWidgetType == NS_THEME_DROPDOWN ||
+                 aWidgetType == NS_THEME_DROPDOWN_BUTTON) {
+        aState->active &= aState->inHover;
       }
 
       if (IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XUL)) {
         // For these widget types, some element (either a child or parent)
         // actually has element focus, so we check the focused attribute
         // to see whether to draw in the focused state.
         if (aWidgetType == NS_THEME_NUMBER_INPUT ||
             aWidgetType == NS_THEME_TEXTFIELD ||