mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:17:44 +00:00
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. :^)
This commit is contained in:
parent
5908873b45
commit
d4acdac317
14 changed files with 150 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ private:
|
|||
virtual void set_has_focus(bool) override;
|
||||
virtual void set_is_scripting_enabled(bool) override;
|
||||
virtual void handle_file_return(i32 error, Optional<IPC::File> const& file, i32 request_id) override;
|
||||
virtual void set_system_visibility_state(bool visible) override;
|
||||
|
||||
virtual void js_console_input(String const&) override;
|
||||
virtual void run_javascript(String const&) override;
|
||||
|
|
|
@ -54,4 +54,6 @@ endpoint WebContentServer
|
|||
get_session_storage_entries() => (OrderedHashMap<String,String> entries)
|
||||
|
||||
handle_file_return(i32 error, Optional<IPC::File> file, i32 request_id) =|
|
||||
|
||||
set_system_visibility_state(bool visible) =|
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue