Bug 1263677 - Disable windows.ui.viewmanagement.h usage on mingw. r=jimm
authorJacek Caban <jacek@codeweavers.com>
Tue, 12 Apr 2016 12:38:00 +0200
changeset 292787 7a3813330df614bf841937c242be13f36424883f
parent 292786 13bb9febca01431b9ed8217be841b615156d915e
child 292788 774962b54f183a2952cdd22d5a9e185f247d211f
push id74977
push userjacek@codeweavers.com
push dateTue, 12 Apr 2016 10:38:29 +0000
treeherdermozilla-inbound@7a3813330df6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1263677
milestone48.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 1263677 - Disable windows.ui.viewmanagement.h usage on mingw. r=jimm
widget/windows/WindowsUIUtils.cpp
--- a/widget/windows/WindowsUIUtils.cpp
+++ b/widget/windows/WindowsUIUtils.cpp
@@ -15,16 +15,19 @@
 #include "nsIAppShellService.h"
 #include "nsAppShellCID.h"
 #include "nsIXULWindow.h"
 #include "mozilla/Services.h"
 #include "mozilla/WindowsVersion.h"
 #include "nsString.h"
 #include "nsIWidget.h"
 
+/* mingw currently doesn't support windows.ui.viewmanagement.h, so we disable it until it's fixed. */
+#ifndef __MINGW32__
+
 #include <windows.ui.viewmanagement.h>
 
 #pragma comment(lib, "runtimeobject.lib")
 
 using namespace mozilla;
 using namespace ABI::Windows::UI;
 using namespace ABI::Windows::UI::ViewManagement;
 using namespace Microsoft::WRL;
@@ -80,16 +83,18 @@ typedef interface IUIViewSettingsInterop
 MIDL_INTERFACE("3694dbf9-8f68-44be-8ff5-195c98ede8a6")
 IUIViewSettingsInterop : public IInspectable
 {
 public:
   virtual HRESULT STDMETHODCALLTYPE GetForWindow(HWND hwnd, REFIID riid, void **ppv) = 0;
 };
 #endif
 
+#endif
+
 WindowsUIUtils::WindowsUIUtils() :
   mInTabletMode(eTabletModeUnknown)
 {
 }
 
 WindowsUIUtils::~WindowsUIUtils()
 {
 }
@@ -108,16 +113,17 @@ WindowsUIUtils::GetInTabletMode(bool* aR
   }
   *aResult = mInTabletMode == eTabletModeOn;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 WindowsUIUtils::UpdateTabletModeState()
 {
+#ifndef __MINGW32__
   if (!IsWin10OrLater()) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
   nsCOMPtr<nsIXULWindow> hiddenWindow;
 
   nsresult rv = appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow));
@@ -163,12 +169,13 @@ WindowsUIUtils::UpdateTabletModeState()
           NS_NAMED_LITERAL_STRING(tabletMode, "tablet-mode");
           NS_NAMED_LITERAL_STRING(normalMode, "normal-mode");
           observerService->NotifyObservers(nullptr, "tablet-mode-change",
             ((mInTabletMode == eTabletModeOn) ? tabletMode.get() : normalMode.get()));
         }
       }
     }
   }
+#endif
 
   return NS_OK;
 }