Backed out changeset 743fb3c48ed7 (bug 968647)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 28 Feb 2014 09:30:01 +0100
changeset 171208 e6f60ab006d4d11c8c59618a223fb74eafd3a08f
parent 171207 9b5b630bb6cbf6f53fcd22ef1619d512e589a54b
child 171209 a35f5f30cd5391c9c09c57ba57173b53ff28c98f
push id5104
push userryanvm@gmail.com
push dateFri, 28 Feb 2014 15:16:20 +0000
treeherderb2g-inbound@52bd17afb93c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs968647
milestone30.0a1
backs out743fb3c48ed7c4f574623e89b4cb99364d2951ff
Backed out changeset 743fb3c48ed7 (bug 968647)
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaWindow.mm
widget/gtk/nsWindow.cpp
widget/qt/nsWindow.cpp
widget/windows/nsWindow.cpp
widget/windows/winrt/MetroWidget.cpp
widget/xpwidgets/nsBaseWidget.cpp
widget/xpwidgets/nsBaseWidget.h
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -1747,17 +1747,18 @@ bool nsChildView::PaintWindow(nsIntRegio
   mIsDispatchPaint = oldDispatchPaint;
   return returnValue;
 }
 
 #pragma mark -
 
 void nsChildView::ReportMoveEvent()
 {
-   NotifyWindowMoved(mBounds.x, mBounds.y);
+  if (mWidgetListener)
+    mWidgetListener->WindowMoved(this, mBounds.x, mBounds.y);
 }
 
 void nsChildView::ReportSizeEvent()
 {
   if (mWidgetListener)
     mWidgetListener->WindowResized(this, mBounds.width, mBounds.height);
 }
 
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -1716,17 +1716,18 @@ nsCocoaWindow::ReportMoveEvent()
   if (mInReportMoveEvent) {
     return;
   }
   mInReportMoveEvent = true;
 
   UpdateBounds();
 
   // Dispatch the move event to Gecko
-  NotifyWindowMoved(mBounds.x, mBounds.y);
+  if (mWidgetListener)
+    mWidgetListener->WindowMoved(this, mBounds.x, mBounds.y);
 
   mInReportMoveEvent = false;
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 void
 nsCocoaWindow::DispatchSizeModeEvent()
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -2363,17 +2363,18 @@ nsWindow::OnConfigureEvent(GtkWidget *aW
         // offsetForContextMenu on each iteration.
         return FALSE;
     }
 
     mBounds.MoveTo(screenBounds.TopLeft());
 
     // XXX mozilla will invalidate the entire window after this move
     // complete.  wtf?
-    NotifyWindowMoved(mBounds.x, mBounds.y);
+    if (mWidgetListener)
+      mWidgetListener->WindowMoved(this, mBounds.x, mBounds.y);
 
     return FALSE;
 }
 
 void
 nsWindow::OnContainerUnrealize()
 {
     // The GdkWindows are about to be destroyed (but not deleted), so remove
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -867,18 +867,18 @@ nsWindow::moveEvent(QMoveEvent* aEvent)
         return nsEventStatus_eIgnore;
 
     if ((mBounds.x == aEvent->pos().x() &&
          mBounds.y == aEvent->pos().y()))
     {
         return nsEventStatus_eIgnore;
     }
 
-    NotifyWindowMoved(aEvent->pos().x(), aEvent->pos().y());
-    return nsEventStatus_eConsumeNoDefault;
+    bool moved = mWidgetListener->WindowMoved(this, aEvent->pos().x(), aEvent->pos().y());
+    return moved ? nsEventStatus_eConsumeNoDefault : nsEventStatus_eIgnore;
 }
 
 nsEventStatus
 nsWindow::resizeEvent(QResizeEvent* aEvent)
 {
     nsIntRect rect;
 
     // Generate XPFE resize event
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -5793,20 +5793,20 @@ void nsWindow::OnWindowPosChanged(WINDOW
                  ("*** mSizeMode: nsSizeMode_Normal\n"));
         break;
       case nsSizeMode_Minimized:
         PR_LOG(gWindowsLog, PR_LOG_ALWAYS, 
                ("*** mSizeMode: nsSizeMode_Minimized\n"));
         break;
       case nsSizeMode_Maximized:
           PR_LOG(gWindowsLog, PR_LOG_ALWAYS, 
-                 ("*** mSizeMode: nsSizeMode_Maximized\n"));
+                 ("*** mSizeMode: nsSizeMode_Maximized\n");
         break;
       default:
-          PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** mSizeMode: ??????\n"));
+          PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("*** mSizeMode: ??????\n");
         break;
     };
 #endif
 
     if (mWidgetListener)
       mWidgetListener->SizeModeChanged(mSizeMode);
 
     // If window was restored, window activation was bypassed during the 
