diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index fc52e488f73f..66764804c3e1 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -1752,8 +1752,7 @@ bool nsChildView::PaintWindow(nsIntRegion aRegion) void nsChildView::ReportMoveEvent() { - if (mWidgetListener) - mWidgetListener->WindowMoved(this, mBounds.x, mBounds.y); + NotifyWindowMoved(mBounds.x, mBounds.y); } void nsChildView::ReportSizeEvent() diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index 0c22b7c57063..3ad76b1b65de 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -1721,8 +1721,7 @@ nsCocoaWindow::ReportMoveEvent() UpdateBounds(); // Dispatch the move event to Gecko - if (mWidgetListener) - mWidgetListener->WindowMoved(this, mBounds.x, mBounds.y); + NotifyWindowMoved(mBounds.x, mBounds.y); mInReportMoveEvent = false; diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index a35cf95be0d9..3375ac312ce1 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -2368,8 +2368,7 @@ nsWindow::OnConfigureEvent(GtkWidget *aWidget, GdkEventConfigure *aEvent) // XXX mozilla will invalidate the entire window after this move // complete. wtf? - if (mWidgetListener) - mWidgetListener->WindowMoved(this, mBounds.x, mBounds.y); + NotifyWindowMoved(mBounds.x, mBounds.y); return FALSE; } diff --git a/widget/qt/nsWindow.cpp b/widget/qt/nsWindow.cpp index 9e11358ba776..b6a798ae296f 100644 --- a/widget/qt/nsWindow.cpp +++ b/widget/qt/nsWindow.cpp @@ -872,8 +872,8 @@ nsWindow::moveEvent(QMoveEvent* aEvent) return nsEventStatus_eIgnore; } - bool moved = mWidgetListener->WindowMoved(this, aEvent->pos().x(), aEvent->pos().y()); - return moved ? nsEventStatus_eConsumeNoDefault : nsEventStatus_eIgnore; + NotifyWindowMoved(aEvent->pos().x(), aEvent->pos().y()); + return nsEventStatus_eConsumeNoDefault; } nsEventStatus diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 6510712c8b44..070f1545ed2e 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -5798,10 +5798,10 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS* wp) 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 @@ -5825,9 +5825,7 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS* wp) mBounds.x = wp->x; mBounds.y = wp->y; - if (mWidgetListener) { - mWidgetListener->WindowMoved(this, wp->x, wp->y); - } + NotifyWindowMoved(wp->x, wp->y); } // Handle window size changes diff --git a/widget/windows/winrt/MetroWidget.cpp b/widget/windows/winrt/MetroWidget.cpp index 93099d1ad7bf..461c4191db46 100644 --- a/widget/windows/winrt/MetroWidget.cpp +++ b/widget/windows/winrt/MetroWidget.cpp @@ -1484,9 +1484,7 @@ MetroWidget::Activated(bool aActiveated) NS_IMETHODIMP MetroWidget::Move(double aX, double aY) { - if (mWidgetListener) { - mWidgetListener->WindowMoved(this, aX, aY); - } + NotifyWindowMoved(aX, aY); return NS_OK; } diff --git a/widget/xpwidgets/nsBaseWidget.cpp b/widget/xpwidgets/nsBaseWidget.cpp index 2ad5fbca2827..5d61fb7f3c7a 100644 --- a/widget/xpwidgets/nsBaseWidget.cpp +++ b/widget/xpwidgets/nsBaseWidget.cpp @@ -1471,6 +1471,18 @@ nsBaseWidget::NotifySizeMoveDone() } } +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() { diff --git a/widget/xpwidgets/nsBaseWidget.h b/widget/xpwidgets/nsBaseWidget.h index 67436fb11fa9..14f2a4293eaf 100644 --- a/widget/xpwidgets/nsBaseWidget.h +++ b/widget/xpwidgets/nsBaseWidget.h @@ -210,6 +210,7 @@ public: 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.