From dc9cd381896658d737c7820bb145911630ba0cee Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Sun, 23 Dec 2018 16:26:06 +0100 Subject: [PATCH] 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 --- repos/gems/src/server/wm/decorator_nitpicker.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/repos/gems/src/server/wm/decorator_nitpicker.h b/repos/gems/src/server/wm/decorator_nitpicker.h index b04367594c..676d1cd4fb 100644 --- a/repos/gems/src/server/wm/decorator_nitpicker.h +++ b/repos/gems/src/server/wm/decorator_nitpicker.h @@ -285,9 +285,14 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object, } case Command::OP_TO_FRONT: + case Command::OP_TO_BACK: 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 * window content. @@ -295,7 +300,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object, * The lookup fails with an exception for non-content views. * 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 @@ -304,8 +309,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object, Nitpicker::View_capability view_cap = _content_callback.content_view(win_id); - _nitpicker_session.view_handle(view_cap, - cmd.to_front.view); + _nitpicker_session.view_handle(view_cap, view_handle); _nitpicker_session.enqueue(cmd); _nitpicker_session.execute(); @@ -357,7 +361,6 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object, } return; - case Command::OP_TO_BACK: case Command::OP_BACKGROUND: case Command::OP_NOP: