A lot of nits:
222 +MirCursorConfiguration::MirCursorConfiguration(char const* s_name) 223 +{ 224 + s_name ? name = std::string(s_name) : name = std::string(); 225 +}
MirCursorConfiguration::MirCursorConfiguration(char const* name) : name{name ? std::string(s_name) : std::string()} { }
~~~~
235 + std::unique_ptr<MirCursorConfiguration> c(new MirCursorConfiguration(name)); 236 237 - return c; 238 + return c.release();
return new MirCursorConfiguration(name);
263 +
Why?
434 + auto observer = std::make_shared<UpdateCursorOnSurfaceChanges>(cursor_controller);
auto const?
494 + std::shared_ptr<mi::Surface> top_surface_at_point = nullptr;
std::shared_ptr<mi::Surface> top_surface_at_point;
523 + try 524 + { 525 + input_targets->remove_observer(observer); 526 + } 527 + catch (...) 528 + { 529 + }
I don't expect input_targets->remove_observer(observer) to throw.
If removing observer does throw then surely things are so broken that we should stop execution. Not eat the exception!
730 #include "mir_test_framework/display_server_test_fixture.h"
Unused. (I suspect a whole bunch more includes are unused - e.g. #include "mir/compositor/scene.h")
1017 +struct DeferredInProcessServer : mtf::InProcessServer 1018 +{ 1019 + void SetUp() override { /* TODO this is a nasty frig around the unfortunate coupling in InProcessServer */ } 1020 + void start_server() { mtf::InProcessServer::SetUp(); } 1021 +};
You might like to update to match test_client_input.cpp (or even put somewhere common).
struct DeferredInProcessServer : testing::Test, private mtf::ServerRunner { void TearDown() override { ServerRunner::stop_server(); }
using ServerRunner::start_server; using ServerRunner::new_connection; };
2001 + StubInputSurface surface1{geom::Rectangle{geom::Point{geom::X{0}, geom::Y{0}}, 2002 + geom::Size{geom::Width{1}, geom::Height{1}}}, 2003 + image}; 2004 + StubInputSurface surface2{geom::Rectangle{geom::Point{geom::X{0}, geom::Y{0}}, 2005 + geom::Size{geom::Width{1}, geom::Height{1}}}, 2006 + image};
Alignment is wrong. (That's why I don't like aligning to the open brace.)
Also, I'm pretty sure most of those explicit constructions are unnecessary.
« Back to merge proposal
A lot of nits:
222 +MirCursorConfi guration: :MirCursorConfi guration( char const* s_name)
223 +{
224 + s_name ? name = std::string(s_name) : name = std::string();
225 +}
MirCursorConfig uration: :MirCursorConfi guration( char const* name) :
name{name ? std::string(s_name) : std::string()}
{
}
~~~~
235 + std::unique_ ptr<MirCursorCo nfiguration> c(new MirCursorConfig uration( name));
236
237 - return c;
238 + return c.release();
return new MirCursorConfig uration( name);
~~~~
263 +
Why?
~~~~
434 + auto observer = std::make_ shared< UpdateCursorOnS urfaceChanges> (cursor_ controller) ;
auto const?
~~~~
494 + std::shared_ ptr<mi: :Surface> top_surface_ at_point = nullptr;
std::shared_ ptr<mi: :Surface> top_surface_ at_point;
~~~~
523 + try >remove_ observer( observer) ;
524 + {
525 + input_targets-
526 + }
527 + catch (...)
528 + {
529 + }
I don't expect input_targets- >remove_ observer( observer) to throw.
If removing observer does throw then surely things are so broken that we should stop execution. Not eat the exception!
~~~~
730 #include "mir_test_ framework/ display_ server_ test_fixture. h"
Unused. (I suspect a whole bunch more includes are unused - e.g. #include "mir/compositor /scene. h")
~~~~
1017 +struct DeferredInProce ssServer : mtf::InProcessS erver erver:: SetUp() ; }
1018 +{
1019 + void SetUp() override { /* TODO this is a nasty frig around the unfortunate coupling in InProcessServer */ }
1020 + void start_server() { mtf::InProcessS
1021 +};
You might like to update to match test_client_ input.cpp (or even put somewhere common).
struct DeferredInProce ssServer : testing::Test, private mtf::ServerRunner :stop_server( ); }
{
void TearDown() override { ServerRunner:
using ServerRunner: :start_ server; :new_connection ;
using ServerRunner:
};
~~~~
2001 + StubInputSurface surface1{ geom::Rectangle {geom:: Point{geom: :X{0}, geom::Y{0}}, geom::Width{ 1}, geom::Height{1}}}, geom::Rectangle {geom:: Point{geom: :X{0}, geom::Y{0}}, geom::Width{ 1}, geom::Height{1}}},
2002 + geom::Size{
2003 + image};
2004 + StubInputSurface surface2{
2005 + geom::Size{
2006 + image};
Alignment is wrong. (That's why I don't like aligning to the open brace.)
Also, I'm pretty sure most of those explicit constructions are unnecessary.