mirror of
https://github.com/electron/electron.git
synced 2026-01-25 23:38:18 -05:00
Hide when not painting + cursor event fix
This commit is contained in:
@@ -1322,6 +1322,8 @@ void WebContents::OnCursorChange(const content::WebCursor& cursor) {
|
||||
if (cursor.IsCustom()) {
|
||||
Emit("cursor-changed", CursorTypeToString(info),
|
||||
gfx::Image::CreateFrom1xBitmap(info.custom_image),
|
||||
gfx::Rect(info.custom_image.width(), info.custom_image.height()),
|
||||
info.hotspot,
|
||||
info.image_scale_factor);
|
||||
} else {
|
||||
Emit("cursor-changed", CursorTypeToString(info));
|
||||
@@ -1405,6 +1407,7 @@ void WebContents::StartPainting() {
|
||||
const auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||
web_contents()->GetRenderWidgetHostView());
|
||||
osr_rwhv->SetPainting(true);
|
||||
osr_rwhv->Show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1413,6 +1416,7 @@ void WebContents::StopPainting() {
|
||||
const auto osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
|
||||
web_contents()->GetRenderWidgetHostView());
|
||||
osr_rwhv->SetPainting(false);
|
||||
osr_rwhv->Hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -508,6 +508,7 @@ void OffScreenRenderWidgetHostView::Show() {
|
||||
render_widget_host_->WasShown(ui::LatencyInfo());
|
||||
delegated_frame_host_->SetCompositor(compositor_.get());
|
||||
delegated_frame_host_->WasShown(ui::LatencyInfo());
|
||||
compositor_->ScheduleFullRedraw();
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::Hide() {
|
||||
|
||||
Reference in New Issue
Block a user