@@ -196,10 +196,6 @@ StaticGeometry const default_geometry{
196
196
geom::Size {16 , 16 }, // resize_corner_input_size
197
197
geom::Width{24 }, // button_width
198
198
geom::Width{6 }, // padding_between_buttons
199
- geom::Height{14 }, // title_font_height
200
- geom::Point {8 , 2 }, // title_font_top_left
201
- geom::Displacement{5 , 5 }, // icon_padding
202
- geom::Width{1 }, // detail_line_width
203
199
};
204
200
205
201
miral::Renderer::Renderer (
@@ -445,10 +441,13 @@ struct miral::DecorationAdapter::Impl : public msd::Decoration
445
441
window_state_updated (window_surface);
446
442
window_renamed (args...);
447
443
on_update_decoration_window_state (window_state);
448
- }}
444
+ }},
445
+ geometry{std::make_shared<StaticGeometry>(default_geometry)} // I could use a default parameter, but I don't like those...
449
446
{
450
447
}
451
448
449
+ void set_custom_geometry (std::shared_ptr<StaticGeometry> geometry);
450
+
452
451
void init (
453
452
std::shared_ptr<ms::Surface> window_surface,
454
453
std::shared_ptr<ms::Surface> decoration_surface,
@@ -495,6 +494,8 @@ struct miral::DecorationAdapter::Impl : public msd::Decoration
495
494
std::function<void (ms::Surface const * window_surface, mir::geometry::Size const & /* window_size*/ )>
496
495
on_window_resized_to;
497
496
std::function<void (ms::Surface const * window_surface, std::string const & /* name*/ )> on_window_renamed;
497
+
498
+ std::shared_ptr<StaticGeometry> geometry;
498
499
};
499
500
500
501
miral::DecorationAdapter::DecorationAdapter (
@@ -602,6 +603,16 @@ void miral::DecorationAdapter::Impl::update()
602
603
renderer->update_render_submit (window_state);
603
604
}
604
605
606
+ void miral::DecorationAdapter::set_custom_geometry (std::shared_ptr<StaticGeometry> geometry)
607
+ {
608
+ impl->set_custom_geometry (geometry);
609
+ }
610
+
611
+ void miral::DecorationAdapter::Impl::set_custom_geometry (std::shared_ptr<StaticGeometry> geometry)
612
+ {
613
+ this ->geometry = geometry;
614
+ }
615
+
605
616
void miral::DecorationAdapter::Impl::init (
606
617
std::shared_ptr<ms::Surface> window_surface,
607
618
std::shared_ptr<ms::Surface> decoration_surface,
@@ -613,7 +624,7 @@ void miral::DecorationAdapter::Impl::init(
613
624
this ->shell = shell;
614
625
this ->session = window_surface->session ().lock ();
615
626
this ->decoration_surface = decoration_surface;
616
- this ->window_state = std::make_shared<WindowState>(default_geometry , window_surface.get ());
627
+ this ->window_state = std::make_shared<WindowState>(geometry , window_surface.get ());
617
628
618
629
renderer = std::make_unique<Renderer>(window_surface, buffer_allocator, render_titlebar, render_left_border, render_right_border, render_bottom_border);
619
630
input_adapter = std::make_unique<InputResolverAdapter>(
@@ -640,7 +651,7 @@ void miral::DecorationAdapter::Impl::init(
640
651
641
652
void miral::DecorationAdapter::Impl::window_state_updated (std::shared_ptr<ms::Surface> const window_surface)
642
653
{
643
- window_state = std::make_shared<WindowState>(default_geometry , window_surface.get ());
654
+ window_state = std::make_shared<WindowState>(geometry , window_surface.get ());
644
655
}
645
656
646
657
miral::DecorationAdapter::DecorationAdapter::Impl::~Impl ()
0 commit comments