wm: support TO_BACK command issued by decorator

Until now, decorators used to rely only on the TO_FRONT command for
propagating the window stacking to nitpicker. However, as the additional
use of the TO_BACK command allows for a more robust procedure, this
patch enhances the wm to handle both view stacking commands.

Issue #3094
This commit is contained in:
Norman Feske 2018-12-23 16:26:06 +01:00
parent b3fa7b0650
commit dc9cd38189

View File

@ -285,9 +285,14 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
} }
case Command::OP_TO_FRONT: case Command::OP_TO_FRONT:
case Command::OP_TO_BACK:
try { try {
View_handle const view_handle = (cmd.opcode == Command::OP_TO_FRONT)
? cmd.to_front.view
: cmd.to_back.view;
/* /*
* If the content view is re-stacked, replace it by the real * If the content view is re-stacked, replace it by the real
* window content. * window content.
@ -295,7 +300,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
* The lookup fails with an exception for non-content views. * The lookup fails with an exception for non-content views.
* In this case, forward the command. * In this case, forward the command.
*/ */
Window_registry::Id win_id = _content_registry.lookup(cmd.to_front.view); Window_registry::Id win_id = _content_registry.lookup(view_handle);
/* /*
* Replace content view originally created by the decorator * Replace content view originally created by the decorator
@ -304,8 +309,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
Nitpicker::View_capability view_cap = Nitpicker::View_capability view_cap =
_content_callback.content_view(win_id); _content_callback.content_view(win_id);
_nitpicker_session.view_handle(view_cap, _nitpicker_session.view_handle(view_cap, view_handle);
cmd.to_front.view);
_nitpicker_session.enqueue(cmd); _nitpicker_session.enqueue(cmd);
_nitpicker_session.execute(); _nitpicker_session.execute();
@ -357,7 +361,6 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
} }
return; return;
case Command::OP_TO_BACK:
case Command::OP_BACKGROUND: case Command::OP_BACKGROUND:
case Command::OP_NOP: case Command::OP_NOP: