summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-06 19:03:13 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-06 22:13:13 +0100
commit65bd4477dbad5dbdb8a30e2e70a4c0e0ec5e9c2b (patch)
treeeed5df8938f72e59afa04a651cfa7543813208ca /Userland/Services
parenta062e803c5552c90ecb2fd7ae4264297b417495c (diff)
downloadserenity-65bd4477dbad5dbdb8a30e2e70a4c0e0ec5e9c2b.zip
LibWeb: Plumb OOPWV focus state across the IPC boundary
This makes focus outlines show up in OOPWV at last! :^)
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WebContent/ClientConnection.cpp5
-rw-r--r--Userland/Services/WebContent/ClientConnection.h1
-rw-r--r--Userland/Services/WebContent/PageHost.cpp6
-rw-r--r--Userland/Services/WebContent/PageHost.h2
-rw-r--r--Userland/Services/WebContent/WebContentServer.ipc2
5 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp
index 33bc6be0de..e6fbef7a06 100644
--- a/Userland/Services/WebContent/ClientConnection.cpp
+++ b/Userland/Services/WebContent/ClientConnection.cpp
@@ -391,4 +391,9 @@ void ClientConnection::set_preferred_color_scheme(Web::CSS::PreferredColorScheme
m_page_host->set_preferred_color_scheme(color_scheme);
}
+void ClientConnection::set_has_focus(bool has_focus)
+{
+ m_page_host->set_has_focus(has_focus);
+}
+
}
diff --git a/Userland/Services/WebContent/ClientConnection.h b/Userland/Services/WebContent/ClientConnection.h
index 419e42d094..af2d79df27 100644
--- a/Userland/Services/WebContent/ClientConnection.h
+++ b/Userland/Services/WebContent/ClientConnection.h
@@ -60,6 +60,7 @@ private:
virtual Messages::WebContentServer::DumpLayoutTreeResponse dump_layout_tree() override;
virtual void set_content_filters(Vector<String> const&) override;
virtual void set_preferred_color_scheme(Web::CSS::PreferredColorScheme const&) override;
+ virtual void set_has_focus(bool) override;
virtual void js_console_input(String const&) override;
virtual void run_javascript(String const&) override;
diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp
index 8489c19e65..255f767305 100644
--- a/Userland/Services/WebContent/PageHost.cpp
+++ b/Userland/Services/WebContent/PageHost.cpp
@@ -31,6 +31,11 @@ PageHost::~PageHost()
{
}
+void PageHost::set_has_focus(bool has_focus)
+{
+ m_has_focus = has_focus;
+}
+
void PageHost::setup_palette()
{
// FIXME: Get the proper palette from our peer somehow
@@ -85,6 +90,7 @@ void PageHost::paint(const Gfx::IntRect& content_rect, Gfx::Bitmap& target)
Web::PaintContext context(painter, palette(), content_rect.top_left());
context.set_should_show_line_box_borders(m_should_show_line_box_borders);
context.set_viewport_rect(content_rect);
+ context.set_has_focus(m_has_focus);
layout_root->paint_all_phases(context);
}
diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h
index d8ac4c1e65..3e8e75f4d8 100644
--- a/Userland/Services/WebContent/PageHost.h
+++ b/Userland/Services/WebContent/PageHost.h
@@ -32,6 +32,7 @@ public:
void set_preferred_color_scheme(Web::CSS::PreferredColorScheme);
void set_should_show_line_box_borders(bool b) { m_should_show_line_box_borders = b; }
+ void set_has_focus(bool);
private:
// ^PageClient
@@ -74,6 +75,7 @@ private:
RefPtr<Gfx::PaletteImpl> m_palette_impl;
Gfx::IntRect m_screen_rect;
bool m_should_show_line_box_borders { false };
+ bool m_has_focus { false };
RefPtr<Core::Timer> m_invalidation_coalescing_timer;
Gfx::IntRect m_invalidation_rect;
diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc
index dc03a7a853..dbe200512b 100644
--- a/Userland/Services/WebContent/WebContentServer.ipc
+++ b/Userland/Services/WebContent/WebContentServer.ipc
@@ -44,4 +44,6 @@ endpoint WebContentServer
set_content_filters(Vector<String> filters) =|
set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme) =|
+ set_has_focus(bool has_focus) =|
+
}