Browse Source

input_filter: patch for survivibility

master
Emery Hemingway 5 months ago
parent
commit
0c981604d8
2 changed files with 26 additions and 0 deletions
  1. 24
    0
      packages/genodelabs/input_filter.patch
  2. 2
    0
      packages/genodelabs/targets.nix

+ 24
- 0
packages/genodelabs/input_filter.patch View File

@@ -0,0 +1,24 @@
1
+commit ae03115e473fd7a16e172ccaa91d1ddc2cdc7d29
2
+Author: Emery Hemingway <ehmry@posteo.net>
3
+Date:   Wed Apr 29 03:34:15 2020 +0530
4
+
5
+    input_filter: survive unrecognized keys
6
+
7
+diff --git a/repos/os/src/server/input_filter/chargen_source.h b/repos/os/src/server/input_filter/chargen_source.h
8
+index 06fc657c25..3525fd6f34 100644
9
+--- a/repos/os/src/server/input_filter/chargen_source.h
10
++++ b/repos/os/src/server/input_filter/chargen_source.h
11
+@@ -684,9 +684,10 @@ class Input_filter::Chargen_source : public Source, Source::Sink
12
+ 			node.for_each_sub_node("key", [&] (Xml_node key_node) {
13
+ 
14
+ 				Key_name const name = key_node.attribute_value("name", Key_name());
15
+-				Input::Keycode const key = key_code_by_name(name);
16
+-
17
+-				new (_alloc) Modifier(_modifiers, id, key);
18
++				try {
19
++					Input::Keycode const key = key_code_by_name(name);
20
++					new (_alloc) Modifier(_modifiers, id, key);
21
++				} catch (Unknown_key) { warning("unrecognized key name ", name); }
22
+ 			});
23
+ 
24
+ 			node.for_each_sub_node("rom", [&] (Xml_node rom_node) {

+ 2
- 0
packages/genodelabs/targets.nix View File

@@ -5,6 +5,8 @@ with ports; {
5 5
 
6 6
   init.patches = [ ./sandbox.patch ];
7 7
 
8
+  input_filter.patches = [ ./input_filter.patch ];
9
+
8 10
   intel_fb_drv = {
9 11
     BOARD = "pc";
10 12
     portInputs = [ dde_linux ];

Loading…
Cancel
Save