GitLab's annual major release is around the corner. Along with a lot of new and exciting features, there will be a few breaking changes. Learn more here.

Commit 6e84a5cc authored by Roman Gilg's avatar Roman Gilg
Browse files

refactor: remove has-child function

The function has become unnecessary as instead of providing a virtual override
like earlier we now just check if the window is contained in the children.

Where we need to do that, let's do it directly instead.
parent 82c71540
......@@ -1196,7 +1196,7 @@ void TestXdgShellClient::testMinimizeWindowWithTransients()
QVERIFY(transient);
QVERIFY(!transient->control->minimized());
QCOMPARE(transient->transient()->lead(), c);
QVERIFY(c->transient()->has_child(transient, false));
QVERIFY(contains(c->transient()->children, transient));
// minimize the main window, the transient should be minimized as well
win::set_minimized(c, true);
......
......@@ -81,11 +81,6 @@ void transient::remove_lead(Toplevel* lead)
}
}
bool transient::has_child(Toplevel const* window, [[maybe_unused]] bool indirect) const
{
return contains(children, window);
}
void transient::add_child(Toplevel* window)
{
assert(m_window != window);
......
......@@ -52,7 +52,6 @@ public:
std::vector<Toplevel*> const& leads() const;
bool has_child(Toplevel const* window, bool indirect) const;
void add_child(Toplevel* window);
virtual void remove_child(Toplevel* window);
......
......@@ -60,7 +60,7 @@ void set_subsurface_parent(Win* win, Lead* lead)
namespace WS = Wrapland::Server;
assert(!win->transient()->lead());
assert(!lead->transient()->has_child(win, false));
assert(!contains(lead->transient()->children, win));
lead->transient()->add_child(win);
restack_subsurfaces(lead);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment