summaryrefslogtreecommitdiff
path: root/Userland/Services/WebContent/ConnectionFromClient.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-19 20:50:33 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-20 10:32:14 +0200
commitd4acdac3175da4edf0ca88c246a9e58307e3eefd (patch)
treec56fc149669558ce170029bf2aabdcfa64513c32 /Userland/Services/WebContent/ConnectionFromClient.cpp
parent5908873b45ecf6dd43411b7df55701576b8e63a6 (diff)
downloadserenity-d4acdac3175da4edf0ca88c246a9e58307e3eefd.zip
LibWeb+WebContent+Browser: Plumb visibility state from GUI to web pages
OOPWV now reacts to show/hide events and informs LibWeb about the state change. This makes visibilitychange events fire when switching tabs. :^)
Diffstat (limited to 'Userland/Services/WebContent/ConnectionFromClient.cpp')
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp
index 65a0cb3ca7..2f4107b62c 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.cpp
+++ b/Userland/Services/WebContent/ConnectionFromClient.cpp
@@ -526,4 +526,13 @@ void ConnectionFromClient::request_file(NonnullRefPtr<Web::FileRequest>& file_re
async_did_request_file(file_request->path(), id);
}
+
+void ConnectionFromClient::set_system_visibility_state(bool visible)
+{
+ m_page_host->page().top_level_browsing_context().set_system_visibility_state(
+ visible
+ ? Web::HTML::VisibilityState::Visible
+ : Web::HTML::VisibilityState::Hidden);
+}
+
}