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

This commit is contained in:
Charles Kerr
2025-05-19 19:43:16 +00:00
committed by GitHub
parent 687e50b4f3
commit 3660432f42
2 changed files with 4 additions and 4 deletions

View File

@@ -722,7 +722,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_) {
@@ -762,7 +762,7 @@ void NativeWindow::RemoveBackgroundThrottlingSource(
}
void NativeWindow::UpdateBackgroundThrottlingState() {
if (!GetWidget() || !GetWidget()->GetCompositor()) {
if (!widget() || !widget()->GetCompositor()) {
return;
}
bool enable_background_throttling = true;
@@ -773,7 +773,7 @@ void NativeWindow::UpdateBackgroundThrottlingState() {
break;
}
}
GetWidget()->GetCompositor()->SetBackgroundThrottling(
widget()->GetCompositor()->SetBackgroundThrottling(
enable_background_throttling);
}

View File

@@ -1282,7 +1282,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) {