mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user