diff --git a/repos/os/run/pointer.run b/repos/os/run/pointer.run index 517a90057d..25fbfa23f4 100644 --- a/repos/os/run/pointer.run +++ b/repos/os/run/pointer.run @@ -119,7 +119,7 @@ set config { - + @@ -133,7 +133,7 @@ set config { - + @@ -147,7 +147,7 @@ set config { - + @@ -183,7 +183,7 @@ set config { - + diff --git a/repos/os/src/app/pointer/README b/repos/os/src/app/pointer/README index 34359f41e8..ad669e52d2 100644 --- a/repos/os/src/app/pointer/README +++ b/repos/os/src/app/pointer/README @@ -20,16 +20,20 @@ with report session label rewriting: ! ! ! -! +! ! ! ! In the example above, which is from 'pointer.run', the 'shape-arrow' component reports an arrow shape with the label "shape". By rewriting the label of the -report, the shape will be drawn for the 'test-label-arrow' component, which -is reported by Nitpicker with the label 'test-label-arror -> testnit' when -hovered. +report, the shape will be drawn for the 'test-label-arrow' component when +its Nitpicker view is hovered. + +Technically, the 'pointer' component compares the hovered label, which is +'test-label-arrow -> testnit' in this case, with the shape report label after +stripping the last element of each label, so the remaining label prefix +'test-label-arrow' is the actual match criteria. When configured with '', the 'pointer' component prints the labels of hovered Nitpicker sessions and received shape diff --git a/repos/os/src/app/pointer/main.cc b/repos/os/src/app/pointer/main.cc index 48eb640d68..0131d1b738 100644 --- a/repos/os/src/app/pointer/main.cc +++ b/repos/os/src/app/pointer/main.cc @@ -100,7 +100,7 @@ class Pointer::Main : public Rom::Reader Report::Root _report_root { _env, _sliced_heap, _rom_registry, _verbose }; - String _hovered_label; + Genode::Session_label _hovered_label; Genode::Attached_ram_dataspace _texture_pixel_ds { _env.ram(), _env.rm(), Pointer::MAX_WIDTH * @@ -293,7 +293,11 @@ void Pointer::Main::_handle_hover() try { Genode::Xml_node node(_hover_ds->local_addr()); - String hovered_label = read_string_attribute(node, "label", String()); + Genode::Session_label hovered_label { read_string_attribute(node, + "label", + String()) }; + + hovered_label = hovered_label.prefix(); if (_verbose) Genode::log("hovered_label: ", hovered_label); diff --git a/repos/os/src/app/pointer/rom_registry.h b/repos/os/src/app/pointer/rom_registry.h index 0ccc9a7b77..41e331dbd4 100644 --- a/repos/os/src/app/pointer/rom_registry.h +++ b/repos/os/src/app/pointer/rom_registry.h @@ -68,11 +68,18 @@ struct Rom::Registry : Registry_for_reader, Registry_for_writer, Genode::Noncopy /* module does not exist yet, create one */ + Genode::Session_label session_label(name); + + if (session_label.last_element() != "shape") + Genode::warning("received unexpected report with label '", + session_label, "'"); + /* XXX proper accounting for the used memory is missing */ /* XXX if we run out of memory, the server will abort */ Module * const module = new (&_md_alloc) - Module(_ram, _rm, name, _read_write_policy, _read_write_policy); + Module(_ram, _rm, session_label.prefix(), _read_write_policy, + _read_write_policy); _modules.insert(module); return *module; diff --git a/repos/ports/run/vbox_win.inc b/repos/ports/run/vbox_win.inc index 9b7534f066..38d40594de 100644 --- a/repos/ports/run/vbox_win.inc +++ b/repos/ports/run/vbox_win.inc @@ -297,7 +297,7 @@ for { set i 1} { $i <= $use_vms } { incr i} { - \"/> + shape\"/> " append config_of_app { diff --git a/repos/ports/run/virtualbox.run b/repos/ports/run/virtualbox.run index 8561138205..b35bb4d524 100644 --- a/repos/ports/run/virtualbox.run +++ b/repos/ports/run/virtualbox.run @@ -244,7 +244,7 @@ append_if [expr $use_gui] config { - + @@ -277,7 +277,7 @@ append_if [expr $use_bridge] config { } append_if [expr $use_gui] config { - + }