Commit 215b2592 authored by Iulian Moraru's avatar Iulian Moraru
Browse files

Merge autoland to mozilla-central. a=merge

parents 1d434c7d 8b7bd5c4
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -2659,10 +2659,6 @@ void* nsWindow::GetNativeData(uint32_t aDataType) {
  return nullptr;
}

void nsWindow::SetNativeData(uint32_t aDataType, uintptr_t aVal) {
  switch (aDataType) {}
}

void nsWindow::DispatchHitTest(const WidgetTouchEvent& aEvent) {
  if (aEvent.mMessage == eTouchStart && aEvent.mTouches.Length() == 1) {
    // Since touch events don't get retargeted by PositionedEventTargeting.cpp
+0 −1
Original line number Diff line number Diff line
@@ -168,7 +168,6 @@ class nsWindow final : public nsBaseWidget {
  virtual nsresult MakeFullScreen(bool aFullScreen) override;
  void SetCursor(const Cursor& aDefaultCursor) override;
  void* GetNativeData(uint32_t aDataType) override;
  void SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
  virtual nsresult SetTitle(const nsAString& aTitle) override { return NS_OK; }
  [[nodiscard]] virtual nsresult GetAttention(int32_t aCycleCount) override {
    return NS_ERROR_NOT_IMPLEMENTED;
+0 −2
Original line number Diff line number Diff line
@@ -349,8 +349,6 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
  void NotifyWindowMoved(int32_t aX, int32_t aY,
                         ByMoveToRect = ByMoveToRect::No);

  void SetNativeData(uint32_t aDataType, uintptr_t aVal) override {}

  // Should be called by derived implementations to notify on system color and
  // theme changes.
  void NotifyThemeChanged(mozilla::widget::ThemeChangeKind);
+1 −3
Original line number Diff line number Diff line
@@ -113,11 +113,10 @@ typedef nsEventStatus (*EVENT_CALLBACK)(mozilla::WidgetGUIEvent* aEvent);
typedef void* nsNativeWidget;

/**
 * Flags for the GetNativeData and SetNativeData functions
 * Values for the GetNativeData function
 */
#define NS_NATIVE_WINDOW 0
#define NS_NATIVE_GRAPHIC 1
#define NS_NATIVE_TMP_WINDOW 2
#define NS_NATIVE_WIDGET 3
#define NS_NATIVE_REGION 5
#define NS_NATIVE_OFFSETX 6
@@ -1271,7 +1270,6 @@ class nsIWidget : public nsISupports {
  virtual void AddChild(nsIWidget* aChild) = 0;
  virtual void RemoveChild(nsIWidget* aChild) = 0;
  virtual void* GetNativeData(uint32_t aDataType) = 0;
  virtual void SetNativeData(uint32_t aDataType, uintptr_t aVal) = 0;
  virtual void FreeNativeData(void* data, uint32_t aDataType) = 0;  //~~~

  //@}
+34 −0
Original line number Diff line number Diff line
@@ -2112,5 +2112,39 @@ const char* WinUtils::WinEventToEventName(UINT msg) {
             ? eventMsgInfo->second.mStr
             : nullptr;
}

// Note to testers and/or test-authors: on Windows 10, and possibly on other
// versions as well, supplying the `WS_EX_LAYOUTRTL` flag here has no effect
// whatsoever on child common-dialogs **unless the system UI locale is also set
// to an RTL language**.
//
// If it is, the flag is still required; otherwise, the picker dialog will be
// presented in English (or possibly some other LTR language) as a fallback.
ScopedRtlShimWindow::ScopedRtlShimWindow(nsIWidget* aParent) : mWnd(nullptr) {
  NS_ENSURE_TRUE_VOID(aParent);

  // Headless windows don't have HWNDs, but also probably shouldn't be launching
  // print dialogs.
  HWND const hwnd = (HWND)aParent->GetNativeData(NS_NATIVE_WINDOW);
  NS_ENSURE_TRUE_VOID(hwnd);

  nsWindow* const win = WinUtils::GetNSWindowPtr(hwnd);
  NS_ENSURE_TRUE_VOID(win);

  ATOM const wclass = ::GetClassWord(hwnd, GCW_ATOM);
  mWnd = ::CreateWindowExW(
      win->IsRTL() ? WS_EX_LAYOUTRTL : 0, (LPCWSTR)(uintptr_t)wclass, L"",
      WS_CHILD, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
      hwnd, nullptr, nsToolkit::mDllInstance, nullptr);

  MOZ_ASSERT(mWnd);
}

ScopedRtlShimWindow::~ScopedRtlShimWindow() {
  if (mWnd) {
    ::DestroyWindow(mWnd);
  }
}

}  // namespace widget
}  // namespace mozilla
Loading