refactor: NativeWindows should prefer widget() over GetWidget() for internal use (#47154)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot]
2025-05-19 21:40:21 -05:00
committed by GitHub
parent d03a12aef4
commit ed71d0733e
2 changed files with 4 additions and 4 deletions

View File

@@ -724,7 +724,7 @@ int NativeWindow::NonClientHitTest(const gfx::Point& point) {
// This is to disable dragging in HTML5 full screen mode.
// Details: https://github.com/electron/electron/issues/41002
if (GetWidget()->IsFullscreen())
if (widget()->IsFullscreen())
return HTNOWHERE;
for (auto* provider : draggable_region_providers_) {
@@ -764,7 +764,7 @@ void NativeWindow::RemoveBackgroundThrottlingSource(
}
void NativeWindow::UpdateBackgroundThrottlingState() {
if (!GetWidget() || !GetWidget()->GetCompositor()) {
if (!widget() || !widget()->GetCompositor()) {
return;
}
bool enable_background_throttling = true;
@@ -775,7 +775,7 @@ void NativeWindow::UpdateBackgroundThrottlingState() {
break;
}
}
GetWidget()->GetCompositor()->SetBackgroundThrottling(
widget()->GetCompositor()->SetBackgroundThrottling(
enable_background_throttling);
}

View File

@@ -1265,7 +1265,7 @@ void NativeWindowViews::SetBackgroundColor(SkColor background_color) {
DeleteObject((HBRUSH)previous_brush);
InvalidateRect(GetAcceleratedWidget(), nullptr, 1);
#endif
GetWidget()->GetCompositor()->SetBackgroundColor(background_color);
widget()->GetCompositor()->SetBackgroundColor(background_color);
}
void NativeWindowViews::SetHasShadow(bool has_shadow) {