nitpicker/wm: fix session_control mechanism

The session-control mechanism is based on the way how sessions are
labeled. In #2171, we changed the labeling to be more strict. In
particular, label-less sessions do no longer exist.

Unfortunately, nitpicker and the window manager still handled the former
weaker labeling, which ultimately led to a situation where any
session-control argument would mismatch. The behavior could be observed
in the launcher.run script where a click on the subsystem button would
not focus the clicked-on subsystem. With the patch, the scenario works
again as expected.
This commit is contained in:
Norman Feske 2017-01-10 17:50:34 +01:00
parent 28d497549c
commit 6f6f68f216
2 changed files with 6 additions and 19 deletions

View File

@ -971,18 +971,9 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
void session_control(Label suffix, Session_control operation) override
{
/*
* Append label argument to session label
*
* The code originates from nitpicker's 'main.cc'.
*/
char selector[Label::size()];
Session_label const selector(_session_label, suffix);
Genode::snprintf(selector, sizeof(selector), "%s%s%s",
_session_label.string(),
suffix.length() ? " -> " : "", suffix.string());
_session_control_fn.session_control(selector, operation);
_session_control_fn.session_control(selector.string(), operation);
}
};

View File

@ -937,16 +937,12 @@ class Nitpicker::Session_component : public Genode::Rpc_object<Session>,
void session_control(Label suffix, Session_control control) override
{
char selector[Label::size()];
Genode::snprintf(selector, sizeof(selector), "%s%s%s",
label().string(),
suffix.length() ? " -> " : "", suffix.string());
Session_label const selector(label(), suffix);
switch (control) {
case SESSION_CONTROL_HIDE: _view_stack.visible(selector, false); break;
case SESSION_CONTROL_SHOW: _view_stack.visible(selector, true); break;
case SESSION_CONTROL_TO_FRONT: _view_stack.to_front(selector); break;
case SESSION_CONTROL_HIDE: _view_stack.visible(selector.string(), false); break;
case SESSION_CONTROL_SHOW: _view_stack.visible(selector.string(), true); break;
case SESSION_CONTROL_TO_FRONT: _view_stack.to_front(selector.string()); break;
}
}