aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing/windowing.rs
diff options
context:
space:
mode:
authorPaul Rouget <me@paulrouget.com>2020-02-19 14:09:50 +0100
committerPaul Rouget <me@paulrouget.com>2020-02-19 14:10:49 +0100
commit6ddde1a3e1284a91f3088bf48d72d9425505df12 (patch)
treea1ff09268d6dc23454f3c95c3766f2cb66dda7a1 /components/compositing/windowing.rs
parent5597ccf57ddc2b77fcb4a8071f575b0dc9389a12 (diff)
downloadservo-6ddde1a3e1284a91f3088bf48d72d9425505df12.tar.gz
servo-6ddde1a3e1284a91f3088bf48d72d9425505df12.zip
Stop animations when window is hidden (API + UWP)
Diffstat (limited to 'components/compositing/windowing.rs')
-rw-r--r--components/compositing/windowing.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs
index 93e7c914313..4dfa27a9d02 100644
--- a/components/compositing/windowing.rs
+++ b/components/compositing/windowing.rs
@@ -105,6 +105,8 @@ pub enum WindowEvent {
/// Sent when the user triggers a media action through the UA exposed media UI
/// (play, pause, seek, etc.).
MediaSessionAction(MediaSessionActionType),
+ /// Set browser visibility. A hidden browser will not tick the animations.
+ ChangeBrowserVisibility(TopLevelBrowsingContextId, bool),
}
impl Debug for WindowEvent {
@@ -136,6 +138,7 @@ impl Debug for WindowEvent {
WindowEvent::ToggleSamplingProfiler(..) => write!(f, "ToggleSamplingProfiler"),
WindowEvent::ExitFullScreen(..) => write!(f, "ExitFullScreen"),
WindowEvent::MediaSessionAction(..) => write!(f, "MediaSessionAction"),
+ WindowEvent::ChangeBrowserVisibility(..) => write!(f, "ChangeBrowserVisibility"),
}
}
}