window decorator: report decorator margins

This commit is contained in:
Norman Feske 2016-02-01 12:40:47 +01:00
parent 31888c610a
commit 54045771c7
3 changed files with 44 additions and 0 deletions

View File

@ -77,6 +77,8 @@ struct Decorator::Main : Window_factory_base
bool window_layout_update_needed = false;
Reporter decorator_margins_reporter = { "decorator_margins" };
Animator animator;
/**
@ -123,6 +125,21 @@ struct Decorator::Main : Window_factory_base
hover_reporter.enabled(true);
decorator_margins_reporter.enabled(true);
Genode::Reporter::Xml_generator xml(decorator_margins_reporter, [&] ()
{
xml.node("floating", [&] () {
Window::Border const border = Window::border_floating();
xml.attribute("top", border.top);
xml.attribute("bottom", border.bottom);
xml.attribute("left", border.left);
xml.attribute("right", border.right);
});
});
/* import initial state */
handle_pointer_update(0);
handle_window_layout_update(0);

View File

@ -397,6 +397,16 @@ class Decorator::Window : public Window_base
_animator(animator), _config(config)
{ }
/**
* Return border margins of floating window
*/
static Border border_floating()
{
return Border(_border_size + _title_height,
_border_size, _border_size, _border_size);
}
void stack(Nitpicker::Session::View_handle neighbor) override
{
_neighbor = neighbor;

View File

@ -73,6 +73,8 @@ struct Decorator::Main : Window_factory_base
Theme theme { *Genode::env()->heap() };
Reporter decorator_margins_reporter = { "decorator_margins" };
/**
* Process the update every 'frame_period' nitpicker sync signals. The
* 'frame_cnt' holds the counter of the nitpicker sync signals.
@ -136,6 +138,21 @@ struct Decorator::Main : Window_factory_base
hover_reporter.enabled(true);
decorator_margins_reporter.enabled(true);
Genode::Reporter::Xml_generator xml(decorator_margins_reporter, [&] ()
{
xml.node("floating", [&] () {
Theme::Margins const margins = theme.decor_margins();
xml.attribute("top", margins.top);
xml.attribute("bottom", margins.bottom);
xml.attribute("left", margins.left);
xml.attribute("right", margins.right);
});
});
/* import initial state */
handle_pointer_update(0);
handle_window_layout_update(0);