mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 09:04:53 +00:00
Let userland retain the window backing store while drawing into it.
To start painting, call: gui$get_window_backing_store() Then finish up with: gui$release_window_backing_store() Process will retain the underlying GraphicsBitmap behind the scenes. This fixes racing between the WindowServer and GUI clients. This patch also adds a WSWindowLocker that is exactly what it sounds like.
This commit is contained in:
@@ -18,12 +18,13 @@ GWidget::~GWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void GWidget::set_relative_rect(const Rect& rect, bool should_update)
|
||||
void GWidget::set_relative_rect(const Rect& rect)
|
||||
{
|
||||
if (rect == m_relative_rect)
|
||||
return;
|
||||
// FIXME: Make some kind of event loop driven ResizeEvent?
|
||||
m_relative_rect = rect;
|
||||
if (should_update)
|
||||
update();
|
||||
update();
|
||||
}
|
||||
|
||||
void GWidget::repaint(const Rect& rect)
|
||||
@@ -147,10 +148,3 @@ void GWidget::set_font(RetainPtr<Font>&& font)
|
||||
else
|
||||
m_font = move(font);
|
||||
}
|
||||
|
||||
GraphicsBitmap* GWidget::backing()
|
||||
{
|
||||
if (auto* w = window())
|
||||
return w->backing();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user