Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop dead code #3620

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/include/server/mir/shell/abstract_shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,6 @@ class AbstractShell : public virtual Shell, public virtual FocusController
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface) override;

int set_surface_attribute(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib,
int value) override;

int get_surface_attribute(
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib) override;

void raise_surface(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
Expand Down
10 changes: 0 additions & 10 deletions src/include/server/mir/shell/shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@ class Shell :
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface) = 0;

virtual int set_surface_attribute(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib,
int value) = 0;

virtual int get_surface_attribute(
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib) = 0;

virtual void raise_surface(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
Expand Down
10 changes: 0 additions & 10 deletions src/include/server/mir/shell/shell_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@ class ShellWrapper : public Shell
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface) override;

int set_surface_attribute(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib,
int value) override;

int get_surface_attribute(
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib) override;

void raise_surface(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ class SystemCompositorWindowManager : public WindowManager
MirInputEvent const* event,
MirResizeEdge edge) override;

int set_surface_attribute(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib,
int value) override;

using OutputMap = std::map<std::weak_ptr<scene::Surface>, graphics::DisplayConfigurationOutputId, std::owner_less<std::weak_ptr<scene::Surface>>>;

std::mutex mutable mutex;
Expand Down
6 changes: 0 additions & 6 deletions src/include/server/mir/shell/window_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ class WindowManager

virtual bool handle_pointer_event(MirPointerEvent const* event) = 0;

virtual int set_surface_attribute(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib,
int value) = 0;

virtual void handle_raise_surface(
std::shared_ptr<scene::Session> const& session,
std::shared_ptr<scene::Surface> const& surface,
Expand Down
62 changes: 0 additions & 62 deletions src/miral/basic_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,68 +435,6 @@ void miral::BasicWindowManager::handle_request_resize(
}
}

int miral::BasicWindowManager::set_surface_attribute(
std::shared_ptr<scene::Session> const& /*application*/,
std::shared_ptr<scene::Surface> const& surface,
MirWindowAttrib attrib,
int value)
{
WindowSpecification modification;
switch (attrib)
{
case mir_window_attrib_type:
modification.type() = MirWindowType(value);
break;
case mir_window_attrib_state:
modification.state() = MirWindowState(value);
break;

case mir_window_attrib_preferred_orientation:
modification.preferred_orientation() = MirOrientationMode(value);
break;

case mir_window_attrib_visibility:
// The client really shouldn't be trying to set this.
// But, as the legacy API exists, we treat it as a query
return surface->query(mir_window_attrib_visibility);

case mir_window_attrib_focus:
// The client really shouldn't be trying to set this.
// But, as the legacy API exists, we treat it as a query
return surface->query(mir_window_attrib_focus);

case mir_window_attrib_dpi:
default:
return surface->configure(attrib, value);
}

Locker lock{this};
if (!surface_known(surface, "set attribute"))
return 0;

auto& info = info_for(surface);

validate_modification_request(modification, info);
place_and_size_for_state(modification, info);
policy->handle_modify_window(info, modification);

switch (attrib)
{
case mir_window_attrib_type:
return info.type();

case mir_window_attrib_state:
return info.state();

case mir_window_attrib_preferred_orientation:
return info.preferred_orientation();
break;

default:
return 0; // Can't get here anyway
}
}

auto miral::BasicWindowManager::count_applications() const
-> unsigned int
{
Expand Down
6 changes: 0 additions & 6 deletions src/miral/basic_window_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ class BasicWindowManager : public virtual mir::shell::WindowManager,
MirInputEvent const* event,
::MirResizeEdge edge) override;

int set_surface_attribute(
std::shared_ptr<mir::scene::Session> const& /*application*/,
std::shared_ptr<mir::scene::Surface> const& surface,
MirWindowAttrib attrib,
int value) override;

auto create_workspace() -> std::shared_ptr<Workspace> override;

void add_tree_to_workspace(Window const& window, std::shared_ptr<Workspace> const& workspace) override;
Expand Down
9 changes: 0 additions & 9 deletions src/miral/system_compositor_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,6 @@ bool miral::SystemCompositorWindowManager::handle_pointer_event(MirPointerEvent
return false;
}

int miral::SystemCompositorWindowManager::set_surface_attribute(
std::shared_ptr<ms::Session> const& /*session*/,
std::shared_ptr<ms::Surface> const& surface,
MirWindowAttrib attrib,
int value)
{
return surface->configure(attrib, value);
}

void miral::SystemCompositorWindowManager::on_session_added(std::shared_ptr<mir::scene::Session> const& /*session*/) const
{
}
Expand Down
6 changes: 0 additions & 6 deletions src/miral/system_compositor_window_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ class SystemCompositorWindowManager: public mir::shell::WindowManager,
MirInputEvent const* event,
MirResizeEdge edge) override;

int set_surface_attribute(
std::shared_ptr<mir::scene::Session> const& session,
std::shared_ptr<mir::scene::Surface> const& surface,
MirWindowAttrib attrib,
int value) override;

void advise_output_create(Output const& output) override;
void advise_output_update(Output const& updated, Output const& original) override;
void advise_output_delete(Output const& output) override;
Expand Down
17 changes: 0 additions & 17 deletions src/server/shell/abstract_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,23 +399,6 @@ void msh::AbstractShell::stop_prompt_session(
prompt_session_manager->stop_prompt_session(prompt_session);
}

