Bug 1919165 - Notify attached listener for paint like in other platforms.

This should fix browser_startup_content_mainthreadio.js because it's not
getting the widget-first-paint notification.

MANUAL PUSH: Orange fix CLOSED TREE
This commit is contained in:
Emilio Cobos Álvarez
2025-04-29 17:39:11 +02:00
parent af318eba45
commit d954259f50
2 changed files with 7 additions and 3 deletions

View File

@@ -475,6 +475,10 @@ class nsCocoaWindow final : public nsBaseWidget {
void CocoaSendToplevelActivateEvents(); void CocoaSendToplevelActivateEvents();
void CocoaSendToplevelDeactivateEvents(); void CocoaSendToplevelDeactivateEvents();
nsIWidgetListener* GetPaintListener() const {
return mAttachedWidgetListener ? mAttachedWidgetListener : mWidgetListener;
}
enum class TransitionType { enum class TransitionType {
Windowed, Windowed,
Fullscreen, Fullscreen,

View File

@@ -753,20 +753,20 @@ void nsCocoaWindow::Invalidate(const LayoutDeviceIntRect& aRect) {
#pragma mark - #pragma mark -
void nsCocoaWindow::WillPaintWindow() { void nsCocoaWindow::WillPaintWindow() {
if (nsIWidgetListener* listener = GetWidgetListener()) { if (nsIWidgetListener* listener = GetPaintListener()) {
listener->WillPaintWindow(this); listener->WillPaintWindow(this);
} }
} }
bool nsCocoaWindow::PaintWindow(LayoutDeviceIntRegion aRegion) { bool nsCocoaWindow::PaintWindow(LayoutDeviceIntRegion aRegion) {
nsIWidgetListener* listener = GetWidgetListener(); nsIWidgetListener* listener = GetPaintListener();
if (!listener) { if (!listener) {
return false; return false;
} }
bool returnValue = listener->PaintWindow(this, aRegion); bool returnValue = listener->PaintWindow(this, aRegion);
listener = GetWidgetListener(); listener = GetPaintListener();
if (listener) { if (listener) {
listener->DidPaintWindow(); listener->DidPaintWindow();
} }