@@ -5820,17 +5820,19 @@ void nsWindow::OnWindowPosChanged(WINDOW
       return;
   }
 
   // Handle window position changes
   if (!(wp->flags & SWP_NOMOVE)) {
     mBounds.x = wp->x;
     mBounds.y = wp->y;
 
-    NotifyWindowMoved(wp->x, wp->y);
+    if (mWidgetListener) {
+      mWidgetListener->WindowMoved(this, wp->x, wp->y);
+    }
   }
 
   // Handle window size changes
   if (!(wp->flags & SWP_NOSIZE)) {
     RECT r;
     int32_t newWidth, newHeight;
 
     ::GetWindowRect(mWnd, &r);
--- a/widget/windows/winrt/MetroWidget.cpp
+++ b/widget/windows/winrt/MetroWidget.cpp
@@ -1479,17 +1479,19 @@ MetroWidget::Activated(bool aActiveated)
       mWidgetListener->WindowActivated() :
       mWidgetListener->WindowDeactivated();
   }
 }
 
 NS_IMETHODIMP
 MetroWidget::Move(double aX, double aY)
 {
-  NotifyWindowMoved(aX, aY);
+  if (mWidgetListener) {
+    mWidgetListener->WindowMoved(this, aX, aY);
+  }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MetroWidget::Resize(double aWidth, double aHeight, bool aRepaint)
 {
   return Resize(0, 0, aWidth, aHeight, aRepaint);
 }
--- a/widget/xpwidgets/nsBaseWidget.cpp
+++ b/widget/xpwidgets/nsBaseWidget.cpp
@@ -1467,28 +1467,16 @@ nsBaseWidget::NotifySizeMoveDone()
 
   nsIPresShell* presShell = mWidgetListener->GetPresShell();
   if (presShell) {
     presShell->WindowSizeMoveDone();
   }
 }
 
 void
-nsBaseWidget::NotifyWindowMoved(int32_t aX, int32_t aY)
-{
-  if (mWidgetListener) {
-    mWidgetListener->WindowMoved(this, aX, aY);
-  }
-
-  if (GetIMEUpdatePreference().WantPositionChanged()) {
-    NotifyIME(IMENotification(IMEMessage::NOTIFY_IME_OF_POSITION_CHANGE));
-  }
-}
-
-void
 nsBaseWidget::NotifySysColorChanged()
 {
   if (!mWidgetListener || mWidgetListener->GetXULWindow())
     return;
 
   nsIPresShell* presShell = mWidgetListener->GetPresShell();
   if (presShell) {
     presShell->SysColorChanged();
--- a/widget/xpwidgets/nsBaseWidget.h
+++ b/widget/xpwidgets/nsBaseWidget.h
@@ -205,17 +205,16 @@ public:
   NS_IMETHOD              AttachViewToTopLevel(bool aUseAttachedEvents, nsDeviceContext *aContext);
   virtual nsIWidgetListener* GetAttachedWidgetListener();
   virtual void               SetAttachedWidgetListener(nsIWidgetListener* aListener);
   NS_IMETHOD              RegisterTouchWindow();
   NS_IMETHOD              UnregisterTouchWindow();
 
   void NotifyWindowDestroyed();
   void NotifySizeMoveDone();
-  void NotifyWindowMoved(int32_t aX, int32_t aY);
 
   // Should be called by derived implementations to notify on system color and
   // theme changes.
   void NotifySysColorChanged();
   void NotifyThemeChanged();
   void NotifyUIStateChanged(UIStateChangeType aShowAccelerators,
                             UIStateChangeType aShowFocusRings);