int msh::AbstractShell::set_surface_attribute(
std::shared_ptr<ms::Session> const& session,
std::shared_ptr<ms::Surface> const& surface,
MirWindowAttrib attrib,
int value)
{
report->update_surface(*session, *surface, attrib, value);
return window_manager->set_surface_attribute(session, surface, attrib, value);
}

int msh::AbstractShell::get_surface_attribute(
std::shared_ptr<ms::Surface> const& surface,
MirWindowAttrib attrib)
{
return surface->query(attrib);
}

void msh::AbstractShell::raise_surface(
std::shared_ptr<ms::Session> const& session,
std::shared_ptr<ms::Surface> const& surface,
Expand Down
16 changes: 0 additions & 16 deletions src/server/shell/shell_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,6 @@ void msh::ShellWrapper::destroy_surface(
wrapped->destroy_surface(session, surface);
}

int msh::ShellWrapper::set_surface_attribute(
std::shared_ptr<ms::Session> const& session,
std::shared_ptr<ms::Surface> const& surface,
MirWindowAttrib attrib,
int value)
{
return wrapped->set_surface_attribute(session, surface, attrib, value);
}

int msh::ShellWrapper::get_surface_attribute(
std::shared_ptr<ms::Surface> const& surface,
MirWindowAttrib attrib)
{
return wrapped->get_surface_attribute(surface, attrib);
}

void msh::ShellWrapper::raise_surface(
std::shared_ptr<ms::Session> const& session,
std::shared_ptr<ms::Surface> const& surface,
Expand Down
9 changes: 0 additions & 9 deletions src/server/shell/system_compositor_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,6 @@ bool msh::SystemCompositorWindowManager::handle_pointer_event(MirPointerEvent co
return false;
}

int msh::SystemCompositorWindowManager::set_surface_attribute(
std::shared_ptr<ms::Session> const& /*session*/,
std::shared_ptr<ms::Surface> const& surface,
MirWindowAttrib attrib,
int value)
{
return surface->configure(attrib, value);
}

void msh::SystemCompositorWindowManager::on_session_added(std::shared_ptr<mir::scene::Session> const& /*session*/) const
{
}
Expand Down
16 changes: 0 additions & 16 deletions tests/include/mir/test/doubles/stub_shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,6 @@ struct StubShell : public shell::Shell
{
}

int set_surface_attribute(
std::shared_ptr<scene::Session> const& /*session*/,
std::shared_ptr<scene::Surface> const& /*surface*/,
MirWindowAttrib /*attrib*/,
int value) override
{
return value;
}

int get_surface_attribute(
std::shared_ptr<scene::Surface> const& /*surface*/,
MirWindowAttrib /*attrib*/) override
{
return 0;
}

void raise_surface(
std::shared_ptr<scene::Session> const& /*session*/,
std::shared_ptr<scene::Surface> const& /*surface*/,
Expand Down
6 changes: 0 additions & 6 deletions tests/miral/ignored_requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ TEST_P(IgnoredRequests, remove_unknown_surface_noops)
basic_window_manager.remove_surface(session, window);
}

TEST_P(IgnoredRequests, set_attribute_on_unknown_surface_noops)
{
auto const window = GetParam().window(*this);
basic_window_manager.set_surface_attribute(session, window, mir_window_attrib_state, mir_window_state_maximized);
}

TEST_P(IgnoredRequests, raise_unknown_surface_noops)
{
auto const window = GetParam().window(*this);
Expand Down
19 changes: 0 additions & 19 deletions tests/unit-tests/scene/test_abstract_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,25 +471,6 @@ TEST_F(AbstractShell, pointer_input_events_are_handled_by_window_manager)
EXPECT_TRUE(shell.handle(*event));
}

TEST_F(AbstractShell, setting_surface_state_is_handled_by_window_manager)
{
std::shared_ptr<ms::Session> const session =
shell.open_session(__LINE__, mir::Fd{mir::Fd::invalid}, "XPlane", std::shared_ptr<mf::EventSink>());

auto const params = mt::make_surface_spec(session->create_buffer_stream(properties));
auto const surface = shell.create_surface(session, {}, params, nullptr, nullptr);

MirWindowState const state{mir_window_state_fullscreen};

EXPECT_CALL(*wm, set_surface_attribute(session, surface, mir_window_attrib_state, state))
.WillOnce(WithArg<1>(Invoke([](std::shared_ptr<ms::Surface> const& surface)
{ surface->configure(mir_window_attrib_state, mir_window_state_maximized); return mir_window_state_maximized; })));

EXPECT_CALL(mock_surface, configure(mir_window_attrib_state, mir_window_state_maximized));

shell.set_surface_attribute(session, surface, mir_window_attrib_state, mir_window_state_fullscreen);
}

TEST_F(AbstractShell, as_focus_controller_set_focus_to_notifies_session_event_sink)
{
auto session = shell.open_session(__LINE__, mir::Fd{mir::Fd::invalid}, "XPlane", std::shared_ptr<mf::EventSink>());
Expand Down
Loading