From 6ea6e8b125c6d77e767880026e55e10247308a8c Mon Sep 17 00:00:00 2001 From: Kevin Boos <1139460+kevinaboos@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:00:54 -0800 Subject: [PATCH] Use new makepad `Foreground`/`Background` events (#44) Added by me here: from https://github.com/makepad/makepad/pull/396 --- Cargo.lock | 56 +++++++++++++++++++++++++++--------------------------- src/app.rs | 6 ++++++ 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8bc5584..a545a03e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1856,7 +1856,7 @@ dependencies = [ [[package]] name = "makepad-derive-live" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-live-id", "makepad-micro-proc-macro", @@ -1865,7 +1865,7 @@ dependencies = [ [[package]] name = "makepad-derive-wasm-bridge" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-micro-proc-macro", ] @@ -1873,7 +1873,7 @@ dependencies = [ [[package]] name = "makepad-derive-widget" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-live-id", "makepad-micro-proc-macro", @@ -1882,7 +1882,7 @@ dependencies = [ [[package]] name = "makepad-draw" version = "0.6.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "ab_glyph_rasterizer", "makepad-platform", @@ -1895,17 +1895,17 @@ dependencies = [ [[package]] name = "makepad-futures" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" [[package]] name = "makepad-futures-legacy" version = "0.7.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" [[package]] name = "makepad-html" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-live-id", ] @@ -1913,12 +1913,12 @@ dependencies = [ [[package]] name = "makepad-http" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" [[package]] name = "makepad-live-compiler" version = "0.5.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-derive-live", "makepad-live-tokenizer", @@ -1928,7 +1928,7 @@ dependencies = [ [[package]] name = "makepad-live-id" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-live-id-macros", ] @@ -1936,7 +1936,7 @@ dependencies = [ [[package]] name = "makepad-live-id-macros" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-micro-proc-macro", ] @@ -1944,7 +1944,7 @@ dependencies = [ [[package]] name = "makepad-live-tokenizer" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-live-id", "makepad-math", @@ -1954,17 +1954,17 @@ dependencies = [ [[package]] name = "makepad-math" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" [[package]] name = "makepad-micro-proc-macro" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" [[package]] name = "makepad-micro-serde" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-micro-serde-derive", ] @@ -1972,7 +1972,7 @@ dependencies = [ [[package]] name = "makepad-micro-serde-derive" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-micro-proc-macro", ] @@ -1980,12 +1980,12 @@ dependencies = [ [[package]] name = "makepad-objc-sys" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" [[package]] name = "makepad-platform" version = "0.6.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-futures", "makepad-futures-legacy", @@ -2000,7 +2000,7 @@ dependencies = [ [[package]] name = "makepad-shader-compiler" version = "0.5.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-live-compiler", ] @@ -2008,7 +2008,7 @@ dependencies = [ [[package]] name = "makepad-vector" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "ttf-parser", ] @@ -2016,7 +2016,7 @@ dependencies = [ [[package]] name = "makepad-wasm-bridge" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-derive-wasm-bridge", "makepad-live-id", @@ -2025,7 +2025,7 @@ dependencies = [ [[package]] name = "makepad-widgets" version = "0.6.0" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-derive-widget", "makepad-draw", @@ -2037,7 +2037,7 @@ dependencies = [ [[package]] name = "makepad-windows" version = "0.51.1" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "windows-core 0.51.1 (git+https://github.com/makepad/makepad?branch=rik)", "windows-targets", @@ -2046,7 +2046,7 @@ dependencies = [ [[package]] name = "makepad-zune-core" version = "0.2.14" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "bitflags 2.4.1", ] @@ -2054,7 +2054,7 @@ dependencies = [ [[package]] name = "makepad-zune-inflate" version = "0.2.54" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "simd-adler32", ] @@ -2062,7 +2062,7 @@ dependencies = [ [[package]] name = "makepad-zune-jpeg" version = "0.3.17" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-zune-core", ] @@ -2070,7 +2070,7 @@ dependencies = [ [[package]] name = "makepad-zune-png" version = "0.2.1" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "makepad-zune-core", "makepad-zune-inflate", @@ -4831,7 +4831,7 @@ dependencies = [ [[package]] name = "windows-core" version = "0.51.1" -source = "git+https://github.com/makepad/makepad?branch=rik#1a05ca7940b929fa25e9619f30a2742406611cc5" +source = "git+https://github.com/makepad/makepad?branch=rik#9cceaf72acb1304ae13e82cc3775d15925636efc" dependencies = [ "windows-targets", ] diff --git a/src/app.rs b/src/app.rs index 1817585c..8c26eec8 100644 --- a/src/app.rs +++ b/src/app.rs @@ -267,6 +267,12 @@ impl MatchEvent for App { fn handle_shutdown(&mut self, _cx: &mut Cx) { log!("App::handle_shutdown()"); } + fn handle_foreground(&mut self, _cx: &mut Cx) { + log!("App::handle_foreground()"); + } + fn handle_background(&mut self, _cx: &mut Cx) { + log!("App::handle_background()"); + } fn handle_pause(&mut self, _cx: &mut Cx) { log!("App::handle_pause()"); }