Skip to content

Add ipc method to send view to workspace #2646

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

Merged
merged 13 commits into from
Jul 1, 2025

Conversation

marcusbritanicus
Copy link
Contributor

No description provided.

uint64_t x = wf::ipc::json_get_uint64(data, "x");
uint64_t y = wf::ipc::json_get_uint64(data, "y");
uint64_t output_id = wf::ipc::json_get_uint64(data, "output-id");
std::optional<uint64_t> view_id = wf::ipc::json_get_optional_uint64(data, "view-id");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused, if the method is send-view then why is the view optional? IPC clients can call set-workspace if they want to switch without a view ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied the code from set-workspace, which is why it looks like this.

I just updated it, I'll push it shortly.

return wf::ipc::json_error("Cannot grab view on a different output!");
}

wf::view_change_workspace_signal signal;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that pretty much the same code has been implemented already in the same file, maybe we can have a shared function instead of duplicating the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have a suggestion as to where we can do this, I'll try to implement it. For now, I'm leaving it as it is.

@@ -24,6 +24,31 @@ class workspace_animation_t : public duration_t
timed_transition_t dy{*this};
};

/**
* A mall helper function to move a view and it's children to workspace @to_ws.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* A mall helper function to move a view and it's children to workspace @to_ws.
* A small helper function to move a view and it's children to workspace @to_ws.
Suggested change
* A mall helper function to move a view and it's children to workspace @to_ws.
* A mall helper function to move a view and it's children to workspace @to_ws.

Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one last small change, otherwise lgtm!

Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, needs a code style fix and then we're good to go :)

@marcusbritanicus
Copy link
Contributor Author

lgtm, needs a code style fix and then we're good to go :)

Just uncrustified. Sorry, I had forgotten about this, been busy with work. :(

@ammen99
Copy link
Member

ammen99 commented Jul 1, 2025

Thanks :)

@ammen99 ammen99 merged commit c344bab into WayfireWM:master Jul 1, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants