Skip to content

Commit

Permalink
bugfix: always sending an initial output enter if we fail to send one…
Browse files Browse the repository at this point in the history
… otherwise
  • Loading branch information
mattkae committed Nov 27, 2024
1 parent 9e1ccc8 commit c0f55f8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/include/server/mir/scene/surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class Surface :
public ObserverRegistrar<SurfaceObserver>
{
public:
/// Called after the initial position and size has been set for the surface
virtual void advise_created() = 0;

// resolve ambiguous member function names

std::string name() const override = 0;
Expand Down
5 changes: 5 additions & 0 deletions src/server/scene/basic_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ void ms::BasicSurface::unregister_interest(SurfaceObserver const& observer)
observers->unregister_interest(observer);
}

void ms::BasicSurface::advise_created()
{
linearised_track_outputs();
}

std::string ms::BasicSurface::name() const
{
return synchronised_state.lock()->surface_name;
Expand Down
1 change: 1 addition & 0 deletions src/server/scene/basic_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class BasicSurface : public Surface
void register_early_observer(std::weak_ptr<SurfaceObserver> const& observer, Executor& executor) override;
void unregister_interest(SurfaceObserver const& observer) override;

virtual void advise_created() override;
std::string name() const override;
void move_to(geometry::Point const& top_left) override;

Expand Down
2 changes: 2 additions & 0 deletions src/server/shell/abstract_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ auto msh::AbstractShell::create_surface(
{
decoration_manager->decorate(result);
}

result->advise_created();
return result;
}

Expand Down
1 change: 1 addition & 0 deletions tests/include/mir/test/doubles/stub_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace doubles
// scene::Surface is a horribly wide interface to expose from Mir
struct StubSurface : scene::Surface
{
void advise_created() override { }
std::string name() const override { return ""; }
void move_to(geometry::Point const&) override {}
geometry::Size window_size() const override { return {}; }
Expand Down

0 comments on commit c0f55f8

Please sign in to comment.