Bug 1489963 - [Linux/Gtk] Draw scrollbars on inactive documents with dropdown state, r=jhorak
authorMartin Stransky <stransky@redhat.com>
Thu, 13 Sep 2018 09:40:36 +0000
changeset 436147 70c9cb74c8446bd1ce67040a003a901ffd878fda
parent 436146 a3934bdc3c6897f884d861f494fc337c5e686351
child 436148 3aa7f81bfcb559a6f060283e5884177764129151
push id69214
push userdgottwald@mozilla.com
push dateThu, 13 Sep 2018 10:05:44 +0000
treeherderautoland@70c9cb74c844 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak
bugs1489963
milestone64.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 1489963 - [Linux/Gtk] Draw scrollbars on inactive documents with dropdown state, r=jhorak Differential Revision: https://phabricator.services.mozilla.com/D5746
widget/gtk/nsNativeThemeGTK.cpp
--- a/widget/gtk/nsNativeThemeGTK.cpp
+++ b/widget/gtk/nsNativeThemeGTK.cpp
@@ -449,16 +449,30 @@ nsNativeThemeGTK::GetGtkWidgetAndState(S
     if (aWidgetType == StyleAppearance::MozWindowTitlebar ||
         aWidgetType == StyleAppearance::MozWindowTitlebarMaximized ||
         aWidgetType == StyleAppearance::MozWindowButtonClose ||
         aWidgetType == StyleAppearance::MozWindowButtonMinimize ||
         aWidgetType == StyleAppearance::MozWindowButtonMaximize ||
         aWidgetType == StyleAppearance::MozWindowButtonRestore) {
       aState->backdrop = !nsWindow::GetTopLevelWindowActiveState(aFrame);
     }
+
+    if (aWidgetType ==  StyleAppearance::ScrollbarbuttonUp ||
+        aWidgetType ==  StyleAppearance::ScrollbarbuttonDown ||
+        aWidgetType ==  StyleAppearance::ScrollbarbuttonLeft ||
+        aWidgetType ==  StyleAppearance::ScrollbarbuttonRight ||
+        aWidgetType == StyleAppearance::ScrollbarVertical ||
+        aWidgetType == StyleAppearance::ScrollbarHorizontal ||
+        aWidgetType == StyleAppearance::ScrollbartrackHorizontal ||
+        aWidgetType == StyleAppearance::ScrollbartrackVertical ||
+        aWidgetType == StyleAppearance::ScrollbarthumbVertical||
+        aWidgetType == StyleAppearance::ScrollbarthumbHorizontal) {
+      EventStates docState = aFrame->GetContent()->OwnerDoc()->GetDocumentState();
+      aState->backdrop = docState.HasState(NS_DOCUMENT_STATE_WINDOW_INACTIVE);
+    }
   }
 
   switch (aWidgetType) {
   case StyleAppearance::Button:
     if (aWidgetFlags)
       *aWidgetFlags = GTK_RELIEF_NORMAL;
     aGtkWidgetType = MOZ_GTK_BUTTON;
     break;
@@ -2109,13 +2123,23 @@ nsNativeThemeGTK::WidgetAppearanceDepend
 {
   switch (aWidgetType) {
     case StyleAppearance::MozWindowTitlebar:
     case StyleAppearance::MozWindowTitlebarMaximized:
     case StyleAppearance::MozWindowButtonClose:
     case StyleAppearance::MozWindowButtonMinimize:
     case StyleAppearance::MozWindowButtonMaximize:
     case StyleAppearance::MozWindowButtonRestore:
+    case StyleAppearance::ScrollbarbuttonUp:
+    case StyleAppearance::ScrollbarbuttonDown:
+    case StyleAppearance::ScrollbarbuttonLeft:
+    case StyleAppearance::ScrollbarbuttonRight:
+    case StyleAppearance::ScrollbarVertical:
+    case StyleAppearance::ScrollbarHorizontal:
+    case StyleAppearance::ScrollbartrackHorizontal:
+    case StyleAppearance::ScrollbartrackVertical:
+    case StyleAppearance::ScrollbarthumbVertical:
+    case StyleAppearance::ScrollbarthumbHorizontal:
       return true;
     default:
       return false;
   }
 }