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

toplevel-view: emit move_to_wset() when changing to a dialog #2140

Merged
merged 1 commit into from
Feb 14, 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
4 changes: 2 additions & 2 deletions src/api/wayfire/signal-definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ struct view_pre_moved_to_wset_signal
wayfire_toplevel_view view;
/* The old wset the view was on, may be NULL. */
std::shared_ptr<wf::workspace_set_t> old_wset;
/* The new wset the view is being moved to. */
/* The new wset the view is being moved to, may be NULL. */
std::shared_ptr<wf::workspace_set_t> new_wset;
};

Expand All @@ -686,7 +686,7 @@ struct view_moved_to_wset_signal
wayfire_toplevel_view view;
/* The old wset the view was on, may be NULL. */
std::shared_ptr<wf::workspace_set_t> old_wset;
/* The new wset the view is being moved to. */
/* The new wset the view is being moved to, may be NULL. */
std::shared_ptr<wf::workspace_set_t> new_wset;
};

Expand Down
12 changes: 12 additions & 0 deletions src/view/toplevel-view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,19 @@ void wf::toplevel_view_interface_t::set_toplevel_parent(wayfire_toplevel_view ne
/* Make sure the view is available only as a child */
if (this->get_wset())
{
wf::view_pre_moved_to_wset_signal pre_move_to_wset;
pre_move_to_wset.view = {this};
pre_move_to_wset.old_wset = get_wset();
pre_move_to_wset.new_wset = nullptr;
wf::get_core().emit(&pre_move_to_wset);

get_wset()->remove_view({this});

wf::view_moved_to_wset_signal move_to_wset;
move_to_wset.view = {this};
move_to_wset.old_wset = pre_move_to_wset.old_wset;
move_to_wset.new_wset = nullptr;
wf::get_core().emit(&move_to_wset);
}

this->set_output(parent->get_output());
Expand Down
Loading