summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/OutOfProcessWebView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-10-24 12:28:38 +0200
committerAndreas Kling <kling@serenityos.org>2020-10-24 12:30:21 +0200
commitbf1ed342365e6cf4a7a7dd04e640592a63c17f7b (patch)
treedaa362a362048f393a4fbbe80d0cf7bacff868e6 /Libraries/LibWeb/OutOfProcessWebView.cpp
parent950c999d3a6db03dc35c53705611f6548169cfce (diff)
downloadserenity-bf1ed342365e6cf4a7a7dd04e640592a63c17f7b.zip
LibWeb: Don't send OOPWV repaint requests for views without backing
This fixes an assertion in TextEditor when changing the system theme, since that would trigger a repaint request for the HTML preview widget which may not have backing unless it's actually been used to perform HTML (or Markdown) preview yet.
Diffstat (limited to 'Libraries/LibWeb/OutOfProcessWebView.cpp')
-rw-r--r--Libraries/LibWeb/OutOfProcessWebView.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibWeb/OutOfProcessWebView.cpp b/Libraries/LibWeb/OutOfProcessWebView.cpp
index 22c62fe9dd..ec62289ece 100644
--- a/Libraries/LibWeb/OutOfProcessWebView.cpp
+++ b/Libraries/LibWeb/OutOfProcessWebView.cpp
@@ -214,6 +214,10 @@ void OutOfProcessWebView::did_scroll()
void OutOfProcessWebView::request_repaint()
{
+ // If this widget was instantiated but not yet added to a window,
+ // it won't have a back bitmap yet, so we can just skip repaint requests.
+ if (!m_back_bitmap)
+ return;
client().post_message(Messages::WebContentServer::Paint(m_back_bitmap->rect().translated(horizontal_scrollbar().value(), vertical_scrollbar().value()), m_back_bitmap->shbuf_id()));
}