[workstation][ui-input] Add focus to workstation

Bug: 52264

Change-Id: Ia291122699d147af74c71a0fec2ce3625596f7ab
Reviewed-on: https://fuchsia-review.googlesource.com/c/experiences/+/395995
Reviewed-by: Kevin Lindkvist <lindkvist@google.com>
Testability-Review: Kevin Lindkvist <lindkvist@google.com>
Commit-Queue: Vickie Cheng <vickiecheng@google.com>
diff --git a/session_shells/ermine/session/meta/workstation_session.cml b/session_shells/ermine/session/meta/workstation_session.cml
index 1e5c691..658e668 100644
--- a/session_shells/ermine/session/meta/workstation_session.cml
+++ b/session_shells/ermine/session/meta/workstation_session.cml
@@ -1,6 +1,6 @@
 {
-    "program": {
-        "binary": "bin/workstation_session",
+    program: {
+        binary: "bin/workstation_session",
     },
     collections: [
         {
@@ -12,51 +12,41 @@
             durability: "transient",
         },
     ],
-    expose: [
+    use: [
+        { runner: "elf" },
         {
-            protocol: [
-                "/svc/fuchsia.session.ElementManager",
-            ],
-            from: "self",
-        },
-    ],
-    "use": [
-        { "runner": "elf" },
-        {
-            "directory": "/dev/class/input-report",
-            "from": "realm",
-            "rights": [ "r*",]
+            directory: "/dev/class/input-report",
+            from: "realm",
+            rights: [ "r*" ],
         },
         {
             protocol: "/svc/fuchsia.sys2.Realm",
             from: "framework",
         },
         {
-            "protocol": "/svc/fuchsia.sys.Launcher",
-        },
-        {
-            "protocol": "/svc/fuchsia.ui.input2.Keyboard",
-        },
-        {
-            "protocol": "/svc/fuchsia.ui.scenic.Scenic",
-        },
-        {
-            "protocol": "/svc/fuchsia.ui.input.ImeService",
-        },
-        {
-            "protocol": "/svc/fuchsia.logger.LogSink",
-        },
-        {
-            "protocol": "/svc/fuchsia.ui.shortcut.Manager",
+            protocol: [
+                "/svc/fuchsia.logger.LogSink",
+                "/svc/fuchsia.sys.Launcher",
+                "/svc/fuchsia.ui.focus.FocusChainListenerRegistry",
+                "/svc/fuchsia.ui.input.ImeService",
+                "/svc/fuchsia.ui.input2.Keyboard",
+                "/svc/fuchsia.ui.input3.Keyboard",
+                "/svc/fuchsia.ui.scenic.Scenic",
+                "/svc/fuchsia.ui.shortcut.Manager",
+            ],
         },
     ],
     offer: [
         {
             protocol: "/svc/fuchsia.session.ElementManager",
             from: "self",
-            to: [
-                "#element_launchers",
-            ],
+            to: [ "#element_launchers" ],
+        },
+    ],
+    expose: [
+        {
+            protocol: [ "/svc/fuchsia.session.ElementManager" ],
+            from: "self",
         },
     ],
 }
diff --git a/session_shells/ermine/session/src/main.rs b/session_shells/ermine/session/src/main.rs
index f99b468..3a52c21 100644
--- a/session_shells/ermine/session/src/main.rs
+++ b/session_shells/ermine/session/src/main.rs
@@ -125,9 +125,10 @@
     let services_fut = expose_services(element_repository.make_server());
     let input_fut = workstation_input_pipeline::handle_input(scene_manager, &pointer_hack_server);
     let element_manager_fut = element_repository.run_with_handler(&mut handler);
+    let focus_fut = input::focus_listening::handle_focus_changes();
 
     //TODO(47080) monitor the futures to see if they complete in an error.
-    let _ = try_join!(services_fut, input_fut, element_manager_fut);
+    let _ = try_join!(services_fut, input_fut, element_manager_fut, focus_fut);
 
     element_repository.shutdown()?;