mirror of
https://github.com/servo/servo.git
synced 2025-10-01 00:59:15 +01:00
Behave properly when app is suspended
This commit is contained in:
parent
e051c5880e
commit
ae407e9a65
7 changed files with 69 additions and 9 deletions
|
@ -208,6 +208,12 @@ impl ServoGlue {
|
|||
self.process_event(event)
|
||||
}
|
||||
|
||||
/// Redraw the page.
|
||||
pub fn refresh(&mut self) -> Result<(), &'static str> {
|
||||
info!("refresh");
|
||||
self.process_event(WindowEvent::Refresh)
|
||||
}
|
||||
|
||||
/// Stop loading the page.
|
||||
pub fn stop(&mut self) -> Result<(), &'static str> {
|
||||
debug!("TODO can't stop won't stop");
|
||||
|
|
|
@ -144,6 +144,12 @@ pub extern "C" fn stop() {
|
|||
call(|s| s.stop());
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn refresh() {
|
||||
debug!("refresh");
|
||||
call(|s| s.refresh());
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn go_back() {
|
||||
debug!("go_back");
|
||||
|
|
|
@ -145,6 +145,12 @@ pub fn Java_com_mozilla_servoview_JNIServo_stop(env: JNIEnv, _class: JClass) {
|
|||
call(env, |s| s.stop());
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn Java_com_mozilla_servoview_JNIServo_refresh(env: JNIEnv, _class: JClass) {
|
||||
debug!("refresh");
|
||||
call(env, |s| s.refresh());
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn Java_com_mozilla_servoview_JNIServo_goBack(env: JNIEnv, _class: JClass) {
|
||||
debug!("goBack");